Dear All,
I want Stata to tell me the number of observation for a large list of variables by region. The first set of commands works:
The second set returns:
xvars and raw are variable list. The reason I run the second set is that the first set shortens the variables names to an unreadable format. So I hope to get the full variable name out of the second set of commands, but I get the error. Is there a way to overwrite this?
I have two regions and want for the variable lists know, how many I have by region. Seems like a straight forward problem?
I appreciate your help!
I want Stata to tell me the number of observation for a large list of variables by region. The first set of commands works:
Code:
*first set tabstat `xvars', by(Region) s(n) tabstat `raw', by(Region) s(n) gen Region_n = 2 replace Region_n = 1 if Region == "Europe" *second set tabstat Region_n, by(`xvars') s(n) tabstat Region_n, by(`raw') s(n)
Code:
. tabstat Region_n, by(`xvars') s(n) by(): too many variables specified
xvars and raw are variable list. The reason I run the second set is that the first set shortens the variables names to an unreadable format. So I hope to get the full variable name out of the second set of commands, but I get the error. Is there a way to overwrite this?
I have two regions and want for the variable lists know, how many I have by region. Seems like a straight forward problem?
I appreciate your help!
Comment