簡短的回答是在「重複」語句的末尾添加一個選項「PRINTMLE」。但是你在這裏發佈的代碼可能不會產生你真正想要的。因此,以下是更長的答案:
1.以下程序基於Windows的SAS 9.3(或更新版本)。如果您使用的是舊版本,則編碼可能會有所不同。
2.對於PROC MIANALYZE,需要PROC GENMOD的三個ODS表而不是一個,即1)參數估計表(_est); 2)協方差表(_covb);和3)參數索引表(parminfo)。在PROC多重填補語句的第一行應該是這樣的:
PROC MIANALYZE parms = ~_est covb = ~_covb parminfo=parminfo;
而〜_est指ODS參數表,並〜_covb指ODS協方差表。
有不同類型的ODS參數估計和協方差表。應該用一組特定的ODS表來替換符號「〜」,這將在下一部分討論。
3.從PROC GENMOD可以生成三組不同的ODS參數和協方差表。 3a)第一組表格來自非重複模型(即,沒有「重複」語句)。第一組表格從不重複模型(即,沒有「重複」語句)。在你的情況下,它看起來像:
Proc GenMod data=sc.wide_mip descending ; by _Imputation_;
…
MODEL seroP= int tf5 age/dist=bin Link=logit COVB; /*adding the option COVB*/
/*repeated subject=village/ type=unstr;*/
/*Note that the above line has been changed to comments*/
…
ODS OUTPUT
/*the estimates from a non-repeated model*/
ParameterEstimates=norepeat_est
/*the covariance from a non-repeated model*/
Covb = nonrepeat_covb
/*the indices of the parameters*/
ParmInfo=parminfo;
Run;
值得注意的是,1)選項COVB在模型聲明中,以獲得消耗臭氧層物質的協方差表。 2)「重複」聲明作爲評論。 3)「〜_est」表被命名爲「nonrepeat_est」。同樣,表「〜_covb」被命名爲「nonrepeat_covb」。
3b)第二組表包含基於模型的估計重複模型。在你的情況下,它看起來像:
…
MODEL seroP= int tf5 age/dist=bin Link=logit;
REPEATED subject=village/ type=un MODELSE MCOVB;/*options added*/
…
ODS OUTPUT
/*the model-based estimates from a repeated model*/
GEEModPEst=mod_est
/*the model-based covariance from a repeated model*/
GEENCov= mod_covb
/*the indices of the parameters*/
parminfo=parminfo;
Run;
在「重複」的聲明,該選項MODELSE是生成基於模型的參數估計值,以及MCOVB是生成基於模型的協方差。沒有這些選項,將不會生成相應的ODS表(即GEEModPEst和GEENCov)。請注意,ODS表名與以前的情況不同。在這種情況下,表格是GEEModPEst和GEENCov。在前面的情況下(一個不重複的模型),表格是ParameterEstimates和COVB。這裏,〜_est表格被命名爲「mod_est」,代表基於模型的估計值。同樣,〜_covb表被命名爲「mod_covb」。 ParmInfo表與前一個模型中的相同。
3c)第三組包含經驗估計,也來自重複模型。經驗估計也被稱爲ROBUST估計。聽起來像這裏的結果是你想要的。它看起來像:
…
MODEL seroP= int tf5 age/dist=bin Link=logit;
REPEATED subject=village/ type=un ECOVB;/*option changed*/
…
ODS OUTPUT
/*the empirical(ROBUST) estimates from a repeated model*/
GEEEmpPEst=emp_est
/*the empirical(ROBUST) covariance from a repeated model*/
GEERCov= emp_covb
/*the indices of the parameters*/
parminfo=parminfo;
Run;
正如你可能已經注意到,在「重複」的聲明,該選項更改爲ECOVB。這樣,將生成經驗協方差表。生成經驗參數估計值並不需要,因爲它們總是由過程生成的。 ParmInfo表與前面的情況相同。
4.放在一起,實際上你可以同時生成三組表。唯一的一點是,應該增加一個選項「PRINTMLE」,以便在重複條件到位時從非重複模型生成估計值。組合的程序如下所示:
Proc GenMod data=sc.wide_mip descending ; by _Imputation_;
Class int (ref='0') tf5 (ref='0') village /param=ref ;
weight weight;
Model seroP= int tf5 age/
dist=bin Link=logit COVB; /*COVB to have non-repeated model covariance*/
repeated subject=village/ type=UN MODELSE PRINTMLE MCOVB ECOVB;/*all options*/
estimate 'Beta' int 1 -1/exp;
ODS OUTPUT
/*the estimates from a non-repeated model*/
ParameterEstimates=norepeat_est
/*the covariance from a non-repeated model*/
Covb = nonrepeat_covb
/*the indices of the parameters*/
ParmInfo=parminfo
/*the model-based estimates from a repeated model*/
GEEModPEst=mod_est
/*the model-based covariance from a repeated model*/
GEENCov= mod_covb
/*the empirical(ROBUST) estimates from a repeated model*/
GEEEmpPEst=emp_est
/*the empirical(ROBUST) covariance from a repeated model*/
GEERCov= emp_covb
;
Run;
/*Analyzing non-repeated results*/
PROC MIANALYZE parms = norepeat_est covb = norepeat_covb parminfo=parminfo;
class int tf5 ;
modeleffects int tf5 age village ;
run;
/*Analyzing model-based results*/
PROC MIANALYZE parms = mod_est covb = mod_covb parminfo=parminfo;
class int tf5 ;
modeleffects int tf5 age village ;
run;
/*Analyzing empirical(ROBUST) results*/
PROC MIANALYZE parms = emp_est covb = emp_covb parminfo=parminfo;
class int tf5 ;
modeleffects int tf5 age village ;
run;
希望它有幫助。進一步閱讀:
- SAS proc genmod with clustered, multiply imputed data
- http://www.ats.ucla.edu/stat/sas/v8/mianalyzev802.pdf
- http://analytics.ncsu.edu/sesug/2006/ST12_06.PDF
- 佳佳,保羅·Logistic迴歸使用SAS®:理論與應用,第二版(頁226-234)。版權所有©2012,SAS Institute Inc.,Cary,美國北卡羅來納州。