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.
Related Posts with How do I draw two samples from dataset?
Agreement (kappa) Dear Statalisters, I have a 65 observation, we want to look at the variable only walking >=6 min…
Hypothetical default rateDear Statalist, I have a dataset containing loans which are followed through time. I am running a l…
Annual stock returnHey, I need your help. I need the follow variable "RETURN" in STATA. RETURN is the annual stock re…
Is it possible to use two datasets at once?Hey STATA noob here, I'm wondering if it's possible to use variables from two different datasets at…
brant can only be used after ologitHi everyone, Using brant subcommand, I am trying to test the parallel regression assumption. I am us…
Subscribe to:
Post Comments (Atom)
0 Response to How do I draw two samples from dataset?
Post a Comment