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
Instrumental Variable, combining datasets Hello, I am using an instrumental variable for trade openness to analyze the effect of trade openn…
Adjusting the dataset to create a Panel Data AnalysisHello everybody, I have probably a rather simple question, but I still spent hours to solve it, so …
How do I choose which dummy variable to omit when I have dummies in the form i.variableHello, I have split up my independent variable of interest into quantiles where the first quantile …
Quotes do not match error in putexcel commandHello, I'm having terrible trouble with quotes supposedly not matching in a putexcel command. This i…
Expand data based on a time variable & extract information in panel dataDear Statalisters, Below is my data (show the two five records), which includes gender, begin date …
Subscribe to:
Post Comments (Atom)
0 Response to Variation within a group
Post a Comment