广义估计方程GEE之SPSS,SAS,Stata命令比较
数据库可以从http://dx.doi.org/10.1007/s10461-011-9955-5下载
为减轻网站流量负担,请各位战友根据论坛币下载。
祝各位战友学习愉快!!!
其中SPSS syntax
/* Format data for longitudinal analysis */
GET FILE="rctdata.sav"
/KEEP id tx1 tx2 y0 y1 y2 y3.
** Reformat outcome data into "long" format so that each participant
** has multiple rows of data, one for each assessment. Data must be
** in long (aka. univariate) format for GEE analysis.
VARSTOCASES
/MAKE y from y0 y1 y2 y3
/INDEX = time.
** Adjust time variable so baseline=0.
recode time (1=0) (2=1) (3=2) (4=3).
** The logistic GEE procedure in SPSS cannot accommodate decimals, so
** the outcome must be converted to a fraction with a numerator (p)
** and a denominator (n).
COMPUTE n = 1000000.
COMPUTE p = rnd(y * n).
/* Planned contrasts */
** Logistic GEE analysis w/ planned contrasts.
GENLIN p OF n BY tx1 tx2 time (ORDER=DESCENDING)
/MODEL tx1 tx2 time time*tx1 time*tx2
DISTRIBUTION=binomial LINK=logit
/REPEATED SUBJECT=id WITHINSUBJECT=time
CORRTYPE=ar(1) ADJUSTCORR=no COVB=robust
/PRINT cps modelinfo solution (exponentiated) summary.
/* Piecewise growth curves */
** Create piecewise growth curve.
RECODE time (0=0) (1=1) (2=2) (3=3) INTO pre.
RECODE time (0=0) (1=0) (2=1) (3=2) INTO post.
** Logistic GEE analysis w/ piecewise growth curves.
GENLIN p OF n BY tx1 tx2 (ORDER=DESCENDING) WITH pre post
/MODEL tx1 tx2 pre post
tx1*pre tx1*post tx2*pre tx2*post
DISTRIBUTION=binomial LINK=logit
/REPEATED SUBJECT=id WITHINSUBJECT=pre*post
CORRTYPE=ar(1) ADJUSTCORR=no COVB=robust
/PRINT cps modelinfo solution (exponentiated) summary.