BookmarkSubscribeRSS Feed
Calcite | Level 5 szm
Calcite | Level 5



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;

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;


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


Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.


Register now!

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
  • 1 in conversation