Winter Term 2021

2021年冬季学期

A3 R练习

lm（medv〜crim + nox + chas + crim：nox + crim：chas，data =波士顿[254：506，]）

（a）使用带有日志链接的Gamma GLM分析这些数据。描述使用偏差分析的模型构建过程。

（b）在（a）部分中选择的模型与使用其他选择的标准（例如AIC或BIC）选择的模型相比如何（请查看RClass6-HousingData.Rmd以了解如何使用R完成此操作） ？

（c）根据您在（a）和（b）部分中的工作，选择您喜欢的模型。证明您的选择。

（d）解释在（c）部分中选择的模型。

（e）显示（c）部分中所选模型的残差图并评论拟合质量。

（f）拟合线性回归模型，其预测因子与（c）部分中的模型相同。你更倾向哪个？您可以查看AIC，BIC诊断图等-由您决定！

Generalized Linear Models MATH 523 Assignment 2

A3 R Exercise

Load the data Boston from the MASS library:

This data set has several predictors of the median value of owner-occupied homes (medv), for 506 neighbourhoods in the suburbs near Boston. For simplicity, focus on the last 253 observations and consider only the following inputs: crim (per capita crime rate by town), nox (nitrogen oxides concentration (parts per 10 million)), age (proportion of owner-occupied units built prior to 1940), and chas (Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)).

Here is how you can do the subsetting:

lm(medv ~ crim + nox + chas + crim:nox + crim:chas,data=Boston[254:506,])
1. (a)  Analyze these data with a Gamma GLM with the log link. Describe a model building process using the analysis of deviance.
2. (b)  How does the model selected in part (a) compare to a model selected using an- other criterion of your choice, such as AIC or BIC (look at RClass6-HousingData.Rmd to see how this can be done with R)?
3. (c)  Based on your work in parts (a) and (b), select your favourite model. Justify your choice.
4. (d)  Interpret the model selected in part (c).
5. (e)  Display a residual plot for the model selected in part (c) and comment on the quality of the fit.
6. (f)  Fit a linear regression model with the same predictors as your model in part (c). Which one do you prefer? You can look at AIC, BIC diagnostic plots etc – up to you!

EasyDue™ 支持PayPal, AliPay, WechatPay, Taobao等各种付款方式!

E-mail: easydue@outlook.com  微信:easydue

EasyDue™是一个服务全球中国留学生的专业代写公司