Dear Statalists,
I would like to generate 67 random groups for 271 observations. I know the below code might work:
set obs 271
range no 1 271
gen r= uniform()
gen group=1
sort r
replace group=2 in 5/8
...
However, is there any better way that can be used to generate 67 random groups simultaneously?
Thanks in advance.
Best,
Cong
Related Posts with Random group generation
Imposing two parameter entries are equal in impact matrix for the SVAR commandI am trying to specify an IS curve in my impact matrix for my structural var. In my structural VAR, …
Adding auxiliary variables in a modelGreetings, I am new to STATA. I would like to ask how to insert auxiliary variables in one of my st…
r601 error - file C:\Users\admin\AppData\Local\Temp\ST_aef0_000002.t mp not found r(601);I'm try to run the code shown below. The app geocode was down loaded from the internet. I'm running …
Retrieve the numeric value of a labelI have a string variable nation2 distributed as follows: Code: . tab nation2, m nation2 | …
Time fixed effects as dummies change significanceDear Statalist, I am doing research on using nighttime light (radiances per area) to predict real re…
Subscribe to:
Post Comments (Atom)
0 Response to Random group generation
Post a Comment