A00-240 · Question #7
A financial services manager wants to assess the probability that certain clients will default on their Home Equity Line of Credit (HELOC). A former employee left the code listed below. proc…
The correct answer is A. data NEW_PROB; set SCORED_HELOC; p=1/(1+exp(-DEFAULT)); run; B. data NEW_PROB; set SCORED_HELOC; ODDS = exp(DEFAULT); p = ODDS / (1+ODDS); run. When proc score applies logistic regression parameters to new data, the output variable DEFAULT contains the linear predictor (log-odds): the raw sum β₀ + β₁x₁ + β₂x₂ + …, not a probability. To convert log-odds to a probability, you apply the inverse logit (sigmoid) function: p…
Question
Options
- Adata NEW_PROB; set SCORED_HELOC; p=1/(1+exp(-DEFAULT)); run;
- Bdata NEW_PROB; set SCORED_HELOC; ODDS = exp(DEFAULT); p = ODDS / (1+ODDS); run;
- Cdata NEW_PROB; set SCORED_HELOC; p=(1+exp(DEFAULT))/exp(DEFAULT); run;
- Ddata NEW_PROB; set SCORED_HELOC; p = DEFAULT / (1+DEFAULT); run;
How the community answered
(24 responses)- A83% (20)
- C8% (2)
- D8% (2)
Explanation
When proc score applies logistic regression parameters to new data, the output variable DEFAULT contains the linear predictor (log-odds): the raw sum β₀ + β₁x₁ + β₂x₂ + …, not a probability. To convert log-odds to a probability, you apply the inverse logit (sigmoid) function: p = 1 / (1 + exp(−x)). Option A applies this formula directly, and Option B is mathematically identical - dividing the odds exp(DEFAULT) by 1 + exp(DEFAULT) is an algebraic rearrangement of the same expression, so both correctly yield a value between 0 and 1.
Option C computes (1 + exp(DEFAULT)) / exp(DEFAULT), which simplifies to 1 + exp(−DEFAULT) - a value always greater than 1, making it an impossible probability. Option D treats DEFAULT as if it were already the odds (p = odds / (1 + odds)), but DEFAULT is the log-odds, not the odds themselves; the correct conversion of odds to probability requires first exponentiating, as done in B.
Memory tip: Think of it as two paths up the same mountain - A goes straight up with the sigmoid formula, B takes the scenic route through the odds first; both reach the same summit (valid probability). If your formula can ever exceed 1 or go below 0, it's wrong.
Topics
Community Discussion
No community discussion yet for this question.