|
|
 |
|
|
 |
| All Exercises |
Problem |
Sample Data |
Solution |
 |
|
|
Select an Exercise for |
Click any exercise title to see the problem for that exercise. Then you can view and download sample data, complete the exercise, and check the solution.
Rainy Days 2 Use multiple logistic regression to predict the probability of rain from temperature.
Mail Order Customers 2 Describe the relationship between purchase level and factors such as age, gender, and income level.
|
Rainy Days 2: Problem |
A weather record was compiled for the month of April for a city in the eastern United States. The amount of rainfall (Precip), temperature (Temp), and barometric pressure (Pressure) were recorded for each of the 30 days of the month. A variable Rained was added to the set of data to categorize rainfall based on the following formula:
Rained = {"Rainy" if Precip > 0.02 {"Dry" otherwise
Find the equation of the logistic regression function fitting the probability of “Dry” against temperature and pressure. Use the coefficient of determination to make a statement about how the model fits the data.
|
 Lee Creighton SAS Institute
Printer Friendly |
Rainy Days 2: Sample Data | |
The Spring_rain data set is from a weather record for the month of April. The data set contains information on the temperature, precipitation, and barometric pressure for each of the thirty days in the month. Also a categorical variable Rained is included which categorizes rainfall in the following manner:
Rained = {"Rainy" if Precip > 0.02 {"Dry" otherwise These are the variables in the data set: Name | Type | Description | | date | char | date given as mm/dd | | Temp | num | temperature | | Precip | num | amount of rainfall | | Pressure | num | barometric pressure | | Rained | char | categorical—if Precip > 0.02, then Rained = “Rained”; otherwise Rained = “Dry” | |
|
Source of Data
|
Sall, J., Creighton, L., & Lehman, A. (2006). JMP Start Statistics, Third Edition. Cary, NC: SAS Institute Inc. |
Rainy Days 2: Solution |
Using PROC LOGISTIC in SAS, the logistic equation is given by
ln(p/(1 – p)) = -445.8 – 0.0551*Temp + 15.3079*Press
which is equivalent to
p = 1/(1 + exp( - (-445.8 – 0.0551*Temp + 15.3079*Press)))
where p is the prediction probability of “Dry.”
The coefficient of determination has a value of r^2 = 0.3555, which means that only about 36% of the variability in the probability of “Dry” is explained by its regression on temperature and barometric pressure.
|
Mail Order Customers 2: Problem |
A mail-order company has decided that customers who spend 100 dollars or more on purchases should be the focus of its advertising efforts. To help identify this target group, the company collected information from its customers including purchase level (1 = at least $100, 0 = less than $100 dollars), gender, income level, and age. Using the logistic regression of purchase level on gender, income level, and age, determine whether gender is a significant predictor for the probability of purchasing $100 or more. |
 SAS Institute Inc.
Printer Friendly |
Mail Order Customers 2: Sample Data | |
The Sales data set contains data about customers of a mail-order company. These are the variables in the data set: Name | Type | Description | | purchase | num | customer’s purchase level (1 = at least $100, 0 = less than $100 dollars) | | age | num | customer’s age | | gender | char | customer’s gender | | income | char | customer’s income level (Low, Medium, High) | |
|
Source of Data
|
This data is sample data from SAS Institute Inc. |
Mail Order Customers 2: Solution |
The results of the Wald chi-square test yield a test statistic value of W = 5.9494 and a corresponding p-value = 0.0147 for the gender effect. So, based on these findings we can conclude that gender is a significant predictor for the probability of purchasing $100 or more. |
|