Learning Log 6 Jacob Cloutier 2/27/18

We start the multiple linear regression process by creating our model and looking at a summary of the model so that we may interpret the results

library(resampledata)
## 
## Attaching package: 'resampledata'
## The following object is masked from 'package:datasets':
## 
##     Titanic
data(Beerwings)
wingsbeer <- Beerwings
modelmod <- lm(Beer~Hotwings + Gender, data = wingsbeer)
summary (modelmod)
## 
## Call:
## lm(formula = Beer ~ Hotwings + Gender, data = wingsbeer)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -16.7854  -5.0496   0.7114   2.7953  18.7114 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   2.5506     3.8125   0.669    0.509    
## Hotwings      2.0839     0.3512   5.934 2.52e-06 ***
## GenderM      -2.4361     3.3042  -0.737    0.467    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.541 on 27 degrees of freedom
## Multiple R-squared:  0.6224, Adjusted R-squared:  0.5945 
## F-statistic: 22.26 on 2 and 27 DF,  p-value: 1.946e-06

From this summary we can interpret quite a bit about our model and see how the variables are interacting at a first glance. Firstly we have our coefficients for our multiple linear regression equation. In this case Beta(0) = 2.5506, Beta(1) for number of hotwings consumed is 2.0839, and Beta(2), for our gender indicator, is -2.4361.

Another thing we can take from the summary is the very low p value found in the bottom right-hand corner. We can tell from this low p value that we can keep this beta in our model and that it does enhance our linear regression. Otherwise the hypothesis that the beta does not enhance anything would be confirmed by a high p value and would lead us to remove it.

Now we can make confidence and predicition intervals for how many wings a person would eat if they had 24 ounces of beer and were a female, as an example.