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)
Quarterly GDP disaggregation to monthly levels - Gravity model estimationDear Forum, I am currently working on a gravity model to estimate the effects on trade of an exogen…
Value ReplacementDear all, I am quite new with stata, and after a couple of days trying to fix a problem without any…
Stop dofile if drop did not make changeDear Statalists, for error-checking in many replace commands, I have found it useful to use the pro…
Fraction By GroupDear Stata Users; I have cross sectional data constructed by combining two waves of surveys. The edu…
Wilcoxon test for (in)equality of mediansHello everyone, For my univariate analyses I am running a number one-sample t-tests. However, I woul…
Subscribe to:
Post Comments (Atom)
0 Response to egen mean_var = mean(var), by(xx & xx)
Post a Comment