Stata is smart. Even though we did not specify the storage type in our generate statement, Stata knew to create a str9 lastname variable, because the longest last name is Bimslager, which has nine characters. Example 3 We wish to create a new variable, age2, that represents the variable...
egen newvar = mode(varname) calculates the mode of all nonmissing observations, and the variable newvar containing the mode is filled in for all observations, even those for which varname is missing (except for observations excluded using an if or in statement). This allows use of mode()...
Also, Stata labels the variables so that we know what they mean. spd1 is an indicator variable that is true (takes on the value 1) when spdcat is between 40 and 50; otherwise, it is zero. (There is an exception: if spdcat is missing, so are the spd1, spd2, and spd3 ...
Stata is smart. Even though we did not specify the storage type in our generate statement, Stata knew to create a str9 lastname variable, because the longest last name is Bimslager, which has nine characters. Example 3 We wish to create a new variable, age2, that represents the variable...