Log-odds curve using proc glimmix

Reply
New Contributor
Posts: 3

Log-odds curve using proc glimmix

Hi all,

I am conducting a longitudinal data analysis (repeated measure) to examine the association between air pollution (e.g., NO2) and depression status. The following codes are what I used for the main analysis where I treat the exposure as linear predictor. 

Linear predictor

Proc glimmix data=depression;

Class su_id gender(ref=’1’);

Model depression(event=’1’)=no2 gender / dist=binary link=logit solution oddsratio(label)

Weight weight_adj;

Random _residual_ / subject=su_id;

Run;

Now I want to treat no2 as a non-linear predictor to see the shape of the association curve. I know in R, I can use s(no2,3) as smoothing spline. But I have tried spline(no2,df=3) in SAS 9.4 in the proc glimmix, and SAS says the following:

Proc glimmix data=depression;

Class su_id gender(ref=’1’);

Model depression(event=’1’)=spline(no2,df=3) gender / dist=binary link=logit solution oddsratio(label)

                                                         -

                                                         22

                                                         76

ERROR: Nesting of continuous variable not allowed.

ERROR 22-322: Syntax error, expecting one of the following: a name, ), *.

ERROR 76-322: Syntax error, statement will be ignored.

Weight weight_adj;

Random _residual_ / subject=su_id;

Run;

It seems like SAS doesn't recognize the spline function. Are there any smoothing spline I can use in proc glimmix to get the log-odds curve? I have tried EFFECT spl=spline(no2) statement, but it doesn't give me log-odds.

Thank you.

Vivian

Respected Advisor
Posts: 2,655

Re: Log-odds curve using proc glimmix

Try recasting your model in the terms presented in Example 44.15 in the SAS/STAT13.2 documentation.

Proc glimmix data=depression;

Class su_id gender(ref=’1’);

EFFECT spl=splin(no2);

Model depression(event=’1’)=spl gender / dist=binary link=logit solution oddsratio(label);

/*You may want to include spl*gender in the model statement to account for gender differences in the splines*/

/*The example uses the equivalent of: MODEL depression = gender gender*spl/noint for the first attempt at fitting the data*/

Weight weight_adj;

Random _residual_ / subject=su_id;

Run;

Steve Denham

New Contributor
Posts: 3

Re: Log-odds curve using proc glimmix

Hi Steve,

Thank you for the reply. Yes, I did study that example and used the EFFECT statement, and I encountered two problems here.

Proc glimmix data=depression;

Class su_id gender(ref=’1’);

EFFECT spl=splin(no2);

Model depression(event=’1’)=spl gender / dist=binary link=logit solution oddsratio(label);

Weight weight_adj;

Random _residual_ / subject=su_id;

Run;

1) WARNING: The 'Odds Ratio Estimates' table and odds ratio plots are not produced for models with constructed fixed effects.

2) NOTE: The GLIMMIX procedure is modeling the probability that depression='1'.

    NOTE: Stopped because of infinite objective function.

The second NOTE statement is about the random _residual_ statement.

So I try to run the model without the random statement, and the model is now converged. But the OUTPUT out ... pred=p statement only gives me the predicted probabilities for each person that they'd get depression. So I don't have log-odds to plot against the observed exposure to get a nice curve line representing the concentration-response curve.

Any idea? Thanks.


Vivian

Respected Advisor
Posts: 2,655

Re: Log-odds curve using proc glimmix

Well, farther on down in that same example (44.15), there is some code that involves ESTIMATE statements at a variety of values for x (it would be for no2) in your example.  These would be differences in the logits, so that would give any diffeernces due to gender..You can get the logit means (log odds) pretty much the same way using an LSMEANS statement with the AT= option.  Put those out to a dataset using ODS output, and you can plot as needed.

Steve Denham

New Contributor
Posts: 3

Re: Log-odds curve using proc glimmix

Humm... I tried LSMEANS spl / AT means option, and got an error message:

ERROR: The constructed effect spl is not a valid LSMEANS effect.

Respected Advisor
Posts: 2,655

Re: Log-odds curve using proc glimmix

Ick.  Then you will have to write estimate statements for the interesting values of no2.  If you used the noint option on the model statement, these should be relatively easy (at least in SAS/STAT13.2).

Steve Denham

Ask a Question
Discussion stats
  • 5 replies
  • 223 views
  • 0 likes
  • 2 in conversation