04092015 06:42 PM
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 nonlinear 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 22322: Syntax error, expecting one of the following: a name, ), *.
ERROR 76322: 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 logodds curve? I have tried EFFECT spl=spline(no2) statement, but it doesn't give me logodds.
Thank you.
Vivian
04102015 02:41 PM
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
04102015 02:53 PM
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 logodds to plot against the observed exposure to get a nice curve line representing the concentrationresponse curve.
Any idea? Thanks.
Vivian
04102015 03:13 PM
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
04102015 03:36 PM
Humm... I tried LSMEANS spl / AT means option, and got an error message:
ERROR: The constructed effect spl is not a valid LSMEANS effect.
04102015 03:42 PM
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