close

I am struggling Marianne's case many weeks. I taught her how to use LRT to determine whether her reduced model is good, but the result always rejects null hypothesis. It doesn't make sense because all remaining independent variables are significant!!



I re-ran her program again, but have a good result that is totally different from Marianne's and doesn't reject null hypothesis. I requested her re-ran her SAS programs again, but she still had different results from mine.



After comparing our programs, I finally figured out what happened. That is, I keep all discrete independent variables in CLASS statement even though I don't use them in MODEL statement, but Marianne deleted them in both CLASS and MODEL statement, such as:



/*Marianne's program*/

proc genmod data=mb1.total;

class urban hospcode;

model psatisfa=urban workcomp asupserv / dist=nor link=identity type3;

repeated subject=hospcode/type=exch;

run;



/*My program*/

proc genmod data=mb1.total;

class urban hospcode bedsize netwrk totalmagnet; <==here the difference is!!

model psatisfa=urban workcomp asupserv / dist=nor link=identity type3;

repeated subject=hospcode/type=exch;

run;



I discuss with my supervisor, Mark, and he said both of the two programs are correct. Why are the results different? Because if we put variables in CLASS statement, SAS will delete all missing data in those variables, whatever the variables are in the model or not! On the contrary, if we don't keep those non-significant variables in CLASS statment, SAS will hold all data to fit the model.



Therefore, in likelihood ratio test, we need to delete all missing data and use the remaining completed data to yield likelihood function. After determining this reduced model is better than full model, then use whole dataset to fit final model, just as what Marianne's program shows!
















arrow
arrow
    全站熱搜

    cchien 發表在 痞客邦 留言(2) 人氣()