##########################################
## Homework 3
##########################################
Copyright By PowCoder代写 加微信 powcoder
##########################################
## Question 1.
##########################################
rm(list=ls())
##########################################
## Question 2
##########################################
rm(list=ls())
ex1 <- c(79, 92, 81, 80, 79, 80, 78, 88, 86, 88, 77, 93)
ex2 <- c(80, 75, 67, 82, 76, 71, 78, 78, 80, 77, 78, 75)
scores <- data.frame(Exam1 = ex1, Exam2 = ex2)
t.test(??, ??, conf.level = ??, alternative = ??, paired = ??)
# Hence reject the null hypothesis.
##########################################
## Question 3
##########################################
rm(list=ls())
head(mtcars)
# The scatter plot makes clear that the relationship between gross horse power and
# quarter-mile time (seconds) is both negative and (approximately) linear.
plot(??, ??, pch = 19,
xlab = "Gross Horse Power", ylab = "Quarter Mile Time (seconds)")
reg_eq_mtcars <- lm(??, data = mtcars)
??(reg_eq_mtcars)
##########################################
## Question 4
##########################################
rm(list = ls())
#load the data and preprocess
housing.df <- read.csv("./Data/BostonHousing.csv")
head(housing.df)
str(housing.df)
summary(housing.df)
#remove the categorical response variable CAT..MEDV
housing.df <- housing.df[,-c(14)]
# Fill in the corresponding predictors/independent variables
reg <- lm(??, data = housing.df)
# Fill in the corresponding predictors/independent variables
# library(forecast)
pred <- predict(reg, newdata = new)
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com