Programming the statistical procedures from SAS

use of events/trial syntax with correlated data

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

use of events/trial syntax with correlated data

I tried to analyze the data from SAS paper 261-27 (Kuss Oliver) with the events/trial syntax both with proc genmod and with proc glimmix and found different results? Should the single trial syntax be used?

 

This is the full code:

 

 

data infection_grouped ;
input clinic treatment x n ;
datalines ;
1 1 11 36 
1 0 10 37
2 1 16 20
2 0 22 32
3 1 14 19
3 0 7 19
4 1 2 16
4 0 1 17
5 1 6 17
5 0 0 12
6 1 1 11
6 0 0 10
7 1 1 5
7 0 1 9
8 1 4 6
8 0 6 7
run;
data infection_bin (drop=i);
set infection_grouped ;
do i=1 to n;
if i<=x then cure=1;
if i>x then cure=0;
status = 2-cure;
output;
end;
run;
* with proc genmod the data must be ungrouped; proc genmod data=infection_bin descending order=data; class treatment clinic; model cure = treatment / d=bin link=logit; repeated subject=clinic / type=cs ; estimate "treatment" treatment 1 -1 /exp ; run;
* correlated data cannot be analysed with the events/trial syntax in proc genmod; * the following is wrong; proc genmod data=infection_grouped descending order=data; class treatment clinic; model x/n = treatment / d=bin link=logit; repeated subject=clinic / type=cs ; estimate "treatment" treatment 1 -1 /exp ; run;
* with proc glimmix; proc glimmix data=infection_grouped; class treatment clinic; model x/n = treatment / solution; random _residual_ / subject=clinic type=cs; estimate "treatment" treatment 1 -1 /exp ; run;
proc glimmix data=infection_bin; class treatment clinic; model cure = treatment / solution; random _residual_ / subject=clinic type=cs; estimate "treatment" treatment 1 -1 /exp ; run;
proc glimmix data=infection_grouped; class treatment clinic; model x/n = treatment / solution; random intercept / subject=clinic ; estimate "treatment" treatment 1 -1 /exp ; run;
proc glimmix data=infection_bin; class treatment clinic; model cure = treatment / solution; random intercept / subject=clinic ; estimate "treatment" treatment 1 -1 /exp ; run;

 

Is it possible to clarify this?

 

Veronique


Accepted Solutions
Solution
‎08-16-2017 06:37 AM
SAS Employee
Posts: 283

Re: use of events/trial syntax with correlated data

Keep in mind that all observations with the same value of the SUBJECT= variable in GENMOD's REPEATED statement are considered correlated, and any two observations with different values are considered uncorrelated. Further, the event/trials syntax allows you to specify a set of independent trials. So, the two analyses are making very different assumptions about the data. With events/trials syntax, the 36 trials in the clinic 1, trt 1 set are treated as independent as are the 37 trials in the clinic 1, trt 2 set, but any two trials in differing sets are treated as correlated. However, in the analysis without events trials syntax, all 36+37 trials in clinic 1 are treated as correlated. 

 

Also, because the working correlation in the events/trials analysis is extremely high, GENMOD is unable to converge.  If you use type=fixed(1,.99,.99,1) instead of type=cs to limit the correlation, it can converge.

View solution in original post


All Replies
Solution
‎08-16-2017 06:37 AM
SAS Employee
Posts: 283

Re: use of events/trial syntax with correlated data

Keep in mind that all observations with the same value of the SUBJECT= variable in GENMOD's REPEATED statement are considered correlated, and any two observations with different values are considered uncorrelated. Further, the event/trials syntax allows you to specify a set of independent trials. So, the two analyses are making very different assumptions about the data. With events/trials syntax, the 36 trials in the clinic 1, trt 1 set are treated as independent as are the 37 trials in the clinic 1, trt 2 set, but any two trials in differing sets are treated as correlated. However, in the analysis without events trials syntax, all 36+37 trials in clinic 1 are treated as correlated. 

 

Also, because the working correlation in the events/trials analysis is extremely high, GENMOD is unable to converge.  If you use type=fixed(1,.99,.99,1) instead of type=cs to limit the correlation, it can converge.

Occasional Contributor
Posts: 9

Re: use of events/trial syntax with correlated data

Posted in reply to StatDave_sas

Thank you Dave,

 

I understand now. I repeated the analysis with the multicenter data from https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glimmix_a00...

both with proc glimmix and proc genmod. Accidentally, the previous example did not turn out well because of the convergence problem with proc genmod, which problem I do not have with the multicenter data

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 127 views
  • 3 likes
  • 2 in conversation