---
title: "Partial Exam"
author: "Lidia Montero"
date: "10 de noviembre de 2016"
output: pdf_document
---

**Problem 1: All qüestions account for 1 point**

Data from a dataset of air pollution in US cities. Seven variables were recorded for 41 cities:

SO2:		 Sulphur dioxide content of air in micrograms per cubic meter
NegTemp: 	Average annual temperature less than -1 Fahrenheit degrees
Manuf:	Number of manufacturing enterprises employing 20 or more workers
Pop: 		Population size (1970 census) in thousands
Wind: 		Average annual wind speed in miles per hour
Precip: 	Average annual precipitation in inches
Days: 		Average number of days with precipitation per year.
Source
Everitt, B.S. (2005), An R and S-PLUS Companion to Multivariate Analysis, Springer


**Load usair.RData file  in your current R or RStudio session **

1.	Pop contains the description of thousands of inhabitants for the cities included in the data set. Create a new factor variable consisting on an indicator for small, medium and large cities (named it f.size). Small cities are those with less than half million inhabitants, medium cities are those in the range from half medium to one millium and a half and large cities have a number of inhabitants greater than one million and a half.
```{r}

```

2.	Our target is defined as SO2. Summarize numerically and graphically the response variable. Make an interpretation of the results. Do you think that SO2 may be considered normally distributed? 
```{r}

```

3.	Calculate the upper threshold to identify severe outliers for SO2. Is there any city satisfying this criteria? Are global outliers retained once city size factor is considered?
```{r}

```

4.	Which are the numerical variables statistically associated with the response (SO2)? Indicate the suitable measure of association and/or tests that support your answer. Assess linearity association to SO2 for available variables. 
```{r}

```

5.	Describe the profile for the SO2 numeric target using the tools available in FactoMineR package.
```{r}

```

6.	The average SO2 in the cities can be argued to be the same for all city size levels (f.size)? Which are the groups that show a significant greater average SO2 than the others?
```{r}

```

7.	The variance of SO2 in the cities can be argued to be the same for all city size levels (f.size)? Which are the groups that are likely to have a greater dispersion of SO2 than the others?
```{r}

```

8.	Consider a multiple regression model (m1) for target SO2 on all numeric variables in the dataset. Assess the quality of the model. 
```{r}

```

9.	Consider model (m1), check significance for all variables. 
```{r}

```

10.	Assess default residual plots in R for model (m1): are there any atypical residuals? Which one/s?
```{r}

```

11.	For your model, determine the presence of outliers in residuals. Specify city names, selected criteria and behavioral discrepancy.
```{r}

```

12.	For your final model, determine the presence of actual influent data. Specify city names, selected criteria and behavior.
```{r}

```



