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?
splitting a string into a new variableHi in my dataset, I have a variable called AllAvailableHoldersOwned which states the ownership data…
Insert comma in string variableHi, I have a numeric variable that I would like to convert into a string variable with commas separ…
Assign value randomlyHi, I have a data of 5 clusters, each has 30 observations. I am asked to create a new variable, whi…
asdasd …
Yearly standard deviation of daily returnsHi Community, for a paper at university i need to calculate the annualized standard deviation of da…
Subscribe to:
Post Comments (Atom)
0 Response to How do I draw two samples from dataset?
Post a Comment