Hi
How do I generate a mean variable sorted by both year and origin?
I want to generate the mean value of a variable by month and by origin
My best suggestion is:
egen mean_var = mean(var), by(month & origin)
but Stata says "& invalid name"
Related Posts with egen mean_var = mean(var), by(xx & xx)
binary choice model after collapseis it possible to use binary choice models to predict pr(y|x) after collapsing the data by group? …
Table command in stata 16 does not allow statistic optionHello there, I am running a 3-way table using table command. I tried to add statistic and no totals…
Whether we should control for country-level control variables for studying a single country?In an international setting, when I used the Difference-in-Differences (DiD) approach to examine the…
Why many commands do not work?Hello dear stata community I am kind of new to stata but I have been facing issues with many command…
Manually calculating IV standard errors and getting STATA to use them in the regression tableI found the following script from one of the other threads to be helpful in calculating IV standard …
Subscribe to:
Post Comments (Atom)
0 Response to egen mean_var = mean(var), by(xx & xx)
Post a Comment