Introductory Stata 9: Extended generate (egen)

preview_player
Показать описание
In this video, we will look at the "extended generate" command in Stata. The "egen" command is a more powerful version of the generate command, making some complicated jobs easier to accomplish.

**********************************
*9. Extensions to generate *
**********************************

cd "/Users/bobwen/Documents/2022 Youtube Teaching/Introductory Stata/9. Extensions to generate/"

capture log close

help egen

summarize

*Generate standard deviation of birth weights
egen bw_sd=sd(bwghtlbs)
summarize bwghtlbs bw_sd

*Compute the rowmean and rowmax for parents' education
egen pareduc=rowmean(fatheduc motheduc)
browse fatheduc motheduc pareduc

egen pareduc2=rowmax(fatheduc motheduc)
browse fatheduc motheduc pareduc2

*Cut birth weights into 10 equal deciles
egen bw_decile=cut(bwghtlbs), group(10)
tabulate bw_decile

log close

#egen #Stata
Рекомендации по теме
Комментарии
Автор

What about the xtile function? Do you does not like it?

manueltriano