I think the question is more related to SAS syntax than statistics and is about proper repeated statement for PROC genmod
I am trying to implement Poisson regression with log link and with robust error variance for survey data.
Here is a working code for non survey data that I tested and it works as intended:
proc genmod data = eyestudy;
class carrot id;
model lenses = carrot/ dist = poisson link = log;
repeated subject = id/ type = unstr;
estimate 'Beta' carrot 1 -1/ exp;
run;
Code above and more information about Poisson regression with log link and with robust error variance but fro non survey data is here: https://stats.idre.ucla.edu/sas/faq/how-can-i-estimate-relative-risk-in-sas-using-proc-genmod-for-common-outcomes-in-cohort-studies/
Below is an example how to use code for PROC genmod
for survey analysis (but with dist=binomial link=identity
and I think without robust error variance)
proc genmod data=nis10;
class seqnumt estiapt10;
model r_tet_not_utd = / dist=binomial link=identity;
weight provwt;
repeated subject=seqnumt(estiapt10);
where sex = 2;
run;
here strata variable name is estiapt10
, cluster variable name is seqnumt
and weight variable name is provwt
.
Code above and more information about survey data analysis here: https://support.sas.com/resources/papers/proceedings13/272-2013.pdf
My strata variable name is CSTRATM
, cluster variable name is CPSUM
and weight variable name is PATWT
. Dependent variable name is DIETNUTR
independent variable name is age_group_var
. My data is located in sas_stata
. So I tryed this code:
proc genmod data=sas_stata;
class age_group_var id CPSUM CSTRATM;
model DIETNUTR = age_group_var/ dist = poisson link = log;
weight PATWT;
repeated subject = id/ type = unstr;
repeated subject = CPSUM(CSTRATM);
estimate 'Beta' age_group_var 1 -1/ exp;
run;
but it gave me warning:
WARNING: Only the last REPEATED statement is used.
As I understand after reading articles above and some other material I am doing everything right except not the proper repeated
statement. For Poisson regression with log link and with robust error variance for survey data I assume there should be some combination of two repeated
statements in my code above. I tried several variants of combining those repeated
statements but without any luck.
So my question is: What is the code for Poisson regression with log link and with robust error variance for survey data?