0% found this document useful (0 votes)
25 views34 pages

Soruma SECOND ASSEsiment Final L Reg

This document is an individual assignment for a regression analysis course at Adama Science and Technology University, authored by Soruma Biru. It includes R Markdown code for performing multiple regression analysis, constructing normal probability plots, and analyzing residuals from a linear model. The assignment also covers the interpretation of studentized and R-student residuals, as well as a thorough residual analysis of kinematic viscosity data.

Uploaded by

jeikob melaku
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views34 pages

Soruma SECOND ASSEsiment Final L Reg

This document is an individual assignment for a regression analysis course at Adama Science and Technology University, authored by Soruma Biru. It includes R Markdown code for performing multiple regression analysis, constructing normal probability plots, and analyzing residuals from a linear model. The assignment also covers the interpretation of studentized and R-student residuals, as well as a thorough residual analysis of kinematic viscosity data.

Uploaded by

jeikob melaku
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

SECOND ASSIGNMENT

Soruma biru

2024-12-29

ADAMA SCIENCE AND TECHNOLOGY UNIVERSITY

SCHOOL OF APPLIED NATURAL SCIENCE

MATHEMATICS PROGRAM

REGRESSION ANALYSIS (MATH4312)

INDIVIDUAL ASSIGNMENT 2
NAME SORUMA BIRU
ID UGR/27138/14

R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring
HTML, PDF, and MS Word documents. For more details on using R Markdown see
http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as
well as the output of any embedded R code chunks within the document. You can embed an
R code chunk like this:
summary(cars)

## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00

Including Plots
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the code chunk to prevent printing
of the R code that generated the plot.

1. Consider the multiple regression model fit to the house price data in Problem
3.7. Table B.4

a. Construct a normal probability plot of the residuals. Does there


seem to be any problem with the normality assumption?
Assuming your data is in a data frame called ‘data’ Fit a linear model (change ‘y ~ x1 + x2 +
… + x5’ according to your model)
library(ggplot2)

## Warning: package 'ggplot2' was built under R version 4.4.2

getwd()

## [1] "C:/Users/pc/Desktop/4th year"

setwd("C:/Users/pc/Desktop")
ss1=read.table("list.txt",header = T)
ss1

## y.0 x1.0 x2.0 x3.0 x4.4 x5.0 x6 x7 x8 x9


## 1 25.9 4.9176 1.0 3.4720 0.998 1.0 7 4 42 0
## 2 29.5 5.0208 1.0 3.5310 1.500 2.0 7 4 62 0
## 3 27.9 4.5429 1.0 2.2750 1.175 1.0 6 3 40 0
## 4 25.9 4.5573 1.0 4.0500 1.232 1.0 6 3 54 0
## 5 29.9 5.0597 1.0 4.4550 1.121 1.0 6 3 42 0
## 6 29.9 3.8910 1.0 4.4550 0.988 1.0 6 3 56 0
## 7 30.9 5.8980 1.0 5.8500 1.240 1.0 7 3 51 1
## 8 28.9 5.6039 1.0 9.5200 1.501 0.0 6 3 32 0
## 9 35.9 5.8282 1.0 6.4350 1.225 2.0 6 3 32 0
## 10 31.5 5.3003 1.0 4.9883 1.552 1.0 6 3 30 0
## 11 31.0 6.2712 1.0 5.5200 0.975 1.0 5 2 30 0
## 12 30.9 5.9592 1.0 6.6660 1.121 2.0 6 3 32 0
## 13 30.0 5.0500 1.0 5.0000 1.020 0.0 5 2 46 1
## 14 36.9 8.2464 1.5 5.1500 1.664 2.0 8 4 50 0
## 15 41.9 6.6969 1.5 6.9020 1.488 1.5 7 3 22 1
## 16 40.5 7.7841 1.5 7.1020 1.376 1.0 6 3 17 0
## 17 43.9 9.0384 1.0 7.8000 1.500 1.5 7 3 23 0
## 18 37.5 5.9894 1.0 5.5200 1.256 2.0 6 3 40 1
## 19 37.9 7.5422 1.5 5.0000 1.690 1.0 6 3 22 0
## 20 44.5 8.7951 1.5 9.8900 1.820 2.0 8 4 50 1
## 21 37.9 6.0831 1.5 6.7265 1.652 1.0 6 3 44 0
## 22 38.9 8.3607 1.5 9.1500 1.777 2.0 8 4 48 1
## 23 36.9 8.1400 1.0 8.0000 1.504 2.0 7 3 3 0
## 24 45.8 9.1416 1.5 7.3262 1.831 1.5 8 4 31 0

model<-lm(y.0~x1.0+x2.0+x3.0+x4.4+x5.0+x6+x7+x8,data=a1)
model

##
## Call:
## lm(formula = y.0 ~ x1.0 + x2.0 + x3.0 + x4.4 + x5.0 + x6 + x7 +
## x8, data = ss1)
##
## Coefficients:
## (Intercept) x1.0 x2.0 x3.0 x4.4
x5.0
## 12.75192 1.72633 8.08784 0.28738 2.28954
2.20354
## x6 x7 x8
## 0.50740 -2.87189 -0.01681

residuals <- model$residuals


residuals

## 1 2 3 4 5
6
## -0.27374134 0.11442653 -0.08624376 -2.51638675 0.55234922
3.10974403
## 7 8 9 10 11
12
## -0.92430666 -1.67727498 2.04690505 0.39523722 -2.97708304 -
3.00751736
## 13 14 15 16 17
18
## 0.65000570 -3.64780762 2.19325103 0.64046142 3.92623087
3.69506800
## 19 20 21 22 23
24
## -1.57273553 1.28559853 0.90678561 -3.28698786 -3.02741272
3.48143442

#Normal probability plot


qqnorm(residuals)
qqline(residuals, col = "red")

Interpretation:
If the points closely follow the straight line in the normal probability plot, the residuals are
normally distributed. Deviations from this line indicate potential problems with the
normality assumption.

b. Construct and interpret a plot of the residuals versus the predicted response.
# Predicted values
predicted_values <- model$fitted.values

# Plot residuals vs. predicted values


ggplot(a1, aes(x = predicted_values, y = residuals)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed", color = "red") +
labs(title = "Residuals vs. Predicted Values",
x = "Predicted Values",
y = "Residuals")

Interpretation:
Look for patterns in the residuals. Ideally, they should be randomly scattered around zero.
Patterns may indicate issues such as non-linearity or heteroscedasticity.

c. Compute the studentized residuals and the R- student residuals for this
model. What information is conveyed by these scaled residuals?
# Studentized residuals
studentized_residuals <- rstudent(model)

# R-student residuals
r_student_residuals <- rstandard(model)

# Print the residuals


print(studentized_residuals)

## 1 2 3 4 5
6
## -0.16224730 0.05074042 -0.03286445 -0.93167989 0.19252763
1.25152089
## 7 8 9 10 11
12
## -0.39110623 -1.08482266 0.80046393 0.16313167 -1.31188138 -
1.25664178
## 13 14 15 16 17
18
## 0.28369699 -1.61926213 1.34365573 0.28495989 2.01687665
1.49843225
## 19 20 21 22 23
24
## -0.70086726 0.54261010 0.37305437 -1.37023734 -1.56356418
1.46736781

print(r_student_residuals)

## 1 2 3 4 5
6
## -0.16778424 0.05251650 -0.03401662 -0.93580567 0.19902173
1.22854473
## 7 8 9 10 11
12
## -0.40263977 -1.07848398 0.81022539 0.16869706 -1.28144409 -
1.23306299
## 13 14 15 16 17
18
## 0.29281382 -1.53822909 1.30897317 0.29410980 1.83769076
1.43985542
## 19 20 21 22 23
24
## -0.71306481 0.55584045 0.38424287 -1.33183271 -1.49330297
1.41402067

Information Conveyed:
Studentized Residuals: These are the residuals divided by an estimate of their standard
deviation. They help identify outliers; values greater than 2 or less than -2 may indicate
potential outliers. R-Student Residuals: Similar to studentized residuals but take into
account the leverage of each observation. They are useful for diagnosing the influence of
individual data points on the regression model.

2. Consider the kinematic viscosity data in Table B.10. (Page 583)

a. Perform a thorough residual analysis of these data.


getwd()

## [1] "C:/Users/pc/Desktop"

setwd("C:/Users/pc/Desktop")
ss2=read.table("list11.txt",header = T)
ss2

## x1.0 x2 y.0
## 1 0.9189 −10 3.1280
## 2 0.9189 0 2.4270
## 3 0.9189 10 1.9400
## 4 0.9189 20 1.5860
## 5 0.9189 30 1.3250
## 6 0.9189 40 1.1260
## 7 0.9189 50 0.9694
## 8 0.9189 60 0.8473
## 9 0.9189 70 0.7481
## 10 0.9189 80 0.6671
## 11 0.7547 −10 2.2700
## 12 0.7547 0 1.8190
## 13 0.7547 10 1.4890
## 14 0.7547 20 1.2460
## 15 0.7547 30 1.0620
## 16 0.7547 40 0.9160
## 17 0.7547 50 0.8005
## 18 0.7547 60 0.7091
## 19 0.7547 70 0.6345
## 20 0.7547 80 0.5715
## 21 0.5685 −10 1.5930
## 22 0.5685 0 1.3240
## 23 0.5685 10 1.1180
## 24 0.5685 20 0.9576
## 25 0.5685 30 0.8302
## 26 0.5685 40 0.7282
## 27 0.5685 50 0.6470
## 28 0.5685 60 0.5784
## 29 0.5685 70 0.5219
## 30 0.5685 80 0.4735
## 31 0.3610 −10 1.1610
## 32 0.3610 0 0.9925
## 33 0.3610 10 0.8601
## 34 0.3610 20 0.7523
## 35 0.3610 30 0.6663
## 36 0.3610 40 0.5940
## 37 0.3610 50 0.5338
## 38 0.3610 60 0.4804
## 39 0.3610 70 0.4361
## 40 0.3610 80 0.4016

model<-lm(y.0 ~ x1.0+x2,data=ss2)
model

##
## Call:
## lm(formula = y.0 ~ x1.0 + x2, data = ss2)
##
## Coefficients:
## (Intercept) x1.0 x20 x210 x220
x230
## 1.1221 1.4073 -0.3974 -0.6862 -0.9025
-1.0671
## x240 x250 x260 x270 x280
## -1.1969 -1.3003 -1.3842 -1.4528 -1.5096

par(mfrow = c(2, 2))


plot(model)

qqnorm(model$residuals)
qqline(model$residuals, col = "red")
#b. Identify the
most appropriate transformation for these data. Fit this model and repeat the residual
analysis.
# Fit the linear model
model <- lm(y.0 ~ x1.0 + x2, data = ss2)

# Continue with residual analysis


par(mfrow = c(2, 2))
plot(model)
# Box-Cox transformation
library(MASS)
boxcox_result <- boxcox(model, lambda = seq(-2, 2, by = 0.1))
best_lambda <- boxcox_result$x[which.max(boxcox_result$y)]

# Fit the transformed model (example: log transformation)


a2$y_transformed <- log(ss2$y)
model_transformed <- lm(y_transformed ~ x1.0 + x2, data = ss2)

# Residual analysis of the transformed model


par(mfrow = c(2, 2))
plot(model_transformed)

#c. Perform a
thorough influence analysis of kinematic viscosity data
# Influence analysis
influence_measures <- influence.measures(model_transformed)

# Cook's Distance
cooks_distance <- cooks.distance(model_transformed)

# Plot Cook's Distance


plot(cooks_distance, type = "h", main = "Cook's Distance", ylab =
"Distance")
abline(h = 4/(nrow(data) - length(model_transformed$coefficients)),
col = "red")

# Identify influential points


influential_points <- which(cooks_distance > 4/(nrow(data) -
length(model_transformed$coefficients)))
print(influential_points)

## integer(0)

3. Consider the gasoline mileage data in Table B.3 (Page 576)


Install packages if not already installed
#install.packages(c(“lmtest”, “car”, “MASS”))
Load libraries,
#library(lmtest),library(car),library(MASS)
getwd()

## [1] "C:/Users/pc/Desktop"

setwd("C:/Users/pc/Desktop")
ss3=read.table("list22.txt",header = T)
ss3

## automobile y x1 x2 x3 x4 x5 x6 x7 x8 x9
x10 X11
## 1 Apollo 18.90 350.0 165 260 8.0:1 2.56:1 4 3 200.3 69.9
3910 A
## 2 Omega 17.00 350.0 170 275 8.5:1 2.56:1 4 3 199.6 72.9
2860 A
## 3 Nova 20.00 250.0 105 185 8.25:1 2.73:1 1 3 196.7 72.2
3510 A
## 4 Monarch 18.25 351.0 143 255 8.0:1 3.00:1 2 3 199.9 74.0
3890 A
## 5 Duster 20.07 225.0 95 170 8.4:1 2.76:1 1 3 194.1 71.8
3365 M
## 6 Jenson 11.20 440.0 215 330 8.2:1 2.88:1 4 3 184.5 69.0
4215 A
## 7 Skyhawk 22.12 231.0 110 175 8.0:1 2.56:1 2 3 179.3 65.4
3020 A
## 8 Monza 21.47 262.0 110 200 8.5:1 2.56:1 2 3 179.3 65.4
3180 A
## 9 Scirocco 34.70 89.7 70 81 8.2:1 3.90:1 2 4 155.7 64.0
1905 M
## 10 Corolla 30.40 96.9 75 83 9.0:1 4.30:1 2 5 165.2 65.0
2320 M
## 11 Camaro 16.50 350.0 155 250 8.5:1 3.08:1 4 3 195.4 74.4
3885 A
## 12 Datsun 36.50 85.3 80 83 8.5:1 3.89:1 2 4 160.6 62.2
2009 M
## 13 CapriII 21.50 171.0 109 146 8.2:1 3.22:1 2 4 170.4 66.9
2655 A
## 14 Pacer 19.70 258.0 110 195 8.0:1 3.08:1 1 3 171.5 77.0
3375 A
## 15 Babcat 20.30 140.0 83 109 8.4:1 3.40:1 2 4 168.8 69.4
2700 A
## 16 Granada 17.80 302.0 129 220 8.0:1 3.0:1 2 3 199.9 74.0
3890 A
## 17 Eldorado 14.39 500.0 190 360 8.5:1 2.73:1 4 3 224.1 79.8
5290 A
## 18 Imperial 14.89 440.0 215 330 8.2:1 2.71:1 4 3 231.0 79.7
5185 A
## 19 NovaLN 17.80 350.0 155 250 8.5:1 3.08:1 4 3 196.7 72.2
3910 A
## 20 Valiant 16.41 318.0 145 255 8.5:1 2.45:1 2 3 197.6 71.0
3660 A
## 21 Starfire 23.54 231.0 110 175 8.0:1 2.56:1 2 3 179.3 65.4
3050 A
## 22 Cordoba 21.47 360.0 180 290 8.4:1 2.45:1 2 3 214.2 76.3
4250 M
## 23 TransAM 16.59 400.0 185 NA 7.6:1 3.08:1 4 3 196.0 73.0
3850 M
## 24 CorollaE-5 31.90 96.9 75 83 9.0:1 4.30:1 2 5 165.2 61.8
2275 A
## 25 Astre 29.40 140.0 86 NA 8.0:1 2.92:1 2 4 176.4 65.4
2150 M
## 26 MarkIV 13.27 460.0 223 366 8.0:1 3.00:1 4 3 228.0 79.8
5430 A
## 27 CelicaGT 23.90 133.6 96 120 8.4:1 3.91:1 2 5 171.5 63.4
2535 M
## 28 ChargerSE 19.73 318.0 140 255 8.5:1 2.71:1 2 3 215.3 76.3
4370 A
## 29 Cougar 13.90 351.0 148 243 8.0:1 3.25:1 2 3 215.5 78.5
4540 A
## 30 Elite 13.27 351.0 148 243 8.0:1 3.26:1 2 3 216.1 78.5
4715 A
## 31 Matador 13.77 360.0 195 295 8.25:1 3.15:1 4 3 209.3 77.4
4215 A
## 32 Corvette 16.50 350.0 165 255 8.5:1 2.73:1 4 3 185.2 69.0
3660 A

# Fit the multiple regression model


model <- lm(y~x1+x2+x3+x4+x5+x6+x7+x8+x9+x10,data = ss3)
model

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
## x10, data = ss3)
##
## Coefficients:
## (Intercept) x1 x2 x3 x48.2:1
x48.25:1
## -63.790705 0.664218 1.638892 -1.468730 -34.207290
-5.167937
## x48.4:1 x48.5:1 x49.0:1 x52.56:1 x52.71:1
x52.73:1
## -18.648206 14.631714 48.517340 23.718432 6.487848
4.808748
## x52.76:1 x52.88:1 x53.0:1 x53.00:1 x53.08:1
x53.15:1
## 30.270571 16.422128 1.668195 -1.971709 12.093417
18.939563
## x53.22:1 x53.25:1 x53.26:1 x53.40:1 x53.89:1
x53.90:1
## 59.869685 -36.668134 -37.713042 53.601808 40.244262
100.525490
## x53.91:1 x54.30:1 x6 x7 x8
x9
## 52.870647 NA -27.513626 NA 0.370292
-0.435754
## x10
## 0.001101

b. Test for significance of regression. What conclusions can you draw?


And c.Use t tests to assess the contribution of each regressor to the
model
#The overall significance can be determined from the F-statistic in the summary output.
# Check the summary for significance
summary(model)

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
## x10, data = ss3)
##
## Residuals:
## 1 2 3 4 5 6
7
## -1.306e-02 1.459e-02 2.515e-17 4.313e-03 -1.284e-16 8.674e-17 -
6.860e-01
## 8 9 10 11 12 13
14
## -1.644e-02 3.209e-17 -7.757e-02 8.471e-02 5.117e-17 -1.115e-16 -
1.857e-03
## 15 16 17 18 19 20
21
## -1.592e-16 -4.770e-18 4.182e-03 -1.214e-17 -8.286e-02 -3.227e-16
7.009e-01
## 22 24 26 27 28 29
30
## 1.422e-16 7.757e-02 -4.313e-03 2.776e-17 3.383e-17 1.778e-17
1.288e-16
## 31 32
## 1.995e-17 -4.182e-03
##
## Coefficients: (2 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -63.790705 360.855065 -0.177 0.889
## x1 0.664218 2.305698 0.288 0.821
## x2 1.638892 5.806356 0.282 0.825
## x3 -1.468730 5.163986 -0.284 0.824
## x48.2:1 -34.207290 112.511371 -0.304 0.812
## x48.25:1 -5.167937 10.574666 -0.489 0.711
## x48.4:1 -18.648206 83.885312 -0.222 0.861
## x48.5:1 14.631714 56.607895 0.258 0.839
## x49.0:1 48.517340 127.173356 0.382 0.768
## x52.56:1 23.718432 70.340578 0.337 0.793
## x52.71:1 6.487848 6.961025 0.932 0.522
## x52.73:1 4.808748 5.608308 0.857 0.549
## x52.76:1 30.270571 120.744832 0.251 0.844
## x52.88:1 16.422128 59.656985 0.275 0.829
## x53.0:1 1.668195 3.044162 0.548 0.681
## x53.00:1 -1.971709 12.339434 -0.160 0.899
## x53.08:1 12.093417 24.169901 0.500 0.705
## x53.15:1 18.939563 51.589316 0.367 0.776
## x53.22:1 59.869685 188.532159 0.318 0.804
## x53.25:1 -36.668134 123.779302 -0.296 0.817
## x53.26:1 -37.713042 125.680963 -0.300 0.814
## x53.40:1 53.601808 192.213381 0.279 0.827
## x53.89:1 40.244262 75.142526 0.536 0.687
## x53.90:1 100.525490 286.973736 0.350 0.785
## x53.91:1 52.870647 187.628152 0.282 0.825
## x54.30:1 NA NA NA NA
## x6 -27.513626 91.060848 -0.302 0.813
## x7 NA NA NA NA
## x8 0.370292 0.974750 0.380 0.769
## x9 -0.435754 0.373566 -1.166 0.451
## x10 0.001101 0.007734 0.142 0.910
##
## Residual standard error: 0.9944 on 1 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.9991, Adjusted R-squared: 0.9748
## F-statistic: 41.11 on 28 and 1 DF, p-value: 0.1228

d. Does the correlation matrix give any indication of multicollinearity?

cor_matrix <- cor(automobile_data[, -1])

print(cor_matrix)
x1 x6
## x1 1.0000000 -0.6308887
## x6 -0.6308887 1.0000000
e. Calculate the variance inflation factors and the condition number of
X’X. Is there any evidence of multicollinearity?
# Calculate VIF= values
aa=values <- (model)
aa

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
## x10, data = ss3)
##
## Coefficients:
## (Intercept) x1 x2 x3 x48.2:1
x48.25:1
## -63.790705 0.664218 1.638892 -1.468730 -34.207290
-5.167937
## x48.4:1 x48.5:1 x49.0:1 x52.56:1 x52.71:1
x52.73:1
## -18.648206 14.631714 48.517340 23.718432 6.487848
4.808748
## x52.76:1 x52.88:1 x53.0:1 x53.00:1 x53.08:1
x53.15:1
## 30.270571 16.422128 1.668195 -1.971709 12.093417
18.939563
## x53.22:1 x53.25:1 x53.26:1 x53.40:1 x53.89:1
x53.90:1
## 59.869685 -36.668134 -37.713042 53.601808 40.244262
100.525490
## x53.91:1 x54.30:1 x6 x7 x8
x9
## 52.870647 NA -27.513626 NA 0.370292
-0.435754
## x10
## 0.001101

print(values)

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
## x10, data = ss3)
##
## Coefficients:
## (Intercept) x1 x2 x3 x48.2:1
x48.25:1
## -63.790705 0.664218 1.638892 -1.468730 -34.207290
-5.167937
## x48.4:1 x48.5:1 x49.0:1 x52.56:1 x52.71:1
x52.73:1
## -18.648206 14.631714 48.517340 23.718432 6.487848
4.808748
## x52.76:1 x52.88:1 x53.0:1 x53.00:1 x53.08:1
x53.15:1
## 30.270571 16.422128 1.668195 -1.971709 12.093417
18.939563
## x53.22:1 x53.25:1 x53.26:1 x53.40:1 x53.89:1
x53.90:1
## 59.869685 -36.668134 -37.713042 53.601808 40.244262
100.525490
## x53.91:1 x54.30:1 x6 x7 x8
x9
## 52.870647 NA -27.513626 NA 0.370292
-0.435754
## x10
## 0.001101

# Calculate condition number


X <- model.matrix(model)
condition_number <- kappa(X)
print(condition_number)

## [1] 1.312564e+17

#f multicollinearity a potential problem in this model?


Call:
lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
x10, data = ss3)

Coefficients:
(Intercept) x1 x2 x3 x48.2:1 x48.25:1
x48.4:1 x48.5:1
-63.790705 0.664218 1.638892 -1.468730 -34.207290 -5.167937
-18.648206 14.631714
x49.0:1 x52.56:1 x52.71:1 x52.73:1 x52.76:1 x52.88:1
x53.0:1 x53.00:1
48.517340 23.718432 6.487848 4.808748 30.270571 16.422128
1.668195 -1.971709
x53.08:1 x53.15:1 x53.22:1 x53.25:1 x53.26:1 x53.40:1
x53.89:1 x53.90:1
12.093417 18.939563 59.869685 -36.668134 -37.713042 53.601808
40.244262 100.525490
x53.91:1 x54.30:1 x6 x7 x8 x9
x10
52.870647 NA -27.513626 NA 0.370292 -0.435754
0.001101

g. Use forward selection to specify a subset regression model.


forward_model <- stepAIC(lm(y ~ x1+x2+x3+x4+x5+x6+x7+x8+x9+x10,data =
ss3),
direction = "forward",
scope = formula(model))

## Start: AIC=-44.38
## y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10

forward_model

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
## x10, data = ss3)
##
## Coefficients:
## (Intercept) x1 x2 x3 x48.2:1
x48.25:1
## -63.790705 0.664218 1.638892 -1.468730 -34.207290
-5.167937
## x48.4:1 x48.5:1 x49.0:1 x52.56:1 x52.71:1
x52.73:1
## -18.648206 14.631714 48.517340 23.718432 6.487848
4.808748
## x52.76:1 x52.88:1 x53.0:1 x53.00:1 x53.08:1
x53.15:1
## 30.270571 16.422128 1.668195 -1.971709 12.093417
18.939563
## x53.22:1 x53.25:1 x53.26:1 x53.40:1 x53.89:1
x53.90:1
## 59.869685 -36.668134 -37.713042 53.601808 40.244262
100.525490
## x53.91:1 x54.30:1 x6 x7 x8
x9
## 52.870647 NA -27.513626 NA 0.370292
-0.435754
## x10
## 0.001101

h. Use backward elimination to specify a subset regression model


backward_model <- stepAIC(model, direction = "backward")

## Start: AIC=-44.38
## y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10
##
##
## Step: AIC=-44.38
## y ~ x1 + x2 + x3 + x4 + x5 + x6 + x8 + x9 + x10
##
## Df Sum of Sq RSS AIC
## - x10 1 0.020 1.009 -45.773
## <none> 0.989 -44.375
## - x2 1 0.079 1.068 -44.076
## - x3 1 0.080 1.069 -44.042
## - x1 1 0.082 1.071 -43.984
## - x6 1 0.090 1.079 -43.755
## - x8 1 0.143 1.131 -42.331
## - x9 1 1.345 2.334 -20.607
## - x4 4 17.417 18.405 35.343
## - x5 16 191.700 192.689 81.796
##
## Step: AIC=-45.77
## y ~ x1 + x2 + x3 + x4 + x5 + x6 + x8 + x9
##
## Df Sum of Sq RSS AIC
## <none> 1.009 -45.773
## - x2 1 0.394 1.402 -37.890
## - x1 1 0.424 1.433 -37.245
## - x3 1 0.428 1.437 -37.154
## - x6 1 0.477 1.486 -36.161
## - x8 1 0.633 1.642 -33.165
## - x9 1 1.973 2.981 -15.264
## - x4 4 17.430 18.439 33.398
## - x5 16 191.728 192.737 79.804

backward_model

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x8 + x9, data = ss3)
##
## Coefficients:
## (Intercept) x1 x2 x3 x48.2:1
x48.25:1
## -13.6102 0.3445 0.8338 -0.7516 -18.6315
-3.8767
## x48.4:1 x48.5:1 x49.0:1 x52.56:1 x52.71:1
x52.73:1
## -7.0422 6.7521 30.9711 13.9751 5.7203
4.2440
## x52.76:1 x52.88:1 x53.0:1 x53.00:1 x53.08:1
x53.15:1
## 13.5916 8.1643 1.5267 -0.2742 8.8740
11.8851
## x53.22:1 x53.25:1 x53.26:1 x53.40:1 x53.89:1
x53.90:1
## 33.8001 -19.4491 -20.2220 27.0961 29.9384
60.8380
## x53.91:1 x54.30:1 x6 x8 x9
## 26.9175 NA -14.9124 0.2381 -0.4615

i. Use stepwise regression to specify a subset regression model


stepwise_model <- stepAIC(model, direction = "both")

## Start: AIC=-44.38
## y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10
##
##
## Step: AIC=-44.38
## y ~ x1 + x2 + x3 + x4 + x5 + x6 + x8 + x9 + x10
##
## Df Sum of Sq RSS AIC
## - x10 1 0.020 1.009 -45.773
## <none> 0.989 -44.375
## - x2 1 0.079 1.068 -44.076
## - x3 1 0.080 1.069 -44.042
## - x1 1 0.082 1.071 -43.984
## - x6 1 0.090 1.079 -43.755
## - x8 1 0.143 1.131 -42.331
## - x9 1 1.345 2.334 -20.607
## - x4 4 17.417 18.405 35.343
## - x5 16 191.700 192.689 81.796
##
## Step: AIC=-45.77
## y ~ x1 + x2 + x3 + x4 + x5 + x6 + x8 + x9
##
## Df Sum of Sq RSS AIC
## <none> 1.009 -45.773
## + x10 1 0.020 0.989 -44.375
## - x2 1 0.394 1.402 -37.890
## - x1 1 0.424 1.433 -37.245
## - x3 1 0.428 1.437 -37.154
## - x6 1 0.477 1.486 -36.161
## - x8 1 0.633 1.642 -33.165
## - x9 1 1.973 2.981 -15.264
## - x4 4 17.430 18.439 33.398
## - x5 16 191.728 192.737 79.804

stepwise_model

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x8 + x9, data = ss3)
##
## Coefficients:
## (Intercept) x1 x2 x3 x48.2:1
x48.25:1
## -13.6102 0.3445 0.8338 -0.7516 -18.6315
-3.8767
## x48.4:1 x48.5:1 x49.0:1 x52.56:1 x52.71:1
x52.73:1
## -7.0422 6.7521 30.9711 13.9751 5.7203
4.2440
## x52.76:1 x52.88:1 x53.0:1 x53.00:1 x53.08:1
x53.15:1
## 13.5916 8.1643 1.5267 -0.2742 8.8740
11.8851
## x53.22:1 x53.25:1 x53.26:1 x53.40:1 x53.89:1
x53.90:1
## 33.8001 -19.4491 -20.2220 27.0961 29.9384
60.8380
## x53.91:1 x54.30:1 x6 x8 x9
## 26.9175 NA -14.9124 0.2381 -0.4615

j. Comment on the final model chosen by these three procedures.


Discuss your findings
summary(forward_model)

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
## x10, data = ss3)
##
## Residuals:
## 1 2 3 4 5 6
7
## -1.306e-02 1.459e-02 2.515e-17 4.313e-03 -1.284e-16 8.674e-17 -
6.860e-01
## 8 9 10 11 12 13
14
## -1.644e-02 3.209e-17 -7.757e-02 8.471e-02 5.117e-17 -1.115e-16 -
1.857e-03
## 15 16 17 18 19 20
21
## -1.592e-16 -4.770e-18 4.182e-03 -1.214e-17 -8.286e-02 -3.227e-16
7.009e-01
## 22 24 26 27 28 29
30
## 1.422e-16 7.757e-02 -4.313e-03 2.776e-17 3.383e-17 1.778e-17
1.288e-16
## 31 32
## 1.995e-17 -4.182e-03
##
## Coefficients: (2 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -63.790705 360.855065 -0.177 0.889
## x1 0.664218 2.305698 0.288 0.821
## x2 1.638892 5.806356 0.282 0.825
## x3 -1.468730 5.163986 -0.284 0.824
## x48.2:1 -34.207290 112.511371 -0.304 0.812
## x48.25:1 -5.167937 10.574666 -0.489 0.711
## x48.4:1 -18.648206 83.885312 -0.222 0.861
## x48.5:1 14.631714 56.607895 0.258 0.839
## x49.0:1 48.517340 127.173356 0.382 0.768
## x52.56:1 23.718432 70.340578 0.337 0.793
## x52.71:1 6.487848 6.961025 0.932 0.522
## x52.73:1 4.808748 5.608308 0.857 0.549
## x52.76:1 30.270571 120.744832 0.251 0.844
## x52.88:1 16.422128 59.656985 0.275 0.829
## x53.0:1 1.668195 3.044162 0.548 0.681
## x53.00:1 -1.971709 12.339434 -0.160 0.899
## x53.08:1 12.093417 24.169901 0.500 0.705
## x53.15:1 18.939563 51.589316 0.367 0.776
## x53.22:1 59.869685 188.532159 0.318 0.804
## x53.25:1 -36.668134 123.779302 -0.296 0.817
## x53.26:1 -37.713042 125.680963 -0.300 0.814
## x53.40:1 53.601808 192.213381 0.279 0.827
## x53.89:1 40.244262 75.142526 0.536 0.687
## x53.90:1 100.525490 286.973736 0.350 0.785
## x53.91:1 52.870647 187.628152 0.282 0.825
## x54.30:1 NA NA NA NA
## x6 -27.513626 91.060848 -0.302 0.813
## x7 NA NA NA NA
## x8 0.370292 0.974750 0.380 0.769
## x9 -0.435754 0.373566 -1.166 0.451
## x10 0.001101 0.007734 0.142 0.910
##
## Residual standard error: 0.9944 on 1 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.9991, Adjusted R-squared: 0.9748
## F-statistic: 41.11 on 28 and 1 DF, p-value: 0.1228

summary(backward_model)

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x8 + x9, data = ss3)
##
## Residuals:
## 1 2 3 4 5 6
7
## -1.943e-03 2.170e-03 -5.150e-18 6.418e-04 1.166e-17 2.055e-17 -
7.089e-01
## 8 9 10 11 12 13
14
## -2.447e-03 2.662e-17 -1.154e-02 1.260e-02 1.124e-16 -8.544e-17 -
2.763e-04
## 15 16 17 18 19 20
21
## -6.619e-17 -5.790e-17 6.222e-04 3.117e-17 -1.233e-02 -3.268e-16
7.111e-01
## 22 24 26 27 28 29
30
## 3.527e-16 1.154e-02 -6.418e-04 -8.625e-17 4.705e-17 3.909e-17
1.133e-17
## 31 32
## -2.206e-17 -6.222e-04
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -13.6102 55.4855 -0.245 0.829
## x1 0.3445 0.3758 0.917 0.456
## x2 0.8338 0.9438 0.883 0.470
## x3 -0.7516 0.8155 -0.922 0.454
## x48.2:1 -18.6315 18.8232 -0.990 0.427
## x48.25:1 -3.8767 3.8862 -0.998 0.424
## x48.4:1 -7.0422 14.1756 -0.497 0.669
## x48.5:1 6.7521 8.5258 0.792 0.511
## x49.0:1 30.9711 22.4744 1.378 0.302
## x52.56:1 13.9751 11.6512 1.199 0.353
## x52.71:1 5.7203 3.1461 1.818 0.211
## x52.73:1 4.2440 2.8321 1.499 0.273
## x52.76:1 13.5916 20.9489 0.649 0.583
## x52.88:1 8.1643 10.0007 0.816 0.500
## x53.0:1 1.5267 2.0552 0.743 0.535
## x53.00:1 -0.2742 2.2770 -0.120 0.915
## x53.08:1 8.8740 6.1047 1.454 0.283
## x53.15:1 11.8851 10.2827 1.156 0.367
## x53.22:1 33.8001 32.1667 1.051 0.404
## x53.25:1 -19.4491 18.8903 -1.030 0.411
## x53.26:1 -20.2220 19.0078 -1.064 0.399
## x53.40:1 27.0961 34.2471 0.791 0.512
## x53.89:1 29.9384 14.4369 2.074 0.174
## x53.90:1 60.8380 48.8455 1.246 0.339
## x53.91:1 26.9175 31.8371 0.845 0.487
## x54.30:1 NA NA NA NA
## x6 -14.9124 15.3377 -0.972 0.433
## x8 0.2381 0.2126 1.120 0.379
## x9 -0.4615 0.2334 -1.978 0.187
##
## Residual standard error: 0.7102 on 2 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.9991, Adjusted R-squared: 0.9872
## F-statistic: 83.57 on 27 and 2 DF, p-value: 0.01189

summary(stepwise_model)

##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x8 + x9, data = ss3)
##
## Residuals:
## 1 2 3 4 5 6
7
## -1.943e-03 2.170e-03 -5.150e-18 6.418e-04 1.166e-17 2.055e-17 -
7.089e-01
## 8 9 10 11 12 13
14
## -2.447e-03 2.662e-17 -1.154e-02 1.260e-02 1.124e-16 -8.544e-17 -
2.763e-04
## 15 16 17 18 19 20
21
## -6.619e-17 -5.790e-17 6.222e-04 3.117e-17 -1.233e-02 -3.268e-16
7.111e-01
## 22 24 26 27 28 29
30
## 3.527e-16 1.154e-02 -6.418e-04 -8.625e-17 4.705e-17 3.909e-17
1.133e-17
## 31 32
## -2.206e-17 -6.222e-04
##
## Coefficients: (1 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -13.6102 55.4855 -0.245 0.829
## x1 0.3445 0.3758 0.917 0.456
## x2 0.8338 0.9438 0.883 0.470
## x3 -0.7516 0.8155 -0.922 0.454
## x48.2:1 -18.6315 18.8232 -0.990 0.427
## x48.25:1 -3.8767 3.8862 -0.998 0.424
## x48.4:1 -7.0422 14.1756 -0.497 0.669
## x48.5:1 6.7521 8.5258 0.792 0.511
## x49.0:1 30.9711 22.4744 1.378 0.302
## x52.56:1 13.9751 11.6512 1.199 0.353
## x52.71:1 5.7203 3.1461 1.818 0.211
## x52.73:1 4.2440 2.8321 1.499 0.273
## x52.76:1 13.5916 20.9489 0.649 0.583
## x52.88:1 8.1643 10.0007 0.816 0.500
## x53.0:1 1.5267 2.0552 0.743 0.535
## x53.00:1 -0.2742 2.2770 -0.120 0.915
## x53.08:1 8.8740 6.1047 1.454 0.283
## x53.15:1 11.8851 10.2827 1.156 0.367
## x53.22:1 33.8001 32.1667 1.051 0.404
## x53.25:1 -19.4491 18.8903 -1.030 0.411
## x53.26:1 -20.2220 19.0078 -1.064 0.399
## x53.40:1 27.0961 34.2471 0.791 0.512
## x53.89:1 29.9384 14.4369 2.074 0.174
## x53.90:1 60.8380 48.8455 1.246 0.339
## x53.91:1 26.9175 31.8371 0.845 0.487
## x54.30:1 NA NA NA NA
## x6 -14.9124 15.3377 -0.972 0.433
## x8 0.2381 0.2126 1.120 0.379
## x9 -0.4615 0.2334 -1.978 0.187
##
## Residual standard error: 0.7102 on 2 degrees of freedom
## (2 observations deleted due to missingness)
## Multiple R-squared: 0.9991, Adjusted R-squared: 0.9872
## F-statistic: 83.57 on 27 and 2 DF, p-value: 0.01189

k. Perform a thorough influence analysis of the data


influence_measures <- influence.measures(model)
influence_measures

## Influence measures of
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
x10, data = ss3) :
##
## dfb.1_ dfb.x1 dfb.x2 dfb.x3 dfb.x48.2. dfb.x48.25 dfb.x48.4
dfb.x48.5
## 1 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 2 -1.407 0.714 0.881 -0.724 -0.763 -2.64 -0.967
0.869
## 3 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 4 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 5 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 6 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 7 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 8 -0.053 -1.146 -0.971 0.958 0.752 -8.81 0.321 -
1.681
## 9 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 10 5.154 -4.788 -4.801 4.869 4.728 4.72 4.764 -
4.941
## 11 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 12 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 13 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 14 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 15 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 16 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 17 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 18 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 19 6.730 -6.840 -6.850 6.822 6.852 6.52 6.862 -
6.804
## 20 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 21 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 22 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 24 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 26 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 27 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 28 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 29 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 30 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 31 0.000 0.000 0.000 0.000 0.000 0.00 0.000
0.000
## 32 1.624 -4.703 -5.047 4.754 5.358 1.58 4.028 -
4.785
## dfb.x49. dfb.x52.5 dfb.x52.71 dfb.x52.73 dfb.x52.76 dfb.x52.8
dfb.x53.0.
## 1 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 2 1.11 1.24 2.26 7.49 1.08 1.353
9.84
## 3 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 4 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 5 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 6 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 7 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 8 -1.65 -1.58 -5.46 5.52 -1.14 0.452
-16.74
## 9 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 10 -4.63 -4.76 -1.26 -2.18 -4.63 -5.027
2.85
## 11 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 12 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 13 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 14 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 15 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 16 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 17 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 18 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 19 -6.92 -6.87 -6.64 -6.87 -6.90 -6.841
-5.32
## 20 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 21 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 22 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 24 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 26 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 27 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 28 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 29 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 30 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 31 0.00 0.00 0.00 0.00 0.00 0.000
0.00
## 32 -3.80 -3.70 -22.46 -14.46 -4.96 -1.532
-16.58
## dfb.x53.00 dfb.x53.08 dfb.x53.1 dfb.x53.22 dfb.x53.25 dfb.x53.26
dfb.x53.4
## 1 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 2 0.693 2.422 1.270 0.901 -0.56 -0.498
1.12
## 3 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 4 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 5 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 6 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 7 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 8 -1.276 -0.684 -0.129 -1.143 0.52 0.566
-1.04
## 9 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 10 4.844 -3.762 -4.620 -4.671 4.98 4.992
-4.59
## 11 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 12 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 13 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 14 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 15 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 16 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 17 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 18 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 19 6.509 -7.545 -7.035 -6.892 6.77 6.763
-6.94
## 20 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 21 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 22 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 24 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 26 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 27 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 28 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 29 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 30 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 31 0.000 0.000 0.000 0.000 0.00 0.000
0.00
## 32 2.581 -1.275 -3.100 -4.404 3.76 3.758
-3.91
## dfb.x53.8 dfb.x53.90 dfb.x53.91 dfb.x6 dfb.x8 dfb.x9 dfb.x10
dffit cov.r
## 1 0.00 0.000 0.00 0.000 0.00 0.00 0.00
0.0 NaN
## 2 1.11 0.905 1.01 -0.924 2.26 1.87 -5.98
68.2 4647
## 3 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 4 0.00 0.000 0.00 0.000 0.00 0.00 0.00
0.0 NaN
## 5 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 6 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 7 0.00 0.000 0.00 0.000 0.00 0.00 0.00
0.0 NaN
## 8 -1.58 -1.146 -1.10 1.071 2.26 1.87 -5.98 -
60.5 3657
## 9 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 10 -4.38 -4.676 -4.70 4.723 -4.66 -8.79 -5.98 -
12.8 164
## 11 0.00 0.000 0.00 0.000 0.00 0.00 0.00
0.0 NaN
## 12 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 13 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 14 0.00 0.000 0.00 0.000 0.00 0.00 0.00
0.0 NaN
## 15 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 16 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 17 0.00 0.000 0.00 0.000 0.00 0.00 0.00
0.0 NaN
## 18 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 19 -6.97 -6.892 -6.88 6.882 -7.16 1.87 -5.98 -
12.0 144
## 20 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 21 0.00 0.000 0.00 0.000 0.00 0.00 0.00
0.0 NaN
## 22 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 24 0.00 0.000 0.00 0.000 0.00 0.00 0.00
0.0 NaN
## 26 0.00 0.000 0.00 0.000 0.00 0.00 0.00
0.0 NaN
## 27 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 28 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 29 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 30 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 31 0.00 0.000 0.00 0.000 0.00 0.00 0.00
NaN NaN
## 32 -2.58 -4.388 -3.83 4.428 2.26 1.87 -5.98 -
237.8 56547
## cook.d hat inf
## 1 2.00e+02 1.000 *
## 2 1.60e+02 1.000 *
## 3 NaN 1.000
## 4 1.83e+03 1.000 *
## 5 NaN 1.000
## 6 NaN 1.000
## 7 3.80e-02 0.524
## 8 1.26e+02 1.000 *
## 9 NaN 1.000
## 10 5.63e+00 0.994 *
## 11 4.72e+00 0.993 *
## 12 NaN 1.000
## 13 NaN 1.000
## 14 9.89e+03 1.000 *
## 15 NaN 1.000
## 16 NaN 1.000
## 17 1.95e+03 1.000 *
## 18 NaN 1.000
## 19 4.93e+00 0.993 *
## 20 NaN 1.000
## 21 3.49e-02 0.503
## 22 NaN 1.000
## 24 5.63e+00 0.994 *
## 26 1.83e+03 1.000 *
## 27 NaN 1.000
## 28 NaN 1.000
## 29 NaN 1.000
## 30 NaN 1.000
## 31 NaN 1.000
## 32 1.95e+03 1.000 *

summary(influence_measures)

## Potentially influential observations of


## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 +
x10, data = ss3) :
##
## dfb.1_ dfb.x1 dfb.x2 dfb.x3 dfb.x48.2:
dfb.x48.25 dfb.x48.4
## 1 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 2 -1.41_* 0.71 0.88 -0.72 -0.76 -
2.64_* -0.97
## 4 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 8 -0.05 -1.15_* -0.97 0.96 0.75 -
8.81_* 0.32
## 10 5.15_* -4.79_* -4.80_* 4.87_* 4.73_*
4.72_* 4.76_*
## 11 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 14 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 17 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 19 6.73_* -6.84_* -6.85_* 6.82_* 6.85_*
6.52_* 6.86_*
## 24 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 26 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 32 1.62_* -4.70_* -5.05_* 4.75_* 5.36_*
1.58_* 4.03_*
## dfb.x48.5 dfb.x49. dfb.x52.5 dfb.x52.71 dfb.x52.73
dfb.x52.76 dfb.x52.8
## 1 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 2 0.87 1.11_* 1.24_* 2.26_* 7.49_*
1.08_* 1.35_*
## 4 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 8 -1.68_* -1.65_* -1.58_* -5.46_* 5.52_* -
1.14_* 0.45
## 10 -4.94_* -4.63_* -4.76_* -1.26_* -2.18_* -
4.63_* -5.03_*
## 11 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 14 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 17 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 19 -6.80_* -6.92_* -6.87_* -6.64_* -6.87_* -
6.90_* -6.84_*
## 24 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 26 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 32 -4.79_* -3.80_* -3.70_* -22.46_* -14.46_* -
4.96_* -1.53_*
## dfb.x53.0: dfb.x53.00 dfb.x53.08 dfb.x53.1 dfb.x53.22
dfb.x53.25 dfb.x53.26
## 1 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 2 9.84_* 0.69 2.42_* 1.27_* 0.90 -0.56
-0.50
## 4 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 8 -16.74_* -1.28_* -0.68 -0.13 -1.14_* 0.52
0.57
## 10 2.85_* 4.84_* -3.76_* -4.62_* -4.67_*
4.98_* 4.99_*
## 11 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 14 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 17 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 19 -5.32_* 6.51_* -7.55_* -7.03_* -6.89_*
6.77_* 6.76_*
## 24 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 26 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 32 -16.58_* 2.58_* -1.27_* -3.10_* -4.40_*
3.76_* 3.76_*
## dfb.x53.4 dfb.x53.8 dfb.x53.90 dfb.x53.91 dfb.x6 dfb.x8
dfb.x9
## 1 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 2 1.12_* 1.11_* 0.91 1.01_* -0.92
2.26_* 1.87_*
## 4 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 8 -1.04_* -1.58_* -1.15_* -1.10_* 1.07_*
2.26_* 1.87_*
## 10 -4.59_* -4.38_* -4.68_* -4.70_* 4.72_* -
4.66_* -8.79_*
## 11 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 14 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 17 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 19 -6.94_* -6.97_* -6.89_* -6.88_* 6.88_* -
7.16_* 1.87_*
## 24 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 26 0.00 0.00 0.00 0.00 0.00 0.00
0.00
## 32 -3.91_* -2.58_* -4.39_* -3.83_* 4.43_*
2.26_* 1.87_*
## dfb.x10 dffit cov.r cook.d hat
## 1 0.00 0.00 NaN 199.91_* 1.00
## 2 -5.98_* 68.16_* 4647.43_* 160.22_* 1.00
## 4 0.00 0.00 NaN 1832.62_* 1.00
## 8 -5.98_* -60.46_* 3656.98_* 126.07_* 1.00
## 10 -5.98_* -12.78 164.31_* 5.63_* 0.99
## 11 0.00 0.00 NaN 4.72_* 0.99
## 14 0.00 0.00 NaN 9886.95_* 1.00
## 17 0.00 0.00 NaN 1949.88_* 1.00
## 19 -5.98_* -11.96 144.02_* 4.93_* 0.99
## 24 0.00 0.00 NaN 5.63_* 0.99
## 26 0.00 0.00 NaN 1832.62_* 1.00
## 32 -5.98_* -237.79_* 56547.41_* 1949.88_* 1.00

You might also like