# Họ và tên: Nguyễn Thị Kim Ly
# Lớp: 24NH
# MSSV: 2454020038
# Bài KTTH

# Nhập liệu:
likert=file.choose()
datalikert=read.csv(likert,header=TRUE)
save(datalikert,file="datalikert.rda")
attach(datalikert)
is.data.frame(datalikert)
## [1] TRUE
# Câu 16
mreg=lm(Ftb~Atb+Btb+Ctb )
summary(mreg)
## 
## Call:
## lm(formula = Ftb ~ Atb + Btb + Ctb)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.73037 -0.44846  0.09795  0.39376  1.34503 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.76022    0.32504   2.339 0.020361 *  
## Atb          0.20139    0.05691   3.539 0.000504 ***
## Btb          0.13162    0.04943   2.663 0.008399 ** 
## Ctb          0.47633    0.04730  10.070  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.5705 on 194 degrees of freedom
## Multiple R-squared:  0.4128, Adjusted R-squared:  0.4038 
## F-statistic: 45.47 on 3 and 194 DF,  p-value: < 2.2e-16
op=par(mfrow=c(2,2))
plot(mreg)

# Nhân xét
# Đồ thị bên trái dòng 1 vẽ phần dư Ei và giá trị dự báo của F^tb, phần dư đ thị này cho thấy các giá trị phần dư quanh đường i=0.