Programming the statistical procedures from SAS

Specifying sumbsampling in PROC GLIMMIX

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

Specifying sumbsampling in PROC GLIMMIX

I've just starting to dig into GLIMMIX for the first time, but I'm have a little trouble figuring out how to specify within what is considered a subsample. For instance, in GLM I could use this example with two subsamples per plot:

DATA test;

   INPUT plot trt $ response;

   DATALINES;

1    Control    0

1    Control    1

2    Control    1

2    Control    2

3    Control    0

3    Control    1

4    Control    1

4    Control    2

5    Treated    3

5    Treated    4

6    Treated    4

6    Treated    5

7    Treated    4

7    Treated    5

8    Treated    2

8    Treated    3

;

proc glm data=test;

class plot trt;

model response=trt plot(trt);

test h=trt  e=plot(trt);

title 'One way CRD w/subsample';

quit;

Without specifying that subsampling occurred here, the F-value for trt = 60.50. The output from the test statement accounting for the subsampling results in an adjusted F-value of 24.20 for the trt effect. How would I replicate this in PROC GLIMMIX though? The following statement:

proc glimmix data=test;

class plot trt;

model response=trt plot(trt);

title 'GLIMMIX one-way CRD w/subsample';

run;

gives an F-value of 60.50 again for the trt effect. I realize I could just average the subsamples manually in this example, but I'd like to be able to specify this explicitly in the procedure so I'm forced to learn a bit for future more complex analyses. Thanks!


Accepted Solutions
Solution
‎02-27-2015 09:34 AM
Valued Guide
Valued Guide
Posts: 679

Re: Specifying sumbsampling in PROC GLIMMIX

In GLIMMIX, you do not put random effects in the model statement. You use one or several random statements. To get started, try:

proc glimmix;

class plot trt;

model response = trt;

random plot(trt);

run;

The beauty of MIXED and GLIMMIX is that one does not have to set up any explicit tests because the procedures figure things out if the random effects are specified correctly. I highly recommend you get a copy of SAS for Mixed Models, 2nd edition (2006). This will make things clearer.

View solution in original post


All Replies
Solution
‎02-27-2015 09:34 AM
Valued Guide
Valued Guide
Posts: 679

Re: Specifying sumbsampling in PROC GLIMMIX

In GLIMMIX, you do not put random effects in the model statement. You use one or several random statements. To get started, try:

proc glimmix;

class plot trt;

model response = trt;

random plot(trt);

run;

The beauty of MIXED and GLIMMIX is that one does not have to set up any explicit tests because the procedures figure things out if the random effects are specified correctly. I highly recommend you get a copy of SAS for Mixed Models, 2nd edition (2006). This will make things clearer.

☑ This topic is SOLVED.

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

Discussion stats
  • 1 reply
  • 259 views
  • 0 likes
  • 2 in conversation