BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SlutskyFan
Obsidian | Level 7
Prior to using EM, I often undertook classification problems using PROC LOGISTIC. With the correct options, I could call for a Hosmer-Lemeshaw test which I believe gave me a good idea of how well my model could predict overall on a 'decile by decile' basis (as opposed to misclassification rate that is just an overall measure of fit).

Is there any way to call for this test in EM - like in the model assessment node or otherwise?

Correct me if I am wrong about the interpretation and use of the HL test. ( I know there are criticisms of it having low power for n < 400, but I typically deal in 1000's of obs)

Thanks.
1 ACCEPTED SOLUTION

Accepted Solutions
DougWielenga
SAS Employee

The short answer is that other than Mallow's Cq, SAS Enterprise Miner does not provide a Hosmer-Lemeshow test.  You could write code to run the LOGISTIC procedure in a SAS Code node but any results would be contained in that node so it would not likely benefit the user more than just running it in SAS.

 

Looking further, a quick search of the SAS Enterprise Miner help utility (available by clicking on Help --> Contents and then clicking on the magnifying glass to reveal the search window) only shows one place where the term "Hosmer-Lemeshow" even appears and it is related to Mallow's Cq.   Here is an extract from the help: 

 

Statistical Measures

Statistical measures of model performance are based on both model error and degrees of freedom. Some SAS Enterprise Miner models, such as Decision Tree models, do not output degrees of freedom and are not suitable for benchmarking using the statistical measures listed here. The information that follows pertains to Mallows’ Cq, Akaike’s Information Criterion, Bayesian Information Criterion, and Kolmogorov-Smirnov Statistic and is suitable only for specific models.

 

Mallow’s Cq

Mallows' Cq (Hosmer and Lemeshow, 2000) is a variant of Mallows Cp measure (1973), which can be used to analyze linear regression models for assessment. Hosmer and Lemeshow derived the corresponding Cq statistic to evaluate logistic regression models, using the following equation

C(sub-q) = [(x^2 + Lambda^*)/((x^2)/(n - p - 1))] + 2(q + 1) - n

where

  • q is the number of selected variables,
  • p is the number of candidate variables
  • X^2 = Sum[(y(sub-i) – pi-hat(sub-i))^2/(pi-hat(sub-i)(1– pi-hat(sub-i))]

    is the Pearson chi-square statistic for the model with p variables

  • λ is the multivariable Wald statistic that measures significance of p-q coefficients that are not in the model

The expected value of Cq is q + 1. Models with Cq values near q + 1 are candidates for final models.

 

 In general, data mining problems have massive numbers of variables which leads to a high likelihood of missing values. Given the typical data size, several things are often true of these problems:

* missing values must be imputed

* the imputed data will have a large number of observations

* the number of usable observations will be inflated by the imputation

* the presence of imputed data makes many of the classical estimates of error more questionable.

* holdout data is present to validate/test the fitted model (empirical validation, statistical validation less critical)

 

For these reasons, classical statistical scenarios such as those appropriate for treatment by Hosmer-Lemeshow are not routinely calculated in SAS Enterprise Miner. 

I hope this helps!

Doug

View solution in original post

1 REPLY 1
DougWielenga
SAS Employee

The short answer is that other than Mallow's Cq, SAS Enterprise Miner does not provide a Hosmer-Lemeshow test.  You could write code to run the LOGISTIC procedure in a SAS Code node but any results would be contained in that node so it would not likely benefit the user more than just running it in SAS.

 

Looking further, a quick search of the SAS Enterprise Miner help utility (available by clicking on Help --> Contents and then clicking on the magnifying glass to reveal the search window) only shows one place where the term "Hosmer-Lemeshow" even appears and it is related to Mallow's Cq.   Here is an extract from the help: 

 

Statistical Measures

Statistical measures of model performance are based on both model error and degrees of freedom. Some SAS Enterprise Miner models, such as Decision Tree models, do not output degrees of freedom and are not suitable for benchmarking using the statistical measures listed here. The information that follows pertains to Mallows’ Cq, Akaike’s Information Criterion, Bayesian Information Criterion, and Kolmogorov-Smirnov Statistic and is suitable only for specific models.

 

Mallow’s Cq

Mallows' Cq (Hosmer and Lemeshow, 2000) is a variant of Mallows Cp measure (1973), which can be used to analyze linear regression models for assessment. Hosmer and Lemeshow derived the corresponding Cq statistic to evaluate logistic regression models, using the following equation

C(sub-q) = [(x^2 + Lambda^*)/((x^2)/(n - p - 1))] + 2(q + 1) - n

where

  • q is the number of selected variables,
  • p is the number of candidate variables
  • X^2 = Sum[(y(sub-i) – pi-hat(sub-i))^2/(pi-hat(sub-i)(1– pi-hat(sub-i))]

    is the Pearson chi-square statistic for the model with p variables

  • λ is the multivariable Wald statistic that measures significance of p-q coefficients that are not in the model

The expected value of Cq is q + 1. Models with Cq values near q + 1 are candidates for final models.

 

 In general, data mining problems have massive numbers of variables which leads to a high likelihood of missing values. Given the typical data size, several things are often true of these problems:

* missing values must be imputed

* the imputed data will have a large number of observations

* the number of usable observations will be inflated by the imputation

* the presence of imputed data makes many of the classical estimates of error more questionable.

* holdout data is present to validate/test the fitted model (empirical validation, statistical validation less critical)

 

For these reasons, classical statistical scenarios such as those appropriate for treatment by Hosmer-Lemeshow are not routinely calculated in SAS Enterprise Miner. 

I hope this helps!

Doug

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1005 views
  • 0 likes
  • 2 in conversation