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)
Keep the first observation within a moving 30-day windowI have the following dataset. I want to keep d=1 for the first observation within 30-day moving wind…
Detecting inverted duplicates over two columnsHello, I have searched for an answer to this simple question on previous forums, and cannot find the…
Is it possible to not set values of optional integer arguments with the syntax commandWhen specifying optional arguments integer arguments using the syntax command it is usually necessar…
Why the different bootstrap errors in panel data random effects?Hi, in help xt_vce_options I found the following recommendation: When working with panel-data mode…
Nested forvalue loops - referring to previous macros in a relevant macroGood afternoon. Could anyone help me decipher what syntax error I am producing in the below command…
Subscribe to:
Post Comments (Atom)
0 Response to egen mean_var = mean(var), by(xx & xx)
Post a Comment