turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: McFadden’s R2 in logistic REGRESSION

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

2 weeks ago

Dear friends,

I would like to use the McFadden’s *R*2

for my model fit in logistic regressions.

I am running sequential adjusted regression models.

Model 1 = crude model with fatty acid patterns only.

model 2 = adjusted for age and gender

Model 3 = adjusted for lifestyle confounders,

```
*model 1;
proc logistic data=Alisama;*plasma FA;
model Weightchange_Indicator (event='1')= SCD_D9D_Plasma_2005 n6_PLASMA_2005 n3_PLASMA_2005 EFA_PLASMA_2005 / rsq ;/*put the model in this form -> response = predictors*/
run;quit;
*model 2;
proc logistic data=Alisama;*plasma FA;
class Gender_Code_2005;*put categorical variables here*/;
model Weightchange_Indicator(event='1')= SCD_D9D_Plasma_2005 n6_PLASMA_2005 n3_PLASMA_2005 EFA_PLASMA_2005 Age2005 Gender_Code_2005 / rsq;/*put the model in this form -> response = predictors*/
run;quit;
*model 3;
proc logistic data=Alisama;*plasma FA;
class Gender_Code_2005 Urbanisation_2005 Tobbaco_2005 Education_2005;/*put categorical variables here*/
model Weightchange_Indicator(event='1')= SCD_D9D_Plasma_2005 n6_PLASMA_2005 n3_PLASMA_2005 EFA_PLASMA_2005 Age2005 Gender_Code_2005
Gender_Code_2005 Urbanisation_2005 FFQALCOHOL_2005 Tobbaco_2005 Education_2005
FFQKJOUL_2005 Weighted_PA_Index_2005 / rsq;/*put the model in this form -> response = predictors*/
run;quit;
```

the model fit I generated only includes these three

```
Model Fit Statistics
Criterion Intercept Only Intercept and
Covariates
AIC 565.422 558.473
SC 569.441 578.566
-2 Log L 563.422 548.473
```

I know I can use the loglikelihood, But I would prefer to use the McFadden’s *R*2

So how do I generate the McFadden’s *R*2?????

Please help.

Very kind regards

Achieng

Accepted Solutions

Solution

Monday

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Achieng

a week ago

You can also get McFadden's R-square in PROC HPLOGISTIC by using the PARTITION statement. Note that you do not have to actually do any partitioning of your data. For example:

```
proc hplogistic data=remiss;
model remiss(event='1') = smear blast;
partition fraction(test=0 validate=0);
run;
```

All Replies

Highlighted
## Re: McFadden’s R2 in logistic REGRESSION

Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Achieng

a week ago

I think you do the right thing.

proc logistic data=sashelp.class;

model sex=age weight height/rsquare;

run;

R-Square0.3724Max-rescaled R-Square0.4970

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

Monday

Dear Ksharp, I was unable to get the Mcfaddens R2 with this method, but

instead, I got other models fit models. Thank you.

instead, I got other models fit models. Thank you.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Achieng

a week ago

Several different R-square measures, including McFadden's, are computed by PROC QLIM in SAS/ETS software. LOGISTIC only reports the R-square based on the method of Cox and Snell.

If you fit a model like this in PROC LOGISTIC:

proc logistic;

model y=x1 x2 x3 / rsquare;

run;

you can fit the same model in PROC QLIM like this:

proc qlim;

model y=x1 x2 x3 / discrete(d=logistic);

run;

and it will print all the R-square measures by default.

Solution

Monday

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Achieng

a week ago

You can also get McFadden's R-square in PROC HPLOGISTIC by using the PARTITION statement. Note that you do not have to actually do any partitioning of your data. For example:

```
proc hplogistic data=remiss;
model remiss(event='1') = smear blast;
partition fraction(test=0 validate=0);
run;
```