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
longitudinal analysis with measurements taken at different timesdear stata users, I'm dealing with a longitudinal dataset with measurements taken in different time…
Should I spend more time on improve my programming ability?I am a doctoral student.My major is applied econonmics.My main job is to analyze agricultural proble…
Problem in duplicate case using HIES 2018-19My data has duplicate cases, I want to remove duplicate case if they report '2' as response in varia…
Retaining the 5 closest matches when matching firms using -rangejoin-Hi I have a matched panel data set of treated and control firms, matched on industry (sic2), and 50…
classification of firms into groups based on some criterion Code: input str1 firm int year float(profits) "a" 2000 . "a" 2001 . "a" 2002 . "…
Subscribe to:
Post Comments (Atom)
0 Response to Variation within a group
Post a Comment