getwd()
## [1] "C:/data"
setwd("c:/data")
df<-read.csv("Data1.csv")
attach(swiss)
bs.out3<-lm(Fertility ~Education+Catholic,swiss)
summary(bs.out3)
## 
## Call:
## lm(formula = Fertility ~ Education + Catholic, data = swiss)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -15.042  -6.578  -1.431   6.122  14.322 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 74.23369    2.35197  31.562  < 2e-16 ***
## Education   -0.78833    0.12929  -6.097 2.43e-07 ***
## Catholic     0.11092    0.02981   3.721  0.00056 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8.331 on 44 degrees of freedom
## Multiple R-squared:  0.5745, Adjusted R-squared:  0.5552 
## F-statistic:  29.7 on 2 and 44 DF,  p-value: 6.849e-09
bs.out4<-lm(Fertility ~Education+Catholic+Infant.Mortality,swiss)
summary(bs.out4)
## 
## Call:
## lm(formula = Fertility ~ Education + Catholic + Infant.Mortality, 
##     data = swiss)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -14.4781  -5.4403  -0.5143   4.1568  15.1187 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      48.67707    7.91908   6.147 2.24e-07 ***
## Education        -0.75925    0.11680  -6.501 6.83e-08 ***
## Catholic          0.09607    0.02722   3.530  0.00101 ** 
## Infant.Mortality  1.29615    0.38699   3.349  0.00169 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.505 on 43 degrees of freedom
## Multiple R-squared:  0.6625, Adjusted R-squared:  0.639 
## F-statistic: 28.14 on 3 and 43 DF,  p-value: 3.15e-10