- Whats the difference between gen and egen in Stata 12?
StasK is correct Techincally, egen is an "extension" to the egen command because it reaches beyond simple computations (var1 + var2, log(var1), etc ) to add descriptive stats, standardizations and more Some of the stuff that can be done with plyr and apply in R is therefore done with statsby and egen in Stata
- How can I rank observations within groups in Stata?
This isn't ranking in most senses that I have seen discussed, but Stata's egen, rank() does get you part of the way But the direct way, which was mentioned in the Statalist thread cited elewhere in this thread (start here) is simpler in spirit than any solution quoted:
- Stata: using egen group () to create unique identifiers
Stata: using egen group () to create unique identifiers Asked 11 years, 3 months ago Modified 8 years, 1 month ago Viewed 25k times
- Using if qualifier with egen in Stata - Stack Overflow
Using if qualifier with egen in Stata Asked 13 years, 3 months ago Modified 7 years, 3 months ago Viewed 21k times
- Getting the sum of two variables on Stata with missing values
How do I generate a new variable which gives me the sum of two variables (msf_n_4weeks and msm_n_4weeks) but only assigns a missing value if BOTH of the values for the variables is missing The var
- is there an equivalent to Statas egen function? [duplicate]
Stata has a very nice command, egen, which makes it easy to compute statistics over group of observation For instance, it is possible to compute the max, the mean and the min for each group and ad
- Stata egen combined with if - Stack Overflow
If I use egen with if, if year > 2002 { bysort year month :egen Z= total( x*weight) } else { bysort year month : egen Z= total(y*weight*0 5) } this code is not going to work, because if year <2002 , Stata would report that z has already been created Is there any way to achieve the goal? I used a very crude and brute force way to solve this
|