BookmarkSubscribeRSS Feed
eilayyan
Calcite | Level 5

Hello,

I run a logistic regression in SAS with this code:

proc logistic data = model3;

class gender(param = ref ref='0')smoking(param = ref ref='0')_0SEC6 (param = ref ref='0');

model ACT5c (event = '1') = age gender smoking fev_con bmi re_norm PF_Norm EF_Norm sf_norm _0SEC6/ rsq lackfit;

run;

the p value in hosmer test is 0.655

But when i changed the event from 1 to 0 in this code:

proc logistic data = model3;

class gender(param = ref ref='0')smoking(param = ref ref='0')_0SEC6 (param = ref ref='0');

model ACT5c (event = '0') = age gender smoking fev_con bmi re_norm PF_Norm EF_Norm sf_norm _0SEC6/ rsq lackfit;

run;

the p value in hosmer test is 0.9

so how that come? it is same data and same code!!!

Could you please help me in that.

Thanks

Owis

2 REPLIES 2
art297
Opal | Level 21

I am NOT a statistician, and don't know why you would obtain those differences, but I used the data from one of the examples from the documentation and was able to replicate your findings.  The first example doesn't show the effect. In the second example, I changed all of the pain values to equal 0 except for the last column.

I was able to get different hosmer values if there were only 1 one for pain for each age group.

Hopefully, that might give you a clue as to what to look for.

Data Neuralgia;

   input Treatment $ Sex $ Age Duration Pain $ @@;

   datalines;

1  0  68   1  0   1  1  74  16  0  1  0  67  30  0

1  1  66  26  1   1  0  67  28  0  1  0  77  16  0

0  0  71  12  0   1  0  72  50  0  1  0  76   9  1

0  1  71  17  1   0  0  63  27  0  0  0  69  18  1

1  0  66  12  0   0  1  62  42  0  1  0  64   1  1

0  0  64  17  0   1  1  74   4  0  0  0  72  25  0

1  1  70   1  1   1  1  66  19  0  1  1  59  29  0

0  0  64  30  0   0  1  70  28  0  0  1  69   1  0

1  0  78   1  0   1  1  83   1  1  1  0  69  42  0

1  1  75  30  1   1  1  77  29  1  1  0  79  20  1

0  1  70  12  0   0  0  69  12  0  1  0  65  14  0

1  1  70   1  0   1  1  67  23  0  0  1  76  25  1

1  1  78  12  1   1  1  77   1  1  1  0  69  24  0

1  1  66   4  1   1  0  65  29  0  1  1  60  26  1

0  1  78  15  1   1  1  75  21  1  0  0  67  11  0

1  0  72  27  0   1  0  70  13  1  0  1  75   6  1

1  0  65   7  0   1  0  68  27  1  1  1  68  11  1

1  1  67  17  1   1  1  70  22  0  0  1  65  15  0

1  0  67   1  1   0  1  67  10  0  1  0  72  11  1

0  0  74   1  0   1  1  80  21  1  0  0  69   3  0

;

proc logistic data=Neuralgia;

class treatment(param = ref ref='0')sex(param = ref ref='0');

model pain (event = '1') = Treatment Sex Age Duration/ rsq lackfit;

run;

proc logistic data=Neuralgia;

class treatment(param = ref ref='0')sex(param = ref ref='0');

model pain (event = '0') = Treatment Sex Age Duration/ rsq lackfit;

run;

Data Neuralgia;

   input Treatment $ Sex $ Age Duration Pain $ @@;

   datalines;

1  0  68   1  0   1  1  74  16  0  1  0  67  30  0

1  1  66  26  0   1  0  67  28  0  1  0  77  16  0

0  0  71  12  0   1  0  72  50  0  1  0  76   9  0

0  1  71  17  0   0  0  63  27  0  0  0  69  18  0

1  0  66  12  0   0  1  62  42  0  1  0  64   1  0

0  0  64  17  0   1  1  74   4  0  0  0  72  25  1

1  1  70   1  0   1  1  66  19  0  1  1  59  29  1

0  0  64  30  0   0  1  70  28  0  0  1  69   1  0

1  0  78   1  0   1  1  83   1  0  1  0  69  42  1

1  1  75  30  0   1  1  77  29  0  1  0  79  20  0

0  1  70  12  0   0  0  69  12  0  1  0  65  14  1

1  1  70   1  0   1  1  67  23  0  0  1  76  25  0

1  1  78  12  0   1  1  77   1  0  1  0  69  24  0

1  1  66   4  0   1  0  65  29  0  1  1  60  26  1

0  1  78  15  0   1  1  75  21  0  0  0  67  11  0

1  0  72  27  0   1  0  70  13  0  0  1  75   6  0

1  0  65   7  0   1  0  68  27  0  1  1  68  11  0

1  1  67  17  0   1  1  70  22  0  0  1  65  15  0

1  0  67   1  0   0  1  67  10  0  1  0  72  11  0

0  0  74   1  0   1  1  80  21  0  0  0  69   3  1

;

proc logistic data=Neuralgia;

class treatment(param = ref ref='0')sex(param = ref ref='0');

model pain (event = '1') = Treatment Sex Age Duration/ rsq lackfit;

run;

proc logistic data=Neuralgia;

class treatment(param = ref ref='0')sex(param = ref ref='0');

model pain (event = '0') = Treatment Sex Age Duration/ rsq lackfit;

run;

eilayyan
Calcite | Level 5

Thanks

Owis

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 1421 views
  • 0 likes
  • 2 in conversation