Вы находитесь на странице: 1из 32

Tutorial correction

Analysis of discrete repeated data

Florence Jaffrézic, INRA


E-mail : florence.jaffrezic@jouy.inra.fr
Presentation of the data

Randomized clinical trial to evaluate the effect of a treatment on


epilepsy.

59 patients randomized in two treatment groups:


0=placebo, 1=progabide.

Occurrence of seizures are observed for each patient during 4


successive two week periods.
‘seizu’: binary variable
1: occurrence of seizure ; 0: no occurrence
Presentation of the data

Count: represents the number of seizures during the 8 weeks


before randomization.

We recommend two variable changes:

Age=(age of patient-30)/10

Base=ln(count/4)-ln(ref/4), with ref=25.


Marginal model

proc genmod data=fich descending;


class indiv treat visit;
model seizu = age base treat treat*time / noint dist=binomial link=logit;
output out=pred_data predicted=pred;
repeated subject=indiv / withinsubject=visit type=ind corrw modelse;
run;

To change the working correlation matrix :


type=AR(1) et type=UN
Marginal model

Choice of the working correlation matrix :

Unstructured (UN) converges.

Equally spaced data: AR(1) can be used too.

Both structures can be used here.

We recommend UN (more general correlation structure).


Marginal model
Parameter estimations

AR(1) UN

Parameters Estimation Model-based Estimation Model-based


SE SE

Placebo 0.8338 0.7068 1.0142 0.6536

Treatment -0.0676 0.6030 0.1884 0.5517

Time*Placebo -0.0000 0.2475 -0.0306 0.2193

Time*Treat -0.0466 0.2150 -0.1479 0.1910

Smaller SE with UN working correlation matrix than with AR(1).


Marginal model (GEE approach)

Here we choose the UN working correlation matrix.

Note: Models cannot be compared based on classical likelihood based


criteria as GEE estimations are used (score equations only require
specification of the mean and the variance-covariance structure).
Marginal model

proc genmod data=fich descending;


class indiv treat visit;
model seizu = age base treat treat*time / noint dist=binomial link=logit;
output out=pred_data predicted=pred;
repeated subject=indiv / withinsubject=visit type=UN corrw modelse;
run;

Graph of the average probability of occurrence of seizures in


the two treatment groups (option ‘predicted’).
Graph of the average probability of occurrence of seizures in
the two treatment groups (option ‘predicted’).

proc means data=pred_data noprint nway;


class treat visit;
var pred;
output out=mean_pred(keep=treat visit mean_pred) mean=mean_pred;
run;

proc gplot data=mean_pred;


plot mean_pred*visit=treat / haxis=0 to 5 by 1 hminor=0
vaxis=0 to 1 by 0.1 vminor=1;
format mean_pred 4.1;
run;
quit;
Modèle marginal
Marginal model

Are the population intercepts and slopes significantly different


from zero in the two treatment groups ?

Linear mean curve in each treatment group:


Intercept: H0: A1 = A2 = 0 (p=0.4074)
Slope: H0 : B1 = B2 = 0 (p=0.6761)

Type III test with the ‘type 3’ option.

H0 cannot be rejected for these two hypotheses.


Intercepts and slopes are not significantly different from 0 in the
two treatment groups.
Marginal model
Are the population intercepts and slopes significantly different
in the two treatment groups ?

Linear mean curve in the two treatment groups:


Intercept: H0: A1 = A2
Slope: H0 : B1 = B2

proc genmod data=fich descending;


class indiv treat visit;
model seizu = age base treat treat*time / noint dist=binomial link=logit type3 ;
estimate "Estimation A1-A2" treat 1 -1 treat*time 0 0 ;
estimate "Estimation B1-B2" treat 0 0 treat*time 1 -1 ;
repeated subject=indiv / withinsubject=visit type=UN corrw modelse;
run;
Marginal model

Linear mean curve in the two treatment groups:


Intercept: H0: A1 = A2 (p=0.3802)
Slope: H0 : B1 = B2 (p=0.7160)

Intercepts and slopes are not significantly different in the two treatment groups.

The treatment is not significantly more efficient than the placebo to avoid the
occurrence of seizure.
Graph of individual probabilities of occurrence of seizures for
the two treatment groups (option ‘predicted’).

proc sort data=pred_data;


by treat;
run;
proc gplot data=pred_data;
by treat;
%macro symbol;
%do i=1 %to 30;
symbol&i i=j value=plus;
%end;
%mend;
%symbol;
plot pred*time=indiv / nolegend haxis=0 to 5 by 1 hminor=0
vaxis=0 to 1 by 0.1 vminor=0;
run;
quit;
Marginal model
Marginal model
Marginal model

Same model with the Probit link.

proc genmod data=fich descending;


class indiv treat visit;
model seizu = age base treat treat*time / noint dist=binomial link=probit type3 ;
estimate "Estimation A1-A2" treat 1 -1 treat*time 0 0 ;
estimate "Estimation B1-B2" treat 0 0 treat*time 1 -1 ;
repeated subject=indiv / withinsubject=visit type=UN corrw modelse;
run;

Intercept: H0: A1 = A2 (p=0.3704) Slope: H0 : B1 = B2 (p=0.6920)

Same conclusions as previously. Results are very close to the logit link.
Marginal model

Other possible syntax for the fixed effects.

proc genmod data=fich descending;


class indiv treat visit;
model seizu = age base treat time treat*time / dist=binomial link=probit type3 ;
repeated subject=indiv / withinsubject=visit type=UN corrw modelse;
run;

In this case:
Intercept: Effect of treatment 1 (progabide).
Treat: Difference of intercepts between the two treatments.
Time: Slope of treatment 1.
Treat*Time: Difference of slopes between the two treatments.
Random effect model
PROC NLMIXED

We want to study the occurrence of seizure for each patient


individually, using the random effect model of Proc NLMIXED.

Using the logit link and a random intercept model, test the equality
of average intercepts and slopes in each treatment group.
Random effect model
Logistic model

proc nlmixed data=fich;


parms d1=0 d2=0 a1=0 a2=0 b1=0 b2=0 tau2=1.0;
theta=d1*age+d2*base+a1+a2*treat+b1*time+b2*time*treat+u;
exptheta=exp(theta);
p=exptheta/(1+exptheta);
model seizu ~ binary(p);
random u ~ normal(0,tau2) subject=indiv;
predict p out=pred_nlmixed;
run;
Random effect model
Logistic model

a1+a2*treat+b1*time+b2*time*treat+u;

In this model:
a1 : Effect of treatment 1 (progabide).
a2 : Difference of intercepts between the two treatments.
b1 : Slope of treatment 1.
b2 : Difference of slopes between the two treatments.

Intercept: H0: A1 = A2 equivalent to H0: a2=0


Slope: H0: B1 = B2 equivalent to H0: b2=0
Random effect model
Logistic model

Intercept: H0: A1 = A2 equivalent to H0: a2=0


Slope: H0: B1 = B2 equivalent to H0: b2=0

As previously, these differences are not significantly different.

For a2, p=0.3599 and for b2 p=0.8172.


Random effect model
Probit model.

proc nlmixed data=fich;


parms d1=0 d2=0 a1=0 a2=0 b1=0 b2=0 tau2=1.0;
theta=d1*age+d2*base+a1+a2*treat+b1*time+b2*time*treat+u;
p=probnorm(theta);
model seizu ~ binary(p);
random u ~ normal(0,tau2) subject=indiv;
run;

Same conclusions as with the logistic model.


Random effect model
Logistic model with random intercept and slope.

proc nlmixed data=fich qpoints=10;


parms d1=0 d2=0 a1=0 a2=0 b1=0 b2=0 s11=1 s22=1 s12=0;
theta=d1*age+d2*base+a1+a2*treat+b1*time+b2*time*treat+u1+u2*time;
exptheta=exp(theta);
p=exptheta/(1+exptheta);
model seizu ~ binary(p);
random u1 u2 ~ normal([0,0],[s11,s12,s22]) subject=indiv;
run;

Takes a lot of time (even with 10 points) and convergence problems.


Proc GLIMMIX

REML penalized quasi-likelihood estimations.

proc glimmix data=fich method=RSPL;


class indiv treat visit;
model seizu(descending)= age base treat treat*time / noint dist=binomial
link=logit solution;
estimate "Estimation A1-A2" treat 1 -1 treat*time 0 0 ;
estimate "Estimation B1-B2" treat 0 0 treat*time 1 -1 ;
random intercept / subject=indiv;
run;

Intercept: H0: A1 = A2 (p=0.3911)


Slope: H0 : B1 = B2 (p=0.8273)
Proc GLIMMIX

REML marginal quasi-likelihood estimations.

proc glimmix data=fich method=RMPL;


class indiv treat visit;
model seizu(descending)= age base treat treat*time / noint dist=binomial
link=logit solution;
estimate "Estimation A1-A2" treat 1 -1 treat*time 0 0 ;
estimate "Estimation B1-B2" treat 0 0 treat*time 1 -1 ;
random intercept / subject=indiv;
run;

Intercept: H0: A1 = A2 (p=0.3832)


Slope: H0 : B1 = B2 (p=0.8334)
Proc GLIMMIX

REML penalized quasi-likelihood estimations.

proc glimmix data=fich method=RSPL;


nloptions maxiter=50;
class indiv treat visit;
model seizu(descending)= age base treat treat*time / noint dist=binomial
link=logit solution;
estimate "Estimation A1-A2" treat 1 -1 treat*time 0 0 ;
estimate "Estimation B1-B2" treat 0 0 treat*time 1 -1 ;
random intercept time / subject=indiv type=UN;
run;

Intercept: H0: A1 = A2 (p=0.4235)


Slope: H0 : B1 = B2 (p=0.8191)

Convergence problems with RMPL.


Count data analysis:

Marginal model
proc genmod data=fich;
class indiv treat visit;
model number = age base treat treat*time / noint dist=poisson link=log type3;
estimate "Estimation A1-A2" treat 1 -1 treat*time 0 0 ;
estimate "Estimation B1-B2" treat 0 0 treat*time 1 -1 ;
repeated subject=indiv / withinsubject=visit type=AR(1) corrw modelse;
run;

H0: A1=A2=0 (p=0.9147) H0: B1=B2=0 (p=0.2598)


H0: A1=A2 (p=0.9142) H0: B1=B2 (p=0.6878)

Convergence problems for UN working correlation matrix.


Proc GLIMMIX

REML marginal quasi-likelihood estimations.

proc glimmix data=fich method=RMPL;


class indiv treat visit;
model number= age base treat treat*time / noint dist=poisson link=log solution;
estimate "Estimation A1-A2" treat 1 -1 treat*time 0 0 ;
estimate "Estimation B1-B2" treat 0 0 treat*time 1 -1 ;
random intercept / subject=indiv ;
run;

H0: A1=A2 (p=0.3128)


H0: B1=B2 (p=0.4499)
Proc GLIMMIX

REML penalized quasi-likelihood estimations.

proc glimmix data=fich method=RSPL;


class indiv treat visit;
model number= age base treat treat*time / noint dist=poisson link=log solution;
estimate "Estimation A1-A2" treat 1 -1 treat*time 0 0 ;
estimate "Estimation B1-B2" treat 0 0 treat*time 1 -1 ;
random intercept / subject=indiv;
run;

H0: A1=A2 (p=0.1898)


H0: B1=B2 (p=0.4390)
APPENDIX
Also possible to use the ‘estimate’ option.
data fich_nlmixed;
set fich;
treat0=0;
if treat=0 then treat0=1; /* Define a new variable ‘treat0’. */
run;
proc nlmixed data=fich_nlmixed;
parms d1=0 d2=0 a1=0 a2=0 b1=0 b2=0 tau2=1.0;
theta=d1*age+d2*base+a1*treat0+a2*treat+b1*time*treat0+b2*time*treat+u;
exptheta=exp(theta);
p=exptheta/(1+exptheta);
model seizu ~ binary(p);
random u ~ normal(0,tau2) subject=indiv;
estimate 'Estimation A1-A2' a2-a1;
estimate 'Estimation B1-B2' b2-b1;
predict p out=pred_nlmixed;
run;

Вам также может понравиться