nerdexam
SAS_Institute

A00-240 · Question #12

Assume a $10 cost for soliciting a non-responder and a $200 profit for soliciting a responder. The logistic regression model gives a probability score named P_R on a SAS data set called VALID. The VAL

The correct answer is A. data VALID; set VALID; Profit = (P_R > .05)*Purch*200 - (P_R > .05)*(1 - Purch)*10; run;. Option A correctly models the profit for every customer in the dataset. In SAS, a boolean expression like (P_R > .05) evaluates to 1 when true and 0 when false, acting as a selector. The formula awards +$200 when a customer is solicited (P_R > .05) and responds (Purch=1), subtrac

Logistic Regression

Question

Assume a $10 cost for soliciting a non-responder and a $200 profit for soliciting a responder. The logistic regression model gives a probability score named P_R on a SAS data set called VALID. The VALID data set contains the responder variable Pinch, a 1/0 variable coded as 1 for responder. Customers will be solicited when their probability score is more than 0.05. Which SAS program computes the profit for each customer in the data set VALID?

Options

  • Adata VALID; set VALID; Profit = (P_R > .05)Purch200 - (P_R > .05)*(1 - Purch)*10; run;
  • Bdata VALID; set VALID; Profit = (P_R <= .05)Purch200 - (P_R > .05)*(1 - Purch)*10; run;
  • Cdata VALID; set VALID; if P_R > .05; Profit = (P_R > .05)Purch200 - (P_R > .05)*(1 - Purch)*10; run;
  • Ddata VALID; set VALID; if P_R > .05; Profit = (P_R > .05)Purch200 + (P_R <= .05)*(1 - Purch)*10; run;

How the community answered

(43 responses)
  • A
    70% (30)
  • B
    9% (4)
  • C
    16% (7)
  • D
    5% (2)

Explanation

Option A correctly models the profit for every customer in the dataset. In SAS, a boolean expression like (P_R > .05) evaluates to 1 when true and 0 when false, acting as a selector. The formula awards +$200 when a customer is solicited (P_R > .05) and responds (Purch=1), subtracts $10 when solicited and doesn't respond (1-Purch=1), and yields $0 for anyone not solicited - which is exactly the business logic described.

Option B is wrong because its first term uses (P_R <= .05) instead of (P_R > .05), meaning it mistakenly assigns the $200 profit to unsolicited responders rather than solicited ones. Option C is wrong because the bare if P_R > .05; (without then) is a SAS subsetting IF - it silently drops all records where P_R ≤ 0.05 from the output, so customers who weren't solicited get no profit row at all, instead of a $0 row. Option D fails for the same subsetting IF reason as C, and also uses + instead of - before the cost term, turning the $10 cost into a phantom gain.

Memory tip: Think "selector × outcome × value" - every term in the profit formula must use (P_R > .05) as the solicitation gate, Purch (or 1-Purch) as the response gate, and the sign distinguishes profit (+200) from cost (-10). Any option that flips the inequality in a profit term or uses a bare if without then is a trap.

Topics

#Logistic Regression Scoring#SAS Data Step#Profit Calculation#Conditional Logic

Community Discussion

No community discussion yet for this question.

Full A00-240 Practice