![]() Therefore, if we want to include only the nonmissing cases, we need to Note that egen newvar = total() treats missing values as 0. egen total_weight=total(weight), by(foreign) creates the total car weight by car type. Type help egen to view a complete list and descriptions of the functions that go with egen.īack to top Generating new variables total() Commonly used functions include but are not limited to mean(), sd(), min(), max(), rowmean(), diff(), total(), std(), group() etc. Egen is the extended generate and requires a function to be specified to generate a new variable.Įgen newvar = function(arguments) creates the new variable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |