---
title: "PSYC 193R: Lecture 14"
output: html_notebook
---

# Multiple Regression

Load the data set
```{r}
# Link: http://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-red.csv

# load data
WineData = read.csv("NA")
```

Factorize / as.numeric variables
```{r}

```

Check for outliers
```{r}
# histograms

```

Check for outliers (linearity)
```{r}

```

Remove Outliers
```{r}
# remove the outliers 

# check for outliers again
```

Correlation Matrix
```{r}

```

Remove Redundant variables
```{r}

```

Build the intercept model and the full model (with 4 variables)
```{r}
# intercept model

# summary of intercept model

# full model

# summary of full model

```

Model comparison
```{r}
anova(NA, NA)
```

Prediction (optional)
```{r}
# build a data frame

# predict the output

```

Post-fit checking
```{r}
# predicted values (DV) from the IV's in the data

# calculate the residuals

# plot residuals vs fitted values
plot()
```

Check for multicollinearity
```{r}
# install / import the "car" package
library(NA)

# calculate the variance inflation factors

```
