BookmarkSubscribeRSS Feed
SoleneD
Calcite | Level 5

Dear SAS community,

 

I'am measuring Prevalence Ratio with modified poisson regression (because the outcome prevalence is high and binomial regression did not converge).  I would like to introduce an interaction term into the model but it does not run and I have no error message.

 

I only have binary variables.

Here is the code that i have executed:


proc genmod data=mydata;
class exposure(ref="0") sex (ref="0") age(ref="0") id //param=ref;
model outcome=exposure sex exposure*sex  age_2class /dist=poisson link=log;
repeated subject=id/type=unstr;
estimate "exposure" exposure 1 0/exp;
estimate "sex" sex 1 0/exp;
estimate "age" age 1 0/exp;
run;

 

The number of subjects is very high (in million), and i have a total of 15 confounding variables.

Without the interaction term the model is running, What is my mistake ?

Also, do you know how to write the estimate statement for the interaction term ?

 

Thanks for your help !

6 REPLIES 6
sbxkoenk
SAS Super FREQ

Can you show us the LOG of the submit?

There should be at least notes!

When you reply, do not paste the LOG right in the body of the text-box.

First click </> (= Insert Code) and paste the LOG in the window that appears, then click OK on that window.

That way the structure and formatting of the LOG is preserved and it keeps or gets some useful coloring.

 

Thanks,

Koen

SoleneD
Calcite | Level 5

Thank you for your answer,

Unfortunately I don't have a LOG. After 2 hours I have a blank LOG and the program is still running...Whereas without the interaction term I had a result in about 5 min.

I wonder if the repeated statement may be the cause ?

 

Thank you for your help

SteveDenham
Jade | Level 19

If you have millions of IDs, an unstructured option is trying to calculate (N^2 + N)/2 covariance parameters, which is in the trillions or quadrillions.  By far a better choice would be a single variance component due to ID.

 

Try this instead:

 

proc glimmix data=mydata;
class exposure(ref="0") sex (ref="0") age(ref="0") id //param=ref;
model outcome=exposure sex exposure*sex  age_2class /dist=poisson link=log;
random intercept/ subject=id;
*estimate "exposure" exposure 1 0/exp;
*estimate "sex" sex 1 0/exp;
*estimate "age" age 1 0/exp; /* Since age is not in the model, I have commented this out.  Either change this to age_2class, or change the model statement */
lsmeans exposure sex exposure*sex/ilink;
run;

The LSMEANS or LSMESTIMATE statement will be preferable to trying to write ESTMATE statements.  In this case, I have commented them out as they are not the correct statements to obtain a single level estimate (no intercept term).

 

SteveDenham

 

SoleneD
Calcite | Level 5

Thank you for your response and your explanation.

 

Unfortunatly with proc glimmix i have the same problem as with proc genmod.

StatDave
SAS Super FREQ

From your description, it sounds as though GENMOD is running and just taking a lot of time. With the REPEATED statement, the GEE estimation method is used and the time it needs will increase quadratically, and therefore very quickly, as the maximum number of observations in any value of the SUBJECT= variable increases. The very large number of SUBJECT= values could also be an issue with time. BTW, the better procedure to use now for GEE models like this is PROC GEE. So, if the GEE method is not feasible, then you might instead try the method that just uses PROC LOGISTIC followed by the NLMeans macro as shown in this note

Rick_SAS
SAS Super FREQ

There seems to be a syntax error in your code:

class exposure(ref="0") sex (ref="0") age(ref="0") id //param=ref/* you have 2 slashes */

 

Also, you say you have only binary variables, but AGE_2CLASS is not listed on the CLASS statement. Either use AGE on the model statement or put AGE_2CLASS on the CLASS statement?

model outcome=exposure sex exposure*sex  age_2class /dist=poisson link=log;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 6 replies
  • 2230 views
  • 2 likes
  • 5 in conversation