05102016 05:28 PM
Hello all,
I am a newbie to Proc Glimmix, so please bear with me.
I have included my statistical model below.
Effect 
d.f. 
Effect Type 
Test 
Type (T) 
1 
Fixed (Categorical Variable) 

Age (A) 
2 
Fixed (Categorical Variable) 

T*A 
2 
Fixed 

Forest(T*A) 
6 
Random 
Error term 1 




Year (Y) 
1 
Fixed (Categorical Variable) 

Y*T 
1 
Fixed 

Y*A 
2 
Fixed 

Y*T*A 
2 
Fixed 

Y*Forest(T*A) 
6 
Random 
Error term 2 
Total Error 
120 
Random 

Total 
143 (N=144) 


The response variables are continuous.
I'm not sure how to write a correct model statement in proc glimmix, as I am not familiar with how the random, subject and intercept statements work. I would like to test the fixed effects of Type, Age and Type*Age against the random variable of Forest(Type*Age), as well, test the fixed effects (and the interactions) of Year against the random effect of Year*Forest(T*A). In GLM, I could use the 'test' statement (using H and E syntax), but am not sure how this is done in glimmix. I realize that I may in the end reduce the model by removing certain random terms, but need to check against the full model first.
Here was my first SAS code, not sure if this is correct:
proc glimmix data = Trapabund;
class Type Age Stand Year;
model TrpSTD = Type  Age  Year ;
random Forest(Type*Age);
random Year / subject=Year*Forest(Type*Age);
lsmeans Type Age_Cat Type*Age_Cat Year Year*Type*Age_Cat / cl adjust=tukey alpha=0.05 lines;
run;
quit;
Any help and advice would be greatly appreciated.
PSI have to be away from the office Thursday and Friday, so I may not be able to respond until Monday of next week.
05112016 04:43 PM
05112016 01:33 PM
Super confusing.
Looks like you want to have random intercepts for each distinct combination of Forest*Type*Age. I would program that as:
RANDOM Intercept / subject=Forest*Type*Age;
If each forest has a unique identifier, you only need SUBJECT=Forest.
The second random effect seems to be for a repeated measures variable Year. I would use the same syntax but specify a covariance typefirst order autoregressive is the most common choice for time but it may or may not be appropriate:
RANDOM Year / subject=Forest*Type*Age type=AR(1);
No covariance is the default for your first random statement but you may want to include TYPE=VC to see that explictly in your code. If you don't believe that there is covariance between/among years, you only need one random statement with both random intercept and years in it:
RANDOM Intercept Year / subject=Forest*Type*Age;
05112016 02:02 PM
Hi Haris, thanks for the information.
What we did was sample insects in a combination of fire and harvest stands (Type effect) after a set amount of time postdisturbance (Age effect: 01 year, 1415 years, 2930 years after the fire or harvest occurred). For our interests, we considered the Age effect categorical (simply as 0, 15, 30 years post disturbance). We sampled the insects for 2 consecutive years in the same forests, so the forests may be considered the repeated measure (?), however, I recognize the conundrum of the 'age' effect and the 'sampling time' effect. We are interested mostly in the Type*Age interaction, but recognize that year of collection also plays a role in what was collected.
I'm not sure if this helps to clarify the situation, or only makes thngs more difficult.
Cheers,
BM
05112016 04:43 PM
Need further help from the community? Please ask a new question.