BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bienco88
Obsidian | Level 7

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
bienco88
Obsidian | Level 7

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

5 REPLIES 5
Ksharp
Super User

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  ;
bienco88
Obsidian | Level 7

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.

Ksharp
Super User
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
bienco88
Obsidian | Level 7

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.

bienco88
Obsidian | Level 7

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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