Using the teengamb data, fit a model with gamble as the response and the other v
ID: 2934115 • Letter: U
Question
Using the teengamb data, fit a model with gamble as the response and the other variables as predictors.
(a) Predict the amount tha a male with average (given these data) status, income and verbal score would gamble along with an appropriate 95% CI.
(b) Repeat the prediction for a male with maximal values (for this data) of status, income and verbal score. Which CI is wider and why is this result expected?
(c) Fit a model with sqrt(gamble) as the response but with the same predictors. Now predict the response and give a 95% prediction interval for the individual in (a).
(d) Repeat the prediction for the model in (c) for a female with status = 20, income = 1, verbal = 10. Comment on the credibility of the result.
(data is from R, it is automatically provide.)
Explanation / Answer
(a)
Below is the code to predict that a male with average status, income and verbal score would gamble along with an appropriate 95% CI.
attach(teengamb)
model = lm(gamble~sex+status+income+verbal)
newdata = data.frame(sex=0,status=mean(status),income=mean(income),verbal=mean(verbal))
predict(model, newdata, interval="predict")
fit lwr upr
28.24252 -18.51536 75.00039
So, the amount that a male with average status, income and verbal score would gamble is 28.24252
95% confidence interval of the gamble amount is calculated by the below command.
predict(model, newdata, interval="confidence")
fit lwr upr
28.24252 18.78277 37.70227
95% confidence interval of gamble amount is (18.78277, 37.70227)
b)
Run the below command for the prediction for a male with maximal values of status, income and verbal score.
newdata1 = data.frame(sex=0,status=max(status),income=max(income),verbal=max(verbal))
predict(model, newdata1, interval="confidence")
fit lwr upr
71.30794 42.23237 100.3835
So, the amount that a male with maximum status, income and verbal score would gamble is 71.30794
The 95% confidence interval of gamble amount is (42.23237, 100.3835)
The confidence interval of prediction for a male with maximal values is wider than the prediction for a male with average values. This is expected because the gamble amount for maximum data values is greater than the gamble amount for average data values and hence the standard error and the width of confidence interval is wider for maximum data values.
(c)
Run the below code for new model and predict the response.
model1 = lm(sqrt(gamble)~sex+status+income+verbal)
predict(model1, newdata, interval="confidence")
fit lwr upr
4.049523 3.180676 4.918371
The sqrt(gamble) predicted is 4.049523. That is gamble amount is 16.39864.
95% confidence interval of sqrt(gamble) is (3.180676, 4.918371)
(d)
Below is the code to predict female with status = 20, income = 1, verbal = 10.
newdata2 = data.frame(sex=1,status=20,income=1,verbal=10)
predict(model1, newdata2, interval="confidence")
fit lwr upr
-2.08648 -4.445937 0.272978
The predicted gamble value for a female with status = 20, income = 1, verbal = 10 is negative value which is inconsistent with the given data. So, the model is part (c) does not adequately fit this data.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.