I'm working on a regression model where Y is inpatient counts distributed according to the zero-inflated negative binomial pdf.
We'd like to fix the trend coefficient on the Y count in the prior 12 month period so that mean(Y_post) = 0.70*mean(Y_pre).
Having discovered the offset trick for forcing coefficients in proc genmod here, how would I construct the offset knowing it's a GLM and not a linear regression?
Do I first need to take a natural log transform of the trend constant since E(Y_post)=exp(beta0 + trend*Y_pre + beta1*x1 + beta2*x2 + ...) for the ZINB distribution?
Or does SAS handle the log transforms for me and I simply code as follows?
%let trend = 0.70;
data analysis_data;
set analysis_data;
y_pre_trend = &trend*y_pre;
run;
proc genmod data=analysis_data;
model y_post = x1 x2 x3 / offset=y_pre_trend dist=zinb;
zeromodel;
run;
I remember @Rick_SAS wrote a blog about it before .
https://blogs.sas.com/content/iml/2020/09/16/restricted-regression-sas.html
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.