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
- /
- McFadden’s R2 in logistic REGRESSION

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-07-2018 10:52 AM

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

03-12-2018
06:09 AM

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

Posted in reply to Achieng

03-09-2018 02:58 PM

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

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

Posted in reply to Achieng

03-08-2018 08:51 AM

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

03-12-2018 03:53 AM

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Achieng

03-09-2018 08:56 AM

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

03-12-2018
06:09 AM

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

Posted in reply to Achieng

03-09-2018 02:58 PM

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;
```