Skip to main content

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.

1 vote
1 answer
26 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&...
cyberalcito's user avatar
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. ...
Schwa97's user avatar
  • 11
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 ...
iris's user avatar
  • 1
1 vote
0 answers
22 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 ...
rsandler's user avatar
  • 210
-1 votes
0 answers
62 views

Seaborn's regplot and Stata's binscatter disagree` [closed]

I'm running on the same data either binscatter2 from Stata, or seaborn's regplot -- as below. Both these claim in their documentations that they first bin data based on the x-values into 20 equal ...
FooBar's user avatar
  • 16.3k
-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 ...
Qiuyi Wang's user avatar
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 ...
Peter's user avatar
  • 3
0 votes
0 answers
70 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 ...
mf_uni's user avatar
  • 3
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, ...
ℕʘʘḆḽḘ's user avatar
-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 ...
Queenie Yong's user avatar
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 ~...
Michael Bromiley's user avatar
-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 ...
Mahesh's user avatar
  • 7
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,...
jinchi's user avatar
  • 51
-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 ...
diego's user avatar
  • 1
0 votes
0 answers
18 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 = ...
jackahall's user avatar
  • 470

15 30 50 per page
1
2 3 4 5
315