STAT 4385 Applied Regression Analysis Computer Project III (Due on 05/07/2021 Friday before 11:59pm, Upload your report in OneNote ) (Model Diagnostics) The crime data contain the crime rate, and...

1 answer below »

View more »
Answered 2 days AfterMay 03, 2021

Answer To: STAT 4385 Applied Regression Analysis Computer Project III (Due on 05/07/2021 Friday before 11:59pm,...

Mohd answered on May 06 2021
151 Votes
-
-
-
5/6/2021
loading packages and Data
library(readr)
library(magrittr)
library(dplyr)
library(ggplot2)
library(MASS)
library(GGally)
library(car)
library(lmtest)
library(readr)
crime <- rea
d_csv("crime.csv")
Use the all subset(or best subset) selection procedure with AIC to find your best linear regression model.
lm_mod<-lm(crimerate~police.funding+high+middle+in.college+graduate,data=crime)
stepAIC(lm_mod,direction="backward")
## Start: AIC=559.03
## crimerate ~ police.funding + high + middle + in.college + graduate
##
## Df Sum of Sq RSS AIC
## - in.college 1 467 2821727 557.04
## - graduate 1 10255 2831515 557.21
## - middle 1 19053 2840313 557.37
## - high 1 55510 2876769 558.01
## 2821259 559.03
## - police.funding 1 816153 3637413 569.74
##
## Step: AIC=557.04
## crimerate ~ police.funding + high + middle + graduate
##
## Df Sum of Sq RSS AIC
## - middle 1 23017 2844744 555.45
## - graduate 1 25192 2846918 555.49
## - high 1 93491 2915217 556.67
## 2821727 557.04
## - police.funding 1 846407 3668134 568.16
##
## Step: AIC=555.45
## crimerate ~ police.funding + high + graduate
##
## Df Sum of Sq RSS AIC
## - graduate 1 14129 2858872 553.70
## 2844744 555.45
## - high 1 148317 2993061 555.99
## - police.funding 1 1276802 4121546 571.99
##
## Step: AIC=553.7
## crimerate ~ police.funding + high
##
## Df Sum of Sq RSS AIC
## 2858872 553.7
## - high 1 171116 3029988 554.6
## - police.funding 1 1297044 4155917 570.4
##
## Call:
## lm(formula = crimerate ~ police.funding + high, data = crime)
##
## Coefficients:
## (Intercept) police.funding high
## 621.426 11.858 ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here
April
January
February
March
April
May
June
July
August
September
October
November
December
2025
2025
2026
2027
SunMonTueWedThuFriSat
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30