BookmarkSubscribeRSS Feed
szm
Calcite | Level 5 szm
Calcite | Level 5

Hello,

 

I am working on a dataset that I am interested in the effect of A including two covariates (cov1 and cov2) on Y.

I want to use a hierarhical model because different levels of A were used in 10 years, in 300 locations (within each year) and I should take into account the non-independence of the observations within location-years.

 

This is the model I am using:

 

proc mixed data=dataset plots=all;
class year location A;
model Y=A|cov1|cov2/ddfm=satterth s outp=res;
random intercept location A(location)/subject=year;
run;

I also want to take into account any spatial auto-correlation (I have the coordinates for each location). I extracted the residuals of the previous model (outp=res in the model statement) and using proc variogram, I concluded that the spherical covariance structure with nugget effect agrees the best with my data (better than Gaussian and exponential).

 

But I am not sure how to set up my model properly to account for G-side (random statement) and R-side (repeated) errors in proc mixed.

 

This is the model I am considering so far:

 

proc mixed data=dataset plots=all;
class year location A;
model Y=A|cov1|cov2/ddfm=satterth s;
random intercept location A(location)/subject=year;
repeated /subject=A(year) type=sp(sph) (lat long) local;
run;

 

Similar models (I tried a few different repeated statements) resulted in non-positive Hessian matrix.

 

Any ideas of the proper approach?

 

Thank you all in advance

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 314 views
  • 0 likes
  • 1 in conversation