Hi,
I have parameters from a logit model predicting the labor force participation in the dataset lfp.csv. The dataset is produced using the outset statement from proc logit. The model is stratified by sex (0 1) and has some interaction variables (edu*grage). I want to use those parameters to predict the probability of the event to individuals in another dataset pop_2010 (which is not the dataset used to estimate parameters).
I read that the proc score can only work with parameters from linear regression, but not with logit. The store statement within the proc logit cannot be used too, since I don’t want to predict on the same dataset (and the prediction should be done without having access to the dataset used to estimate parameters).
Is there a way to do it quick and short?
Check either the CODE statement in PROC LOGISTIC (logit isn't a proc as far as I know so assuming you're referring to logistic). I think GLM has a similar statement.
https://documentation.sas.com/?docsetId=statug&docsetVersion=15.1&docsetTarget=statug_logistic_synta...
Or use PROC PLM and make sure to specify that the iLink option.
https://blogs.sas.com/content/iml/2019/02/11/proc-plm-regression-models-sas.html
And a few more worked examples of scoring data for logistic regression:
Is it possible to use a csv file for parameters in the restore statement of proc PLM?
Thanks. But the prediction should be done without having access to the dataset used to estimate parameters... so I don't see how I can used the proc logistic or glm. I'll read about the PLM procedure.
If you are able to use SAS to fit the model and do the prediction for new data, then you can absolutely use PROC LOGISTIC for both. See the example titled "Scoring data sets" in the PROC LOGISTIC documentation. As shown there, you can fit the model in one PROC LOGISTIC step using the OUTMODEL= option to save a special data set containing the model. You can then predict (score) new data with that model in a subsequent PROC LOGISTIC step (even in a different SAS session) by specifying the save model data in the INMODEL= option and using the SCORE statement to score the new data. The example shows another way to do exactly the same thing using the STORE statement (instead of OUTMODEL=) and then PROC PLM (instead of the second PROC LOGISTIC step) to do the scoring. You can do either.
I can't. The model is estimated in a secured lab, while the dataset for the prediction is on my laptop.
... and the "dataset for the prediction" was generated by the OUTEST= option in PROC LOGISTIC? If so, can the lab rerun the model using either the OUTMODEL= option or the STORE statement instead? If they can provide the resulting file from either of those, then you can use PROC LOGISTIC to score new data as in the example I referred to.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.