Programming the statistical procedures from SAS

How to adjust for spatial autocorrelation in the logistic model

Reply
Occasional Contributor
Posts: 12

How to adjust for spatial autocorrelation in the logistic model

Hi!
I conducted a case control study about the disease incidence and land cover types. The contro points were random sampled based on the population density.
How to adjust for the spatial autocorrelation in thr logistic model?
I have tried to do it by using GLIMMIX

PROC GLIMMIX data=test;
MODEL disease= grass200m
/ dist=binary solution oddsratio;
random _residual_ / type=sp(exp) (x_cor y_cor);
run;

It does not work. There is a warning message: "Obtaining minimum variance quadratic unbiased estimates as starting values for the covariance parameters failed."

How do I modify my code? Thanks a lot!
Respected Advisor
Posts: 2,655

Re: How to adjust for spatial autocorrelation in the logistic model

I think you will need a subject= specification in the random statement. Try:

PROC GLIMMIX data=test;
CLASS subjid;
MODEL disease= grass200m
/ dist=binary solution oddsratio;
random _residual_ / type=sp(exp) (x_cor y_cor) subject=subjid;
run;

Each subject should have its own set of x and y coordinates.

SteveDenham
Regular Contributor
Posts: 169

Re: How to adjust for spatial autocorrelation in the logistic model

Yes, a subject specification is required.  If there are no subject blocks and all data should be regarded as a single subject, then specify subject=intercept.

Occasional Contributor
Posts: 12

Re: How to adjust for spatial autocorrelation in the logistic model

Thanks for your suggestion!

When I try the code below, it works.

However, the standard error of SP(SPH) was showed "." in the covariance parameter estimates.

The odds ratios do not change no matter I change the type of covariance to vc or cs. Is it correct?

The ID is the unique ID for case and control and the "x_cor" and "y_cor" are the coordinate information.

The geographic distribution of case and control points are very similar.

PROC GLIMMIX data=BROWN;

CLASS ID;

MODEL DISEASE= ode200m grass200m

EM1/ dist=binary solution oddsratio;

random _residual_ /subject=ID

type=sp(sph) (x_cor y_cor);

output out=abd pred=p resid=r;

RUN;

Ask a Question
Discussion stats
  • 3 replies
  • 1174 views
  • 1 like
  • 3 in conversation