Programming the statistical procedures from SAS

Proc Genmod Syntax question

Reply
Contributor
Posts: 57

Proc Genmod Syntax question

I am trying to create the following table below and am struggling on where to start:

Mock Table1: Treatment Difference in the Headache rate during 90 , 180 and 270 days follow-up period  between treated Untreated group (using Poisson Regression)

Headache Incidence Rate UnadjustedAdjusted
TreatedNot TreatedRR95% CIP valueRR95% CIP value
N=xxxN=xxx
n%n%
xxx.xxxxx.xxxx.xxxx.xx-xx.xx.xxxxxx.xxxx.xx-xx.xx.xxxx

* there will be three rows in total one for 90 days one for 180 days and one for 270 days.

N=number of Subjects;

RR=risk ratio (treated vs. untreated); CI=confidence interval for the RR; RR, 95% CI and p value are from the poisson model.

Unadjusted  model:  Headache rate = Exposure Group;

Adjusted model: Headache rate  =Exposure Group + Age+ index year


I know (or think)  I have to use Proc Genmod , but I have never used this procedure before and I am unsure of the syntax used to  get the RR CI and P values, or the adjusted and unadjusted stats.

The dataset I am using has the  all subjects  their exposure, age, index year , flag for headache (0/1) and headache diagnosis date. I am not bothered about the cosmetics of the table format tI can figure that bit out, it is the information inside the table that I need help with


Any help would be gratefully received .  Many thanks in advance, Lisa.

Contributor
Posts: 34

Re: Proc Genmod Syntax question

Hi Lisa, how many exposure groups do you have? Is it a categorical
variable? Is Age continuous?

If you data are coded in this way:


 

Headache


 

 

Person


 

 

Exposure (Treated (2) Vs untreated (1)


 

 

Age


 

 

Year


 

 

1


 

 

1


 

 

1


 

 

29


 

 

2005


 

 

0


 

 

1


 

 

1


 

 

40


 

 

2001


 

 

1


 

 

1


 

 

2


 

 

45


 

 

2015


 

I believe you can do this to populate your table:

*to populate N fields;

proc freq data=datasetname;

tables Headache*Exposure;

run;

*Unadjusted RR;

proc genmod data=datasetname descending;

class Exposure ;

model Headache =Exposure/ offset=Person dist=p link=log type3;

estimate ' 1 Vs 2' Exposure 1 -1;*Unadjusted RR;

run;

proc genmod data=datasetname descending;

class Exposure Year;

model Headache =Exposure Age Year/offset=Person dist=p link=log type3;

estimate ' 1 Vs 2' Exposure 1 -1; *Adjusted RR;

run;

Contributor
Posts: 57

Re: Proc Genmod Syntax question

Hello, thank you so much for your response.  There is one exposure group ( flag = 1) and one untreated group (flag =0).  Age is a continuous variable but i may have to add some discrete variables into the adjusted model such as various comorbids  e.g. Diabetes etc ( all have a 1 or 0  flag).  Would I just add these into the class line of the code and the model line of the code for the adjusted part? May I ask what the line of code does (in particular  the -1 bit?

estimate ' 1 Vs 2' Exposure 1 -1; *Adjusted RR


I really appreciate all your help and you taking the time to respond.


Many thanks,


Lisa

Contributor
Posts: 34

Re: Proc Genmod Syntax question

I think if your variables are coded as dummy vars (1/0) than
you do not need to declare them in class statement. SAS will understand it.
Only Year than should be kept in class statement. In the case of dummy
variables I am not sure if this statement below will work (try it). This
statement allows to estimate a contrast (RR) : group 1 versus 2.

   

estimate' 1 Vs 2' Exposure 1 -1;

Contributor
Posts: 57

Re: Proc Genmod Syntax question

Apologises for the time delay with regards to my response but I have a quick question regarding the offset  statement which =Person.  What is the variable 'Person representing' Is this variable holding the total number of patients who had an outcome for that particular exposure? Many thanks.

Ask a Question
Discussion stats
  • 4 replies
  • 418 views
  • 0 likes
  • 2 in conversation