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
Question about using one seed to draw sample from multiple data set.Can anyone help me with how seed works in Stata for drawing sample from multiple data sets? I have …
PLEASE HELP: Wrangling 15-min interval smart electricity meter dataHi Hoping there's a relatively easy fix for this, because I'm new to this kind and size of data set…
Simple descriptive tableFirst time poster - greetings all! I am working on Stata 15.1 on a closed system without internet ac…
How to estimate elasticity in both sides Box-Cox transformed modelDear STATA users, I have a model that both dependent and independent variables are box-cox transfor…
Gmm arellano estimation .Hello everyone , I am writing my master thesis about determinants of international migration from d…
Subscribe to:
Post Comments (Atom)
0 Response to Random group generation
Post a Comment