Forum: open-discussion


RE: How can use the sample selection model to do the out sample prediction [ Reply ] By: Arne Henningsen on 2015-01-31 22:22 | [forum:41858] |
BTW: the sampleSelection package now has a predict() method: http://www.rdocumentation.org/packages/sampleSelection/functions/predict.selection Please check if it works in your case. If it does not work, please make sure that you use the latest version of the sampleSelection package and file a bug report with a reproducible example. Thank you! |
RE: How can use the sample selection model to do the out sample prediction [ Reply ] By: jason yao on 2014-05-13 07:35 | [forum:41851] |
Dear Arne, I debug the code and find the reason. When I define the selection model, I use an object to present the formula. and in the predict.selection function, it just get the name of the formula object, not the formula. So I define the selection model using the whole formula. And it works! Thanks! Jason |
RE: How can use the sample selection model to do the out sample prediction [ Reply ] By: jason yao on 2014-05-13 07:20 | [forum:41850] |
Dear Arne, Thanks a lot for your help. I check the code http://stackoverflow.com/questions/14005788/predict-function-for-heckman-model. It doesn't work. Maybe some packages updated. If you have some code which works. Please let me know. Warm regards! Jason |
RE: How can use the sample selection model to do the out sample prediction [ Reply ] By: Arne Henningsen on 2014-05-10 18:52 | [forum:41015] |
Dear Jason A predict() method for sampleSelection models is already on my todo list for some time: https://r-forge.r-project.org/tracker/index.php?func=detail&aid=5175&group_id=256&atid=1055 I recently started to implement this and I hope that I will be finished with it in a few weeks. Until then, you can use the method described at: http://stackoverflow.com/questions/14005788/predict-function-for-heckman-model Best regards, Arne |
How can use the sample selection model to do the out sample prediction [ Reply ] By: jason yao on 2014-05-08 10:11 | [forum:41006] |
In the sample selection model, neither the 2-step model nor the MLE model, we can just get the fitted value of the in-sample data. However, how can we use the model to predict the out-sample data. 1. The prediction of the selection model are the probabilities. How can we choose the threshold of the probability to decide the selection is 1 or 0. 2. Based on the selection model, the performance of the outcome model is influenced by the accuracy of the selection model. or we just need to use the outcome model to predict the out-sample data. Don't judge the observation is 0 or 1 first. Thanks! |