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?
Selectively dropping 1 of 2 similar variables measured on the same dateData cleaning question: I have a longitudinal data set from 2009 to 2020 involving children and adol…
Event History Analysis vs. LogitI have a conundrum regarding a policy analysis I'm running. I have a variable stateorder that is cod…
Summary stat. to excelDear All, I would like to export my results to an excel sheet. I tried this code below but it did n…
Help with small sample panel data with cross-sectional dependenceI'm using the CCE estimation technique for a research work. My dataset consists of eight cross-secti…
Question on bar graph (percentages of answer options) by group for more than 3 variablesHi all I am fairly new to Stata and the forum, I hope the way I described my problem is ok! Thank …
Subscribe to:
Post Comments (Atom)
0 Response to How do I draw two samples from dataset?
Post a Comment