I created a data with 100,000 obs with uniform distribution and also created information for education and wage, but now, from this data I have to create 500 samples random (each one has to be different) but I tried with bsample and it didn't work, so I read about forvalue and foreach (to apply a loop), but I'm not sure how use it, I was trying but I really need help. This is how I created the data:
set obs 100000
set seed 20
gen x=_n
gen educ= 1 + (4-1)*uniform()
sum educ
gen error= 0.5+1*invnorm(uniform())
gen leduc=log(educ)
gen lwage=0.35*leduc+error
gen wage=(educ^0.35)*exp(error)
Related Posts with multiple random sample from a data
pubbias command in midas not workingHi, I am using midas command to do meta analysis of diagnostic accuracy studies. All commands are wo…
ITSA - segmented regression in StataHi all and Ariel Linden I was going through the UCLA page on how to do peicewise regression in Stat…
sttocc matching for both analysis time and calendar time - nested case control studyHi folks, Apologies in advance for the rookie question! I am designing a nested case-control study …
Percentage change from different baseline years in panel dataDear All, I am working with a dataset that looks like this: Code: * Example generated by -dataex-…
output all unlabeled values of variables with value labelHi! How may I select all unlabeled values of variables which - except for those values - have a val…
Subscribe to:
Post Comments (Atom)
0 Response to multiple random sample from a data
Post a Comment