This is where I introduce something. This bold text, this is emphasized text.
This is a list
1 + 1
## [1] 2
dat <- read.csv("../datafiles/cadata.csv")
summary(dat)
## MedianHouseValue MedianIncome MedianHouseAge TotalRooms
## Min. : 14999 Min. : 0.4999 Min. : 1.00 Min. : 2
## 1st Qu.:119600 1st Qu.: 2.5634 1st Qu.:18.00 1st Qu.: 1448
## Median :179700 Median : 3.5348 Median :29.00 Median : 2127
## Mean :206856 Mean : 3.8707 Mean :28.64 Mean : 2636
## 3rd Qu.:264725 3rd Qu.: 4.7432 3rd Qu.:37.00 3rd Qu.: 3148
## Max. :500001 Max. :15.0001 Max. :52.00 Max. :39320
## TotalBedrooms Population Households Latitude
## Min. : 1.0 Min. : 3 Min. : 1.0 Min. :32.54
## 1st Qu.: 295.0 1st Qu.: 787 1st Qu.: 280.0 1st Qu.:33.93
## Median : 435.0 Median : 1166 Median : 409.0 Median :34.26
## Mean : 537.9 Mean : 1425 Mean : 499.5 Mean :35.63
## 3rd Qu.: 647.0 3rd Qu.: 1725 3rd Qu.: 605.0 3rd Qu.:37.71
## Max. :6445.0 Max. :35682 Max. :6082.0 Max. :41.95
## Longitude
## Min. :-124.3
## 1st Qu.:-121.8
## Median :-118.5
## Mean :-119.6
## 3rd Qu.:-118.0
## Max. :-114.3
hist(dat$MedianIncome, col = "darkorange")
fit <- lm(MedianHouseValue ~ MedianIncome, dat)
summary(fit)
##
## Call:
## lm(formula = MedianHouseValue ~ MedianIncome, data = dat)
##
## Residuals:
## Min 1Q Median 3Q Max
## -540697 -55950 -16979 36978 434023
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 45085.6 1322.9 34.08 <2e-16 ***
## MedianIncome 41793.8 306.8 136.22 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 83740 on 20638 degrees of freedom
## Multiple R-squared: 0.4734, Adjusted R-squared: 0.4734
## F-statistic: 1.856e+04 on 1 and 20638 DF, p-value: < 2.2e-16