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
Plotting coefficient of two dependent variables from multiple modelsHello Statalist, I have multiple regression models with different dependent variables (say, v1 to v…
marginal effects command with pwcompareAfter running a xtlogit regression, I was trying to compare the effects of investing on the mental h…
Creating a foreach loop for all string values of a variable.Hello, I am looking to code a foreach loop that completes a ustrlen() command for all string values…
Breusch-Pagan and Hausman Interpretation and Execution in Panel Data ModelsHi Guys, I am running a series of regressions on a panel of 36 countries over a 40 year period to d…
Matrix inversion in Stata 16 and 17 leads to different resultsHi all, I think I found some behaviour of Stata 16 vs Stata 17 which I do not understand and is worr…
Subscribe to:
Post Comments (Atom)
0 Response to Variation within a group
Post a Comment