Programming the statistical procedures from SAS

Why PROC GENMOD outputs parameter estimates for reference group in the interaction with time

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Why PROC GENMOD outputs parameter estimates for reference group in the interaction with time

[ Edited ]

Hi,

I fitted a logistic regression for longitudinal data where the response is a binary variable. I have two variables that are fixed (Sex + Initial_Rythm, both of them are categorical variable) and three variables that changed over time (BIS_0 which is a binary variable, BIS and Lactaat which are two continuous variables).

The model specification is shown here:

proc genmod  data= lda;
     class ID Initial_Rythm(ref="3") BIS_0 Sex  ;
     model y(event="1") = Initial_Rythm Sex BIS_0*t BIS*t Lactaat*t t /dist = binomial link = logit;
     repeated subject=ID/sorted type=exch;
	 by _Imputation_;
	 ods output GEEEmpPEst = lgparms ;
	 *output out = run_lda p = prob xbeta = logit;
run;

My questions is that: Why do we have even the parameter estimate for the reference group of the interaction term: BIS_0*t. The output of one of the imputed data sets is given below for your reference:

Ask.PNG

Thank you for any help to clarify this.

I attached in this post the data and the program I used for your convenience.

 

 

Attachment

Accepted Solutions
Solution
‎11-25-2016 08:05 AM
Occasional Contributor
Posts: 15

Re: Why PROC GENMOD outputs parameter estimates for reference group in the interaction with time

Hi, I firgured out the solution: I need to add param = ref after the class statement:

class ID Initial_Rythm(ref="3") BIS_0(ref="0") Sex / param = ref  ;

So here is the full code:

proc genmod  data= lda;
     class ID Initial_Rythm(ref="3") BIS_0(ref="0") Sex / param = ref  ;
     model y(event="1") = Initial_Rythm Sex BIS_0*t BIS*t Lactaat*t t /dist = binomial link = logit;
     repeated subject=ID/sorted type=exch;
	 by _Imputation_;
	 ods output GEEEmpPEst = lgparms ;
	 *output out = run_lda p = prob xbeta = logit;
run;

Thank you again, Ksharp. Based on your previous suggestion, I am now able to solve the problem.

View solution in original post


All Replies
Super User
Posts: 9,779

Re: Why PROC GENMOD outputs parameter estimates for reference group in the interaction with time

Maybe it is using GLM paramterizal method.

Try 

proc genmod  data= lda;
     class ID Initial_Rythm(ref="3") BIS_0(ref="1") Sex  ;


OR

proc genmod  data= lda;
     class ID Initial_Rythm(ref="3") BIS_0(parm=ref) Sex  ;
Occasional Contributor
Posts: 15

Re: Why PROC GENMOD outputs parameter estimates for reference group in the interaction with time

Hi,

Thank you for your reply.

I tried the first option but the output remains the same.

The second option gave an error.

Do you have any other suggestions?

 

Thank you.

Super User
Posts: 9,779

Re: Why PROC GENMOD outputs parameter estimates for reference group in the interaction with time

Your data give me is not right , Y has four levels .
Check Attachment.


proc import datafile='/folders/myfolders/lda_data.txt' out=lda dbms=csv replace;
delimiter=' ';
run;
proc genmod  data= lda;
where y in (1 12);
     class ID Initial_Rythm BIS_0 Sex/param=ref  ;  /* <---------*/
     model y(event="1") = Initial_Rythm Sex BIS_0*t BIS*t Lactaat*t t /dist = binomial link = logit;
     repeated subject=ID/sorted type=exch;
	 ods output GEEEmpPEst = lgparms ;
	 *output out = run_lda p = prob xbeta = logit;
run;



x.png
Occasional Contributor
Posts: 15

Re: Why PROC GENMOD outputs parameter estimates for reference group in the interaction with time

Hi Ksharp,

Thank you for giving it a try.

Sorry that when I exported data from a .csv file in R (since this blog does not allow to attacht a .csv file, which I don't know why), it created an additional columns (row.names). That was my fault not to command row.names = F.

So please see here the updated data set which should work correctly.

Thank you.

Solution
‎11-25-2016 08:05 AM
Occasional Contributor
Posts: 15

Re: Why PROC GENMOD outputs parameter estimates for reference group in the interaction with time

Hi, I firgured out the solution: I need to add param = ref after the class statement:

class ID Initial_Rythm(ref="3") BIS_0(ref="0") Sex / param = ref  ;

So here is the full code:

proc genmod  data= lda;
     class ID Initial_Rythm(ref="3") BIS_0(ref="0") Sex / param = ref  ;
     model y(event="1") = Initial_Rythm Sex BIS_0*t BIS*t Lactaat*t t /dist = binomial link = logit;
     repeated subject=ID/sorted type=exch;
	 by _Imputation_;
	 ods output GEEEmpPEst = lgparms ;
	 *output out = run_lda p = prob xbeta = logit;
run;

Thank you again, Ksharp. Based on your previous suggestion, I am now able to solve the problem.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 225 views
  • 0 likes
  • 2 in conversation