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
Comparing cox proportional hazard linear and non-linear (restricted cubic spline) models using likelihood ratio testHi folks - I am trying to understand and figure out how to actually code/test non-linearity between …
How can I create this variable?Hi, I have data for the total number of Corona cases and the total population. What should I do to c…
Plotting the slopeGood day Statalisters! Is there a command in Stata where I can plot a curve using the lower bound a…
Panel DataHello I am making a panel data model where I have the following regression: xtreg Domestic_Health rD…
Creation of Compound Interest variableGood evening everyone, I do have the closing prices NAV (net asset value) and I calculate the retur…
Subscribe to:
Post Comments (Atom)
0 Response to multiple random sample from a data
Post a Comment