I'm new to Stata, so apologies in advance if this is a basic question. I am having some issues applying coefficients from my gologit2 model from my data, to a test dataset. I'm wondering whether I'm approaching this wrong!?
- Dataset split into two - development and test datasets
- Outcome variable is severity of a disease of interest (mild, moderate, severe)
- GOLOGIT2 used due to issues with the proportional odds assumption being violated in OLOGIT
- Stepwise ran using GOLOGIT2 (without autofit as read somewhere that SW and autofit should not be run together)
- Final model run but with autofit.
- When I try to apply coeefficients from this regression to my test dataset it does not work.I have tried the following options:
- I applied estimation results to test data and tried to use predict.
- Code:
- Use develop.dta
- Gologit2 y i.x1 x2 x3, autofit
- drop _all
- use test.dta
- predict p1 p2 p3
- Issue is that dummy variables created in the development data that are not present in the test data
- After fitting the model on the development data, merge in test data in and run the predict command - Issue is that it wont predict for the merged data – probably due to a similar issue to the one above
- I pulled in the development and test data into one big dataset and tried to use if with gologit2 (i.e. to run the model on half of my data if var ==1 ), then appy coefficients to all.Message came up saying that I could not use if with gologit2.
Many thanks for your help!
0 Response to Predictions using gologit2 - issues applying coeffcients to validation dataset
Post a Comment