I'd like to use a public available SAS macro "NLEstimate" to calculate the adjusted rate difference between treated and untreated groups, and I'm having trouble in the "DF" element in NLEstimate macro. I looked at some examples online but it's getting more confusing, especially for the following two examples: Example1: sample size=180, one discrete variable for treated vs. untreated, and one continuous variable "dose." It's DF in NLEstimate macro is 14. Link: http://support.sas.com/kb/44/354.html, the section about "Using the NLEstimate macro". Example2: sample size=6, one discrete variable for age groups (age group1 vs. age group 2), and one continuous variable "car." It's DF in NLEstimate macro is 6. Link:http://support.sas.com/kb/44/354.html. the section about "Using the NLEstimate macro". In my dataset, I have one binary outcome, one categorical variable (treated vs. untreated), and age as either a continuous or discrete variables(e.g. young vs. old age groups), and a total of 120 observations. I'd like to calculate the rate difference between the treated and untreated which 1. without any adjustment. 2. with age adjustment when age is treated as a continuous variable 3. with age adjustment when age is treated as a discrete variable, young vs. old. My question is how to decide the df when using the NLEstimate macro ? Here's part of my SAS code for 1. (I got the df=2 somewhere, not sure if it is right. ) %macro poissonrate(var); data dat1; set dat; if d2_&var ne 0 then log_&var._years = log(d2_&var/365.25); else if d2_&var = 0 then log_&var._years = log(1/365.25); run; proc genmod data = dat1; CLASS treatment; model &var = treatment/ dist=poisson offset = log_&var._years; estimate 'Estimated Rate' intercept 1/ exp; store out=insmodel; run; %mend; %poissonrate(outcome1); %NLEstimate(instore=insmodel, label=Rate Difference, f=exp(b_p1+b_p2)-exp(b_p1), df=2);/*for rate difference*/ (NLEstimate macro can be found: the download tab on http://support.sas.com/kb/58/775.html) Thanks a lot!
... View more