Questions tagged [stata]
Stata is a commercial, general-purpose statistical software. It is available for Windows, Mac and Unix systems. Stata's capabilities include data management, statistical analysis and graphics. ------------------------------------------------------------ IMPORTANT: Click 'Learn more' for advice on how to ask high quality Stata-related questions on Stack Overflow.
stata
4,710
questions
1
vote
1
answer
27
views
Does anyone know how to make confidence intervals appear when using the "estat trendplots" command in Stata (after running "xtdidregress")
The title says it all.
After running a diff-in-diff in Stata with "xtdidregress", I am then creating a graph testing the parallel trends assumption using the command "estat trendplots&...
1
vote
0
answers
27
views
Stata regression table
I need help creating a regression table in Stata for LaTeX. I want to include different regression specifications (in columns) and different outcome variables (in rows) in the same regression table. ...
0
votes
0
answers
12
views
frmttable won't replace my tables despite using replace - I have to manually delete them [closed]
I am having an issue with the frmttable command in Stata. I add the replace in it and it always gives me the error that the file already exists. I then have to manually delete the file. A sample of ...
1
vote
0
answers
23
views
Stata ODBC - Why does declaring a temporary function in my query yield an error?
I'm trying to load data into Stata from a SQL database hosted in Databricks, via the odbc load command. For part of the query I need to declare and run a small Python function (Databricks SQL, or at ...
-1
votes
0
answers
10
views
multinomial choice model with high-dimension fixed effects
I am running a regression with 1 million observation
outcome: occupation choice(5 category)
fixed effects: high school fixed effects(about 1000 groups), college fixed effects(about 800 groups), and ...
0
votes
1
answer
27
views
Get formatted correlation coefficients with significance levels in stata
I have a correlation matrix I estimate in Stata:
estpost corr var1 var2 var3 var4, matrix listwise
I want to get the output to LaTeX, simultaneously displaying only 3 decimal places and ...
0
votes
0
answers
71
views
did_multiplegt_dyn with controlvariables
I run a staggered DiD regression with the Stata command did_multiplegt_dyn by De Chaisemartin, C., & d'Haultfoeuille, X. (2024). Without control vars the command runs
# Comand without controls
...
0
votes
0
answers
32
views
how to estimate a simple 1-factor model in statsmodels?
Consider the simple 1-factor model structure below:
R_it = a_i + beta_i*S_t + u_it
S_t = phi* S_t-1 + v_t
where R_it is a 5x1 vector, Vt is a normal N(0,1) and Uit is N(0, sigma) As you can see, ...
-1
votes
1
answer
25
views
How can I create a day number variable in Stata based on dates?
I want to create a variable with the number of the day a participant took a survey (first day, second day, thirds day, etc.) The issue is that there are participants that took the survey after ...
0
votes
1
answer
23
views
Lagged range in if statement
I have successfully used lagged values in the "IF" section of a replace. How do I specify a range instead of each individual lagged variables. Iteration is not an option. I have ~...
-2
votes
0
answers
26
views
Create joint state for overlapping states
I have a dataset in the long format where there are multiple rows per individual. I have variables start date, end date and state. The state variable has values such as A, B, C etc. ID 1 has state A ...
0
votes
0
answers
21
views
How the deal with the max(A) error in Sata
I use the following code to calculate maximum eigenvalue in stata
encode Name, gen(name)
spset name, coord(latitude longitude )
spset, modify coordsys(latlong)
spmat idistance W longitude latitude,...
-1
votes
0
answers
34
views
Sankey diagram in Stata
with Stata can I do a Sankey diagram where, for example, 123 of forestry will be divided into three different flows (three different lines)?
TOTAL
descr
dest1
dest2
dest3
123
forestry
eco
bio
water
...
0
votes
0
answers
20
views
Number missing in dtable baseline table
How can I add a row of number missing into a baseline table created with dtable in Stata 18?
Example baseline table:
clear
cls
webuse brcancer
/* Generate missing values */
set seed 1234
gen rand1 = ...
1
vote
2
answers
39
views
Defining global lists in Stata if elements consist of several words
I need to make some operations with many Excel files with long names of the type "Saratov Region.xls" (I mean that names of these files contain one or more blank spaces).
I tried to write ...