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?
error ) required r(100);Dear all, The code below gives me the error Code: ) required ; Code: twoway (line RM_RF Year), yt…
Map with labels for only a select countriesHi, I would like to be able to draw a map while labelling only a few countries. I have implemented t…
Fixed effects panel regression with robust standard error- which code to use?Hi, I'm using the following code to perform fixed effects panel regression Code: areg y x1 x2 i.ye…
How can I transform the data structure?Dear all, How can i transform the data structure below Code: * Example generated by -dataex-. For m…
Generating a Variable Conditional on Many Variable that are not Dummy VariablesHi everyone, I have this dataset that contains information on the relationship of each household mem…
Subscribe to:
Post Comments (Atom)
0 Response to How do I draw two samples from dataset?
Post a Comment