I am drawing a random sample (1/3) form a data set to predict an outcome variable using a probit regression.
Second, I am trying to use the estimated coefficients to predict the same outcome variable for the remaining observations(2/3).
Here, I've been having issues to only use the remaining observations instead of generating another random sample that would then also include observations from the first sample.
After having predicted the outcome variables of the second sample, it has to be divided at the median whereby the above median observations and below median observations will be allocated a dummy variable.
sample 33.333
dprobit call....
estimates store dprobit
predict callpredicted
summarize callpredicted, detail
egen p50=pctile(callpredicted)
restore
sum callpredicted if callpredicted<p50
sum callpredicted if callpredicted>p50
Thank you.
0 Response to How do I draw two samples from dataset?
Post a Comment