Hello
To detect if the value of a numeric variable var_num changed within a group var_cat, I do this:
bysort var_cat: egen sd = sd(var_num)
replace sd = 1 if sd > 0 & sd != .
tab sd, m
Are there any command that execute this function? In the example, to create a variable like "sd"
Thanks
Related Posts with Variation within a group
Insignificant Pooled OLS model running with bank lending dataHi, We are writing our master thesis on the effect of capital requirements on bank lending, using t…
Comparison before-and-after mean for each individual (t-test)Hi, I am a graduate student. I have variables indicating a test score and retirement dummy. I want …
Help on control variablesDear everyone, I am running a regression of banks in around 26 countries, and I want to include con…
Help on labeling categorical variablesHello I'm working with my data file but find difficulty on labelling derived categorical variables.…
matsize and Pesaran estimationLadies & Gentlemen, up to 7 regressors, STATA could produce regression output successfully. When…
Subscribe to:
Post Comments (Atom)
0 Response to Variation within a group
Post a Comment