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
Gravity model, low R2-withinHi all ! I'm running a bilateral trade panel data of 42 reporter with 186 partner for the year 2015…
rename all words of localDear all, I have trouble finding my way through all possible local manipulations to find what I nee…
Using Wald Test for Complex Interaction ModelsDear all: My name is Siyu. I am running a random-effects logit model involving many interaction ter…
Panel Data Missing Observations! SolutionDear Statalisters, I am currently running analysis on a 2-period panel data set from China. I use a…
Meta-regression with WLS: Wrong sign due to weightingDear Statalist, I'm asking for advice to solve a problem with my meta-regression model based on a W…
Subscribe to:
Post Comments (Atom)
0 Response to Variation within a group
Post a Comment