copy and paste this google map to your website or blog!
Press copy button and paste into your blog or website.
(Please switch to 'HTML' mode when posting into your blog. Examples: WordPress Example, Blogger Example)
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
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
egen and group when data has missing values - Stack Overflow I would like to use egen and group to create an identifier variable for observations that contain the same values for a specific set of variables However, some of the variables contain missing da
sum - Stata panel data: egen =total () over period starting with a . . . Your egen code wouldn't work, even in spirit The total() argument is illegal Typo: second = should be == Warning: the help for egen is explicit about not using subscripted expressions egen, sum() is undocumented as of Stata 9 Best to use and refer to total() The code is equivalent, but that still holds
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
Proportions by Year and State using egen Command I am trying to generate a new variable that is equal to the share of winners by state for each year in Stata I am using the egen command and I would like to know if this is the appropriate command
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