Stata 15 help for newvar

Title

newvar (from [U] 11.4.2 Lists of new variables)

Description

A newvar is the name of a variable that does not yet exist in the dataset. A newvar is a new varname, such as

x myvar Myvar inc92 reciprocal_of_miles_per_gallon _odd _1994

If you are interested in creating a variable list of new variables, see newvarlist.

Examples

. webuse hbp2 . generate not_white = race!=1 . encode sex, generate(gender)

. webuse hbp3, clear . decode female, generate(sex)

. sysuse auto, clear . lowess mpg weight, generate(mpghat) . generate weight2 = weight^2


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index