2016年5月23日星期一

Proc MI FCS

http://sas-and-r.blogspot.com.au/2011/09/example-94-new-stuff-in-sas-93-mi-fcs.html

filename myhm url "http://www.math.smith.edu/sasr/datasets/helpmiss.csv" lrecl=704;

proc import replace datafile=myhm out=help dbms=dlm;
delimiter=',';
getnames=yes;
run;

proc mi data = help nimpute=20 out=helpmi20fcs;
class homeless female;
var i1 homeless female sexrisk indtot mcs pcs;
fcs
 logistic (female)
 logistic (homeless);
run;
In the fcs statement, you list the method (logistic, discrim, reg, regpmm) to be used, naming the variable for which the method is to be used in parentheses following the method. (You can also specify a subset of covariates to be used in the method, using the usual SAS model-building syntax.) Omitted covariates are imputed using the default reg method.
ods output parameterestimates=helpmipefcs
covb = helpmicovbfcs;
proc logistic data=helpmi20fcs descending;
by _imputation_;
model homeless=female i1 sexrisk indtot /covb;
run;

proc mianalyze parms=helpmipefcs covb=helpmicovbfcs;
  modeleffects intercept female i1 sexrisk indtot;
run;

with the following primary result:
Parameter    Estimate   Std Error  95% Conf. Limits

intercept   -2.492733    0.591241  -3.65157  -1.33390 
female      -0.245103    0.244029  -0.72339   0.23319
i1           0.023207    0.005610   0.01221   0.03420
sexrisk      0.058642    0.035803  -0.01153   0.12882
indtot       0.047971    0.015745   0.01711   0.07883