Creating Blocked Designs with multiple factors (Effects Model)

1. Setting

System under test

Q1. The Research Question: Study the effect of three factors (Transmission,drive and number of cylinders) on the city mileage of a vehicle (response variable). In order to study this problem we can formulate the null hypothesis as:

‘The variance in the type of transmission, the type of drive and the number of cylinders used in a vehicle (taken separately-main effect or two/three at a time-interaction effect) has no significant impact on the variance of its city mileage’

The alternate hypothesis is therefore stated as:‘The variance in 3 factors namely transmission, drive and number of cylinders(either one taken alone or an interaction between any two/three of them) has a significant effect on the variance in city mileage’

Q2. Null Hypothesis: ‘The variability in the city mileage cannot be explained only by randomization and it has a significant impact of the factor ’year’ on it’

Data Extraction

install.packages("fueleconomy", repos='http://cran.us.r-project.org')
## Installing package into 'C:/Users/uzma/Documents/R/win-library/3.1'
## (as 'lib' is unspecified)
## package 'fueleconomy' successfully unpacked and MD5 sums checked
## 
## The downloaded binary packages are in
##  C:\Users\uzma\AppData\Local\Temp\Rtmp2bBuvE\downloaded_packages
library("fueleconomy", lib.loc="C:\\Users\\uzma\\Documents\\R\\win-library\\3.1")
## Warning: package 'fueleconomy' was built under R version 3.1.2
x<-vehicles
head(x)
##      id       make               model year                       class
## 1 27550 AM General   DJ Po Vehicle 2WD 1984 Special Purpose Vehicle 2WD
## 2 28426 AM General   DJ Po Vehicle 2WD 1984 Special Purpose Vehicle 2WD
## 3 27549 AM General    FJ8c Post Office 1984 Special Purpose Vehicle 2WD
## 4 28425 AM General    FJ8c Post Office 1984 Special Purpose Vehicle 2WD
## 5  1032 AM General Post Office DJ5 2WD 1985 Special Purpose Vehicle 2WD
## 6  1033 AM General Post Office DJ8 2WD 1985 Special Purpose Vehicle 2WD
##             trans            drive cyl displ    fuel hwy cty
## 1 Automatic 3-spd    2-Wheel Drive   4   2.5 Regular  17  18
## 2 Automatic 3-spd    2-Wheel Drive   4   2.5 Regular  17  18
## 3 Automatic 3-spd    2-Wheel Drive   6   4.2 Regular  13  13
## 4 Automatic 3-spd    2-Wheel Drive   6   4.2 Regular  13  13
## 5 Automatic 3-spd Rear-Wheel Drive   4   2.5 Regular  17  16
## 6 Automatic 3-spd Rear-Wheel Drive   6   4.2 Regular  13  13

Technique for Hypothesis Testing

We use ANOVA (Analysis of Variance) with blocking (for Q1) and without blocking (for Q2) to test our hypothesis. The significance level is (alpha) 0.05.

Factors and Levels

There are three factors of interest : Transmission,drive and number of cylinders. However we perform some preliminary analysis to see which factors to ‘block’ on since there are various other independent variables (factors) that can have an effect on the response variable.However, we are interested in only the above mentioned factors therefore all other independent variables are treated as nuisance variables. These can be blocked since their effect on the response variable is known and controllable.Each factor (independent variable) has several levels and we consider all levels for this experiment.

Preliminary testing

We have a total of 35000 records and through randomly selecting samples from the original dataset(2000 records at a time) we test the null hypothesis. By repeatedly selecting random samples from the same data set we can draw inferences and report our final results/conclusion (accepting or rejecting the null hypothesis).

The limitation of this model is the time taken for repeated runs. However, we are unable to use any of the existing resampling techniques for our experiment because it is a multiple factor ANOVA and existing techniques like bootstrapping can handle only one factor at a time. Our goal is a multivariate analysis therefore we are repeatedly selecting random samples from the data set and carrying out the entire analysis to derive final conclusions.

Deciding on blocking variables:

#L<-x[sample(1:nrow(x),2000,replace=FALSE),]

L<-x[1:1000,]

L$make=as.factor(L$make)

L$year=as.factor(L$year)

L$fuel=as.factor(L$fuel)

L$trans=as.factor(L$trans)

L$cyl=as.factor(L$cyl)

L$drive=as.factor(L$drive)


#Boxplots for preliminary analysis only

boxplot(cty~make,data=L ,xlab="Make of the vehicle", ylab="city mileage (MPG)")
title("Boxplot 'Make'")

boxplot(cty~year,data=L,xlab="Year", ylab="city mileage (MPG)")
title("Boxplot 'Year'")

boxplot(cty~fuel,data=L,xlab="Fuel Type", ylab="city mileage (MPG)")
title("Boxplot 'Fuel'")

From the above box-plots it is clear that the within group variation in most levels for the variables ‘Make’ and ‘Fuel’ is quite less as compared to the variation between levels. Therefore these seem to be good candidates for blocking(controlling the known variability due to nuisance variables), given our requirement of focussing on three factors only (stated above).

Data Summary

Here is a sumary of the data set used:

str(L)
## Classes 'tbl_df', 'tbl' and 'data.frame':    1000 obs. of  12 variables:
##  $ id   : int  27550 28426 27549 28425 1032 1033 3347 13309 13310 13311 ...
##  $ make : Factor w/ 7 levels "Acura","Alfa Romeo",..: 3 3 3 3 3 3 5 1 1 1 ...
##  $ model: chr  "DJ Po Vehicle 2WD" "DJ Po Vehicle 2WD" "FJ8c Post Office" "FJ8c Post Office" ...
##  $ year : Factor w/ 32 levels "1984","1985",..: 1 1 1 1 2 2 4 14 14 14 ...
##  $ class: chr  "Special Purpose Vehicle 2WD" "Special Purpose Vehicle 2WD" "Special Purpose Vehicle 2WD" "Special Purpose Vehicle 2WD" ...
##  $ trans: Factor w/ 19 levels "Auto(AM-S6)",..: 13 13 13 13 13 13 14 14 18 14 ...
##  $ drive: Factor w/ 5 levels "2-Wheel Drive",..: 1 1 1 1 5 5 5 4 4 4 ...
##  $ cyl  : Factor w/ 5 levels "4","5","6","8",..: 1 1 3 3 1 3 3 1 1 3 ...
##  $ displ: num  2.5 2.5 4.2 4.2 2.5 4.2 3.8 2.2 2.2 3 ...
##  $ fuel : Factor w/ 4 levels "Diesel","Premium",..: 4 4 4 4 4 4 2 4 4 4 ...
##  $ hwy  : int  17 17 13 13 17 13 21 26 28 26 ...
##  $ cty  : int  18 18 13 13 16 13 14 20 22 18 ...
head(L)
##      id       make               model year                       class
## 1 27550 AM General   DJ Po Vehicle 2WD 1984 Special Purpose Vehicle 2WD
## 2 28426 AM General   DJ Po Vehicle 2WD 1984 Special Purpose Vehicle 2WD
## 3 27549 AM General    FJ8c Post Office 1984 Special Purpose Vehicle 2WD
## 4 28425 AM General    FJ8c Post Office 1984 Special Purpose Vehicle 2WD
## 5  1032 AM General Post Office DJ5 2WD 1985 Special Purpose Vehicle 2WD
## 6  1033 AM General Post Office DJ8 2WD 1985 Special Purpose Vehicle 2WD
##             trans            drive cyl displ    fuel hwy cty
## 1 Automatic 3-spd    2-Wheel Drive   4   2.5 Regular  17  18
## 2 Automatic 3-spd    2-Wheel Drive   4   2.5 Regular  17  18
## 3 Automatic 3-spd    2-Wheel Drive   6   4.2 Regular  13  13
## 4 Automatic 3-spd    2-Wheel Drive   6   4.2 Regular  13  13
## 5 Automatic 3-spd Rear-Wheel Drive   4   2.5 Regular  17  16
## 6 Automatic 3-spd Rear-Wheel Drive   6   4.2 Regular  13  13
tail(L)
##         id make     model year                           class
## 995  33967 Audi        Q5 2014 Small Sport Utility Vehicle 4WD
## 996  33301 Audi Q5 Hybrid 2013 Small Sport Utility Vehicle 4WD
## 997  33873 Audi Q5 Hybrid 2014 Small Sport Utility Vehicle 4WD
## 998  22987 Audi        Q7 2007     Sport Utility Vehicle - 4WD
## 999  23402 Audi        Q7 2007     Sport Utility Vehicle - 4WD
## 1000 24108 Audi        Q7 2008     Sport Utility Vehicle - 4WD
##               trans                      drive cyl displ    fuel hwy cty
## 995  Automatic (S8)            All-Wheel Drive   6   3.0  Diesel  31  24
## 996  Automatic (S8)            All-Wheel Drive   4   2.0 Premium  30  24
## 997  Automatic (S8)            All-Wheel Drive   4   2.0 Premium  30  24
## 998  Automatic (S6) 4-Wheel or All-Wheel Drive   8   4.2 Premium  17  12
## 999  Automatic (S6) 4-Wheel or All-Wheel Drive   6   3.6 Premium  18  14
## 1000 Automatic (S6) 4-Wheel or All-Wheel Drive   6   3.6 Premium  20  14
summary(L)
##        id                                 make        model          
##  Min.   :    1   Acura                      :269   Length:1000       
##  1st Qu.:11789   Alfa Romeo                 : 39   Class :character  
##  Median :18759   AM General                 :  6   Mode  :character  
##  Mean   :18957   American Motors Corporation: 27                     
##  3rd Qu.:27588   ASC Incorporated           :  1                     
##  Max.   :34931   Aston Martin               :112                     
##                  Audi                       :546                     
##       year        class                       trans    
##  2013   : 46   Length:1000        Manual 5-spd   :215  
##  2014   : 46   Class :character   Automatic (S6) :151  
##  2005   : 45   Mode  :character   Manual 6-spd   :137  
##  2012   : 43                      Automatic 4-spd:118  
##  2003   : 42                      Automatic (S5) :112  
##  2008   : 41                      Automatic 3-spd: 66  
##  (Other):737                      (Other)        :201  
##                         drive     cyl          displ      
##  2-Wheel Drive             :  4   4 :306   Min.   :1.500  
##  4-Wheel or All-Wheel Drive:302   5 : 96   1st Qu.:2.000  
##  All-Wheel Drive           :122   6 :433   Median :2.800  
##  Front-Wheel Drive         :403   8 : 97   Mean   :3.022  
##  Rear-Wheel Drive          :169   12: 68   3rd Qu.:3.500  
##                                            Max.   :6.300  
##                                                           
##              fuel          hwy             cty       
##  Diesel        :  9   Min.   : 9.00   Min.   : 7.00  
##  Premium       :742   1st Qu.:22.00   1st Qu.:16.00  
##  Premium or E85:  8   Median :24.00   Median :17.00  
##  Regular       :241   Mean   :24.03   Mean   :17.12  
##                       3rd Qu.:27.00   3rd Qu.:19.00  
##                       Max.   :42.00   Max.   :39.00  
## 

Continuous variables

The response variable i.e. city mileage is a continuous variable. Also, highway mileage for each vehicle is continuous.

Response variables

City mileage (cty) measured in MPG (miles per gallon) is the only response variable.

The Data: How is it organized and what does it look like?

The given data set is the fuel economy data from the EPA. It ranges from the year 1985 to 2015 for various car models and each row has a detailed specification of the vehicle. There are 74 variables and 34632 records in the original data set.

Randomization

We can safely assume the data to be randomized because it is a result of vehicle testing done at the Environmental Protection Agency National Vehicle and Fuel Emissions Laboratory. Since almost every vehicle needs to clear this testing therefore data is a true representative of the population as a whole.Due to this assumption of randomization for survey data we do not need to randomize it using any of the re-sampling techniques (e.g. bootstrapping).

2. (Experimental) Design

How will the experiment be organized and conducted to test the hypothesis?

This is a three factor ANOVA (analysis of variance) experiment.We conduct a main effects test and an interaction effect test for all three variables (factors) in order to test the variability in the response variable as a result of the variablity in the 3 identified factors. Since there are various other independent variables present in the data set, that may have an effect on the response variable therefore we use blocking on two variables (fuel type used and make of the car)and test the within group/block variability for the factors of interest only.Through blocking we tend to minimize the effect of these nuisance variables and thus able to control their effect on the final response.

Rationale for this design

If we are able to determine the within group and between group variability on the performance of a vehicle based on certain factors, then that can be a useful study for performance enhancement.

Randomization Scheme

It is a completely randomized design, given that it is survey data.

Replicates

There are no repeated measures since we are using data from a study conducted by EPA.

3. (Statistical) Analysis

(Exploratory Data Analysis) Graphics and descriptive summary

#Create a histogram 

par(mfrow=c(1,1))

hist(L$cty, xlim=c(0,80), ylab = "City Mileage (MPG)")

# Boxplots for the 3 factors

boxplot(cty~trans,data=L,xlab="Transmission", ylab="city mileage (MPG)")
title("Boxplot 'Transmission'")

boxplot(cty~cyl,data=L,xlab="Number of cylinders", ylab="city mileage (MPG)")
title("Boxplot 'Number of cylinders'")

boxplot(cty~drive,data=L,xlab="Type of drive", ylab="city mileage (MPG)")
title("Boxplot 'Drive type'")

Testing

We test our stated hypothesis using Analysis of variance (ANOVA). This is a two way ANOVA test through which we intend to see the effect of the factors on the response variable and also ascertain the interaction between different factors.

Analysis of variance for the factor cylinder within the each block

# Testing for Q1

modelcylf=aov(cty~(cyl)+fuel,data=L)
anova(modelcylf)
## Analysis of Variance Table
## 
## Response: cty
##            Df Sum Sq Mean Sq F value    Pr(>F)    
## cyl         4 7727.5 1931.88 539.129 < 2.2e-16 ***
## fuel        3  757.4  252.48  70.458 < 2.2e-16 ***
## Residuals 992 3554.7    3.58                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
modelcylm=aov(cty~(cyl)+make,data=L)
anova(modelcylm)
## Analysis of Variance Table
## 
## Response: cty
##            Df Sum Sq Mean Sq F value    Pr(>F)    
## cyl         4 7727.5 1931.88 559.000 < 2.2e-16 ***
## make        6  894.2  149.03  43.121 < 2.2e-16 ***
## Residuals 989 3417.9    3.46                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Analysis of variance for the factor transmission within each block

modeltrf=aov(cty~(trans)+fuel,data=L)
anova(modeltrf)
## Analysis of Variance Table
## 
## Response: cty
##            Df Sum Sq Mean Sq F value    Pr(>F)    
## trans      18 3001.2 166.732  19.437 < 2.2e-16 ***
## fuel        3  649.2 216.399  25.227 1.004e-15 ***
## Residuals 978 8389.2   8.578                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
modeltrm=aov(cty~(trans)+make,data=L)
anova(modeltrm)
## Analysis of Variance Table
## 
## Response: cty
##            Df Sum Sq Mean Sq F value    Pr(>F)    
## trans      18 3001.2  166.73  34.435 < 2.2e-16 ***
## make        6 4317.6  719.60 148.619 < 2.2e-16 ***
## Residuals 975 4720.8    4.84                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Analysis of variance for the factor drive within each block

modeldrf=aov(cty~(drive)+fuel,data=L)
anova(modeldrf)
## Analysis of Variance Table
## 
## Response: cty
##            Df Sum Sq Mean Sq F value    Pr(>F)    
## drive       4 4969.4 1242.36 190.259 < 2.2e-16 ***
## fuel        3  592.6  197.52  30.248 < 2.2e-16 ***
## Residuals 992 6477.6    6.53                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
modeldrm=aov(cty~(drive)+make,data=L)
anova(modeldrm)
## Analysis of Variance Table
## 
## Response: cty
##            Df Sum Sq Mean Sq F value    Pr(>F)    
## drive       4 4969.4 1242.36 206.814 < 2.2e-16 ***
## make        6 1129.1  188.19  31.327 < 2.2e-16 ***
## Residuals 989 5941.0    6.01                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Analysis of variance for all the factors:cylinder,drive and transmission within each block and also for both the blocking variables taken together

modelallf=aov(cty~(cyl*trans*drive)+fuel,data=L)
anova(modelallf)
## Analysis of Variance Table
## 
## Response: cty
##                  Df Sum Sq Mean Sq   F value    Pr(>F)    
## cyl               4 7727.5 1931.88 2262.4429 < 2.2e-16 ***
## trans            18 1817.6  100.98  118.2558 < 2.2e-16 ***
## drive             4  668.7  167.16  195.7666 < 2.2e-16 ***
## fuel              3  399.7  133.22  156.0115 < 2.2e-16 ***
## cyl:trans        22  450.0   20.45   23.9546 < 2.2e-16 ***
## cyl:drive         9   53.5    5.94    6.9557 9.429e-10 ***
## trans:drive      12   88.9    7.41    8.6749 8.168e-16 ***
## cyl:trans:drive   7   48.3    6.90    8.0759 1.484e-09 ***
## Residuals       920  785.6    0.85                        
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
modelallm=aov(cty~(cyl*trans*drive)+make,data=L)
anova(modelallm)
## Analysis of Variance Table
## 
## Response: cty
##                  Df Sum Sq Mean Sq   F value    Pr(>F)    
## cyl               4 7727.5 1931.88 1825.4362 < 2.2e-16 ***
## trans            18 1817.6  100.98   95.4138 < 2.2e-16 ***
## drive             4  668.7  167.16  157.9529 < 2.2e-16 ***
## make              6  301.4   50.23   47.4656 < 2.2e-16 ***
## cyl:trans        22  323.5   14.70   13.8938 < 2.2e-16 ***
## cyl:drive         9   53.2    5.91    5.5883 1.556e-07 ***
## trans:drive      12  138.5   11.54   10.9036 < 2.2e-16 ***
## cyl:trans:drive   7   38.8    5.54    5.2359 7.140e-06 ***
## Residuals       917  970.5    1.06                        
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Both blocking variables taken together

modelall=aov(cty~(cyl*trans*drive)+make+fuel,data=L)
anova(modelall)
## Analysis of Variance Table
## 
## Response: cty
##                  Df Sum Sq Mean Sq   F value    Pr(>F)    
## cyl               4 7727.5 1931.88 2629.5760 < 2.2e-16 ***
## trans            18 1817.6  100.98  137.4455 < 2.2e-16 ***
## drive             4  668.7  167.16  227.5342 < 2.2e-16 ***
## make              6  301.4   50.23   68.3752 < 2.2e-16 ***
## fuel              3  417.0  139.01  189.2076 < 2.2e-16 ***
## cyl:trans        22  259.4   11.79   16.0523 < 2.2e-16 ***
## cyl:drive         9   39.9    4.44    6.0412 2.902e-08 ***
## trans:drive      12   93.4    7.78   10.5963 < 2.2e-16 ***
## cyl:trans:drive   7   43.1    6.16    8.3855 5.854e-10 ***
## Residuals       914  671.5    0.73                        
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Testing for Q2. Effect of year on mileage

modelQ2=aov(cty~year,data=L)
anova(modelQ2)
## Analysis of Variance Table
## 
## Response: cty
##            Df  Sum Sq Mean Sq F value    Pr(>F)    
## year       31  1400.4  45.173    4.11 1.187e-12 ***
## Residuals 968 10639.2  10.991                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results

Q1. The results from ANOVA show that both the blocking variables have very small p-values conforming that these are valid blocking variables.
For the hypothesis testing, we see that (for our sample) there is a significant effect of all three factors in all the blocks (separate blocks or an interaction of both blocks)on the response variable. A low p value (less than 0.5) indicates that the variation in city gas mileage is caused by something other than randomization alone (so the factors have a main and interaction effect on the response variable).In conclusion we reject the null hypothesis.

Q2. For answering this question we do not use blocking as a technique.From the Analysis of variance (ANOVA) results we can see that the p-value is much less than our level of significance (alpha=0.05) so we reject the null hypothesis. In conclusion there is a significant effect of the factor year on the response variable ‘city mileage’.

Diagnostics/Model Adequacy Checking

In this section we check the adequacy of the ANOVA model.The assumptions that undelie the analysis of variance are: normality,homogeniety of variances,homogeneity of regression slopes, linearity of regression, Independence of error terms.

Model adequacy checking is done to test the validity of ANOVA given the numerous assumptions it is based on.

The shapiro test evaluates the Null hypothesis such that “the samples come from a Normal distribution” against the alternative hypothesis “the samples do not come from a Normal distribution”.

The Q-Q Norm plots also test the normality of the sample. The scatter plots of the residuals and the fitted model will check the distribution of the model over the entire dynamic range.

We also fit a model with different slopes for each factor level.

# Shapiro Test

shapiro.test(L$cty)
## 
##  Shapiro-Wilk normality test
## 
## data:  L$cty
## W = 0.9478, p-value < 2.2e-16
#Diagnostics for the main effect under blocking factor fuel

#Number of cylinders

qqnorm(residuals(modelcylf),main="Normal Q-Q Plot for no. of cylinders-Fuel type blocked",ylab="Residuals-City mileage (MPG)")

qqline(residuals(modelcylf))

plot(fitted(modelcylf),residuals(modelcylf))

#Transmission type

qqnorm(residuals(modeltrf),main="Normal Q-Q Plot for transmission type-Fuel type blocked",ylab="Residuals-City mileage (MPG)")

qqline(residuals(modeltrf))

plot(fitted(modeltrf),residuals(modeltrf))

#Drive type

qqnorm(residuals(modeldrf),main="Normal Q-Q Plot for drive type-Fuel type blocked",ylab="Residuals-City mileage (MPG)")

qqline(residuals(modeldrf))

plot(fitted(modeldrf),residuals(modeldrf))

#Diagnostics for the main effect under blocking factor make

#Number of cylinders

qqnorm(residuals(modelcylm),main="Normal Q-Q Plot for no. of cylinders-Make type blocked",ylab="Residuals-City mileage (MPG)")

qqline(residuals(modelcylm))

plot(fitted(modelcylm),residuals(modelcylm))

#Transmission type

qqnorm(residuals(modeltrm),main="Normal Q-Q Plot for transmission type-Make type blocked",ylab="Residuals-City mileage (MPG)")

qqline(residuals(modeltrm))

plot(fitted(modeltrm),residuals(modeltrm))

#Drive type

qqnorm(residuals(modeldrm),main="Normal Q-Q Plot for drive type-Make type blocked",ylab="Residuals-City mileage (MPG)")

qqline(residuals(modeldrm))

plot(fitted(modeldrm),residuals(modeldrm))

#Diagnostics for the interaction effect when blocked by factor fuel

qqnorm(residuals(modelallf),main="Normal Q-Q Plot for Interaction-Fuel type blocked",ylab="Residuals-City mileage (MPG)")
qqline(residuals(modelallf))

plot(fitted(modelallf),residuals(modelallf))

#Diagnostics for the interaction effect when blocked by factor make

qqnorm(residuals(modelallm),main="Normal Q-Q Plot for Interaction- Make blocked",ylab="Residuals-City mileage (MPG)")

qqline(residuals(modelallm))

plot(fitted(modelallm),residuals(modelallm))

# Blocking

qqnorm(residuals(modelall),main="Normal Q-Q Plot for Interaction- Make and fuel blocked",ylab="Residuals-City mileage (MPG)")

qqline(residuals(modelall))

plot(fitted(modelall),residuals(modelall))

# Model for Q2

qqnorm(residuals(modelQ2),main="Normal Q-Q Plot for effect of year on city mileage",ylab="Residuals-City mileage (MPG)")

qqline(residuals(modelQ2))

plot(fitted(modelQ2),residuals(modelQ2))

#Interaction plots

interaction.plot(L$cyl,L$trans,L$cty, xlab= "Number of cylinders", ylab="City Mileage(MPG)", main ="Interaction plot", trace.label="Transmission type")

interaction.plot(L$cyl,L$drive,L$cty, xlab= "Number of cylinders", ylab="City Mileage(MPG)", main ="Interaction plot", trace.label="Type of drive")

interaction.plot(L$drive,L$trans,L$cty, xlab= "Type of drive", ylab="City Mileage(MPG)", main ="Interaction plot", trace.label="Transmission type")

Results

Shapiro test gives a value of p which is less than 0.1. This shows that the data is normally distributed.

Normal Q-Q Plots:All the Normal Q-Q plots confirm to the assumption of normality. There are a few deviations from the normality (for the factor-Number of cylinders). However, for most other factors as well as their interaction plots are normal for most of the data.

Scatter plots: Since the scatter plots for the residuals of ‘transmission type’ and ‘type of drive’ show some skewedness in both blocks, we can say that this model could be biased.However the residuals for the interaction model do not show any specific patterns so we can say it is a reasonable fit. The plots do depict the presence of some outliers but the data can be considered appropriate for 3-way Annova.

Interaction Plots: As expected, we can see interaction between various levels of all the factors (2 at a time).

Tukey’s test

In order to avoid the chances of discovering false positives in a multivariate statistical test we further perform a Tukey’s HSD test.We use this test to compare means of various treatment levels.

# Number of cylinders
TukeyHSD(modelcylf, ordered = FALSE, conf.level = 0.95)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = cty ~ (cyl) + fuel, data = L)
## 
## $cyl
##            diff         lwr        upr     p adj
## 5-4  -4.3972631  -5.0024201 -3.7921060 0.0000000
## 6-4  -4.1981917  -4.5845310 -3.8118523 0.0000000
## 8-4  -7.2457382  -7.8485161 -6.6429602 0.0000000
## 12-4 -9.3611111 -10.0546519 -8.6675703 0.0000000
## 6-5   0.1990714  -0.3845076  0.7826504 0.8843825
## 8-5  -2.8484751  -3.5932217 -2.1037284 0.0000000
## 12-5 -4.9638480  -5.7837902 -4.1439058 0.0000000
## 8-6  -3.0475465  -3.6286580 -2.4664349 0.0000000
## 12-6 -5.1629194  -5.8377144 -4.4881245 0.0000000
## 12-8 -2.1153730  -2.9335608 -1.2971851 0.0000000
## 
## $fuel
##                              diff        lwr       upr     p adj
## Premium-Diesel         -8.2000459  -9.833647 -6.566445 0.0000000
## Premium or E85-Diesel  -8.9989954 -11.366045 -6.631945 0.0000000
## Regular-Diesel         -8.8930412 -10.546866 -7.239217 0.0000000
## Premium or E85-Premium -0.7989494  -2.530491  0.932592 0.6349776
## Regular-Premium        -0.6929952  -1.054168 -0.331822 0.0000055
## Regular-Premium or E85  0.1059542  -1.644680  1.856588 0.9986543
TukeyHSD(modelcylm, ordered = FALSE, conf.level = 0.95)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = cty ~ (cyl) + make, data = L)
## 
## $cyl
##            diff         lwr        upr     p adj
## 5-4  -4.3972631  -4.9915701 -3.8029560 0.0000000
## 6-4  -4.1981917  -4.5776043 -3.8187791 0.0000000
## 8-4  -7.2457382  -7.8377087 -6.6537676 0.0000000
## 12-4 -9.3611111 -10.0422173 -8.6800049 0.0000000
## 6-5   0.1990714  -0.3740445  0.7721873 0.8774327
## 8-5  -2.8484751  -3.5798690 -2.1170812 0.0000000
## 12-5 -4.9638480  -5.7690893 -4.1586068 0.0000000
## 8-6  -3.0475465  -3.6182392 -2.4768538 0.0000000
## 12-6 -5.1629194  -5.8256159 -4.5002230 0.0000000
## 12-8 -2.1153730  -2.9188914 -1.3118545 0.0000000
## 
## $make
##                                                     diff        lwr
## Alfa Romeo-Acura                             -1.56792095 -2.5089918
## AM General-Acura                             -3.92268486 -6.1897813
## American Motors Corporation-Acura            -1.93786804 -3.0466426
## ASC Incorporated-Acura                       -2.99025569 -8.4927697
## Aston Martin-Acura                           -1.92104284 -2.5386791
## Audi-Acura                                   -0.24532314 -0.6544536
## AM General-Alfa Romeo                        -2.35476391 -4.7633033
## American Motors Corporation-Alfa Romeo       -0.36994708 -1.7449803
## ASC Incorporated-Alfa Romeo                  -1.42233474 -6.9846181
## Aston Martin-Alfa Romeo                      -0.35312189 -1.3743025
## Audi-Alfa Romeo                               1.32259781  0.4122555
## American Motors Corporation-AM General        1.98481682 -0.4940596
## ASC Incorporated-AM General                   0.93242917 -4.9999488
## Aston Martin-AM General                       2.00164202 -0.2998623
## Audi-AM General                               3.67736171  1.4228473
## ASC Incorporated-American Motors Corporation -1.05238765 -6.6454872
## Aston Martin-American Motors Corporation      0.01682519 -1.1607047
## Audi-American Motors Corporation              1.69254489  0.6097292
## Aston Martin-ASC Incorporated                 1.06921285 -4.4475667
## Audi-ASC Incorporated                         2.74493254 -2.7524095
## Audi-Aston Martin                             1.67571970  1.1059976
##                                                      upr     p adj
## Alfa Romeo-Acura                             -0.62685008 0.0000207
## AM General-Acura                             -1.65558839 0.0000079
## American Motors Corporation-Acura            -0.82909348 0.0000061
## ASC Incorporated-Acura                        2.51225836 0.6788301
## Aston Martin-Acura                           -1.30340662 0.0000000
## Audi-Acura                                    0.16380727 0.5677227
## AM General-Alfa Romeo                         0.05377545 0.0602090
## American Motors Corporation-Alfa Romeo        1.00508617 0.9854820
## ASC Incorporated-Alfa Romeo                   4.13994864 0.9888856
## Aston Martin-Alfa Romeo                       0.66805876 0.9490877
## Audi-Alfa Romeo                               2.23294011 0.0003882
## American Motors Corporation-AM General        4.46369327 0.2144525
## ASC Incorporated-AM General                   6.86480713 0.9992505
## Aston Martin-AM General                       4.30314629 0.1365438
## Audi-AM General                               5.93187610 0.0000343
## ASC Incorporated-American Motors Corporation  4.54071193 0.9979211
## Aston Martin-American Motors Corporation      1.19435504 1.0000000
## Audi-American Motors Corporation              2.77536055 0.0000894
## Aston Martin-ASC Incorporated                 6.58599238 0.9975465
## Audi-ASC Incorporated                         8.24227460 0.7596461
## Audi-Aston Martin                             2.24544175 0.0000000
# Drive type
TukeyHSD(modeldrf, ordered = FALSE, conf.level = 0.95)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = cty ~ (drive) + fuel, data = L)
## 
## $drive
##                                                     diff         lwr
## 4-Wheel or All-Wheel Drive-2-Wheel Drive      0.77814570 -2.73654219
## All-Wheel Drive-2-Wheel Drive                 3.44262295 -0.10579591
## Front-Wheel Drive-2-Wheel Drive               3.47022333 -0.03870263
## Rear-Wheel Drive-2-Wheel Drive               -2.56508876 -6.09780879
## All-Wheel Drive-4-Wheel or All-Wheel Drive    2.66447726  1.91534403
## Front-Wheel Drive-4-Wheel or All-Wheel Drive  2.69207763  2.16058398
## Rear-Wheel Drive-4-Wheel or All-Wheel Drive  -3.34323445 -4.01408094
## Front-Wheel Drive-All-Wheel Drive             0.02760037 -0.69401658
## Rear-Wheel Drive-All-Wheel Drive             -6.00771171 -6.83733845
## Rear-Wheel Drive-Front-Wheel Drive           -6.03531208 -6.67528509
##                                                     upr     p adj
## 4-Wheel or All-Wheel Drive-2-Wheel Drive      4.2928336 0.9743129
## All-Wheel Drive-2-Wheel Drive                 6.9910418 0.0622105
## Front-Wheel Drive-2-Wheel Drive               6.9791493 0.0542589
## Rear-Wheel Drive-2-Wheel Drive                0.9676313 0.2743922
## All-Wheel Drive-4-Wheel or All-Wheel Drive    3.4136105 0.0000000
## Front-Wheel Drive-4-Wheel or All-Wheel Drive  3.2235713 0.0000000
## Rear-Wheel Drive-4-Wheel or All-Wheel Drive  -2.6723880 0.0000000
## Front-Wheel Drive-All-Wheel Drive             0.7492173 0.9999730
## Rear-Wheel Drive-All-Wheel Drive             -5.1780850 0.0000000
## Rear-Wheel Drive-Front-Wheel Drive           -5.3953391 0.0000000
## 
## $fuel
##                              diff         lwr        upr     p adj
## Premium-Diesel         -7.7129575  -9.9181886 -5.5077264 0.0000000
## Premium or E85-Diesel  -6.6543998  -9.8497287 -3.4590710 0.0000006
## Regular-Diesel         -8.0312332 -10.2637646 -5.7987018 0.0000000
## Premium or E85-Premium  1.0585577  -1.2788853  3.3960007 0.6488618
## Regular-Premium        -0.3182756  -0.8058306  0.1692794 0.3348503
## Regular-Premium or E85 -1.3768333  -3.7400498  0.9863832 0.4382829
TukeyHSD(modeldrm, ordered = FALSE, conf.level = 0.95)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = cty ~ (drive) + make, data = L)
## 
## $drive
##                                                     diff         lwr
## 4-Wheel or All-Wheel Drive-2-Wheel Drive      0.77814570 -2.59295004
## All-Wheel Drive-2-Wheel Drive                 3.44262295  0.03917431
## Front-Wheel Drive-2-Wheel Drive               3.47022333  0.10465412
## Rear-Wheel Drive-2-Wheel Drive               -2.56508876 -5.95347994
## All-Wheel Drive-4-Wheel or All-Wheel Drive    2.66447726  1.94594978
## Front-Wheel Drive-4-Wheel or All-Wheel Drive  2.69207763  2.18229809
## Rear-Wheel Drive-4-Wheel or All-Wheel Drive  -3.34323445 -3.98667358
## Front-Wheel Drive-All-Wheel Drive             0.02760037 -0.66453501
## Rear-Wheel Drive-All-Wheel Drive             -6.00771171 -6.80344415
## Rear-Wheel Drive-Front-Wheel Drive           -6.03531208 -6.64913907
##                                                     upr     p adj
## 4-Wheel or All-Wheel Drive-2-Wheel Drive      4.1492414 0.9700847
## All-Wheel Drive-2-Wheel Drive                 6.8460716 0.0458597
## Front-Wheel Drive-2-Wheel Drive               6.8357925 0.0394827
## Rear-Wheel Drive-2-Wheel Drive                0.8233024 0.2345218
## All-Wheel Drive-4-Wheel or All-Wheel Drive    3.3830047 0.0000000
## Front-Wheel Drive-4-Wheel or All-Wheel Drive  3.2018572 0.0000000
## Rear-Wheel Drive-4-Wheel or All-Wheel Drive  -2.6997953 0.0000000
## Front-Wheel Drive-All-Wheel Drive             0.7197358 0.9999682
## Rear-Wheel Drive-All-Wheel Drive             -5.2119793 0.0000000
## Rear-Wheel Drive-Front-Wheel Drive           -5.4214851 0.0000000
## 
## $make
##                                                     diff          lwr
## Alfa Romeo-Acura                              1.28981138   0.04909651
## AM General-Acura                              0.01459983  -2.97435710
## American Motors Corporation-Acura            -0.48894582  -1.95076249
## ASC Incorporated-Acura                        0.55799233  -6.69656333
## Aston Martin-Acura                           -2.31700767  -3.13130387
## Audi-Acura                                   -0.52259755  -1.06199814
## AM General-Alfa Romeo                        -1.27521155  -4.45064784
## American Motors Corporation-Alfa Romeo       -1.77875721  -3.59161132
## ASC Incorporated-Alfa Romeo                  -0.73181905  -8.06517504
## Aston Martin-Alfa Romeo                      -3.60681905  -4.95315125
## Audi-Alfa Romeo                              -1.81240893  -3.01261104
## American Motors Corporation-AM General       -0.50354565  -3.77171489
## ASC Incorporated-AM General                   0.54339250  -7.27789896
## Aston Martin-AM General                      -2.33160750  -5.36592794
## Audi-AM General                              -0.53719738  -3.50956600
## ASC Incorporated-American Motors Corporation  1.04693816  -6.32704615
## Aston Martin-American Motors Corporation     -1.82806184  -3.38052600
## Audi-American Motors Corporation             -0.03365173  -1.46124398
## Aston Martin-ASC Incorporated                -2.87500000 -10.14836338
## Audi-ASC Incorporated                        -1.08058988  -8.32832675
## Audi-Aston Martin                             1.79441012   1.04328430
##                                                      upr     p adj
## Alfa Romeo-Acura                              2.53052626 0.0354932
## AM General-Acura                              3.00355676 1.0000000
## American Motors Corporation-Acura             0.97287084 0.9565818
## ASC Incorporated-Acura                        7.81254800 0.9999886
## Aston Martin-Acura                           -1.50271146 0.0000000
## Audi-Acura                                    0.01680304 0.0646980
## AM General-Alfa Romeo                         1.90022474 0.8993324
## American Motors Corporation-Alfa Romeo        0.03409691 0.0584930
## ASC Incorporated-Alfa Romeo                   6.60153694 0.9999467
## Aston Martin-Alfa Romeo                      -2.26048684 0.0000000
## Audi-Alfa Romeo                              -0.61220683 0.0001835
## American Motors Corporation-AM General        2.76462359 0.9993314
## ASC Incorporated-AM General                   8.36468397 0.9999938
## Aston Martin-AM General                       0.70271295 0.2596042
## Audi-AM General                               2.43517124 0.9983425
## ASC Incorporated-American Motors Corporation  8.42092246 0.9995824
## Aston Martin-American Motors Corporation     -0.27559769 0.0094508
## Audi-American Motors Corporation              1.39394053 1.0000000
## Aston Martin-ASC Incorporated                 4.39836338 0.9060725
## Audi-ASC Incorporated                         6.16714698 0.9994464
## Audi-Aston Martin                             2.54553593 0.0000000
# Transmission
TukeyHSD(modeltrf, ordered = FALSE, conf.level = 0.95)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = cty ~ (trans) + fuel, data = L)
## 
## $trans
##                                                           diff
## Auto(AM6)-Auto(AM-S6)                            -9.800000e+00
## Auto(AM7)-Auto(AM-S6)                            -9.800000e+00
## Auto(AV-S7)-Auto(AM-S6)                           1.520000e+01
## Auto(AV-S8)-Auto(AM-S6)                           5.333333e-01
## Automatic (AV)-Auto(AM-S6)                       -2.050000e+00
## Automatic (S4)-Auto(AM-S6)                       -8.400000e+00
## Automatic (S5)-Auto(AM-S6)                       -6.273214e+00
## Automatic (S6)-Auto(AM-S6)                       -7.025166e+00
## Automatic (S7)-Auto(AM-S6)                        4.200000e+00
## Automatic (S8)-Auto(AM-S6)                       -4.528814e+00
## Automatic (variable gear ratios)-Auto(AM-S6)     -4.168421e+00
## Automatic 3-spd-Auto(AM-S6)                      -8.830303e+00
## Automatic 4-spd-Auto(AM-S6)                      -6.918644e+00
## Automatic 5-spd-Auto(AM-S6)                      -8.461290e+00
## Automatic 6-spd-Auto(AM-S6)                      -1.280000e+01
## Manual 4-spd-Auto(AM-S6)                         -6.550000e+00
## Manual 5-spd-Auto(AM-S6)                         -6.386047e+00
## Manual 6-spd-Auto(AM-S6)                         -7.435036e+00
## Auto(AM7)-Auto(AM6)                              -1.563194e-13
## Auto(AV-S7)-Auto(AM6)                             2.500000e+01
## Auto(AV-S8)-Auto(AM6)                             1.033333e+01
## Automatic (AV)-Auto(AM6)                          7.750000e+00
## Automatic (S4)-Auto(AM6)                          1.400000e+00
## Automatic (S5)-Auto(AM6)                          3.526786e+00
## Automatic (S6)-Auto(AM6)                          2.774834e+00
## Automatic (S7)-Auto(AM6)                          1.400000e+01
## Automatic (S8)-Auto(AM6)                          5.271186e+00
## Automatic (variable gear ratios)-Auto(AM6)        5.631579e+00
## Automatic 3-spd-Auto(AM6)                         9.696970e-01
## Automatic 4-spd-Auto(AM6)                         2.881356e+00
## Automatic 5-spd-Auto(AM6)                         1.338710e+00
## Automatic 6-spd-Auto(AM6)                        -3.000000e+00
## Manual 4-spd-Auto(AM6)                            3.250000e+00
## Manual 5-spd-Auto(AM6)                            3.413953e+00
## Manual 6-spd-Auto(AM6)                            2.364964e+00
## Auto(AV-S7)-Auto(AM7)                             2.500000e+01
## Auto(AV-S8)-Auto(AM7)                             1.033333e+01
## Automatic (AV)-Auto(AM7)                          7.750000e+00
## Automatic (S4)-Auto(AM7)                          1.400000e+00
## Automatic (S5)-Auto(AM7)                          3.526786e+00
## Automatic (S6)-Auto(AM7)                          2.774834e+00
## Automatic (S7)-Auto(AM7)                          1.400000e+01
## Automatic (S8)-Auto(AM7)                          5.271186e+00
## Automatic (variable gear ratios)-Auto(AM7)        5.631579e+00
## Automatic 3-spd-Auto(AM7)                         9.696970e-01
## Automatic 4-spd-Auto(AM7)                         2.881356e+00
## Automatic 5-spd-Auto(AM7)                         1.338710e+00
## Automatic 6-spd-Auto(AM7)                        -3.000000e+00
## Manual 4-spd-Auto(AM7)                            3.250000e+00
## Manual 5-spd-Auto(AM7)                            3.413953e+00
## Manual 6-spd-Auto(AM7)                            2.364964e+00
## Auto(AV-S8)-Auto(AV-S7)                          -1.466667e+01
## Automatic (AV)-Auto(AV-S7)                       -1.725000e+01
## Automatic (S4)-Auto(AV-S7)                       -2.360000e+01
## Automatic (S5)-Auto(AV-S7)                       -2.147321e+01
## Automatic (S6)-Auto(AV-S7)                       -2.222517e+01
## Automatic (S7)-Auto(AV-S7)                       -1.100000e+01
## Automatic (S8)-Auto(AV-S7)                       -1.972881e+01
## Automatic (variable gear ratios)-Auto(AV-S7)     -1.936842e+01
## Automatic 3-spd-Auto(AV-S7)                      -2.403030e+01
## Automatic 4-spd-Auto(AV-S7)                      -2.211864e+01
## Automatic 5-spd-Auto(AV-S7)                      -2.366129e+01
## Automatic 6-spd-Auto(AV-S7)                      -2.800000e+01
## Manual 4-spd-Auto(AV-S7)                         -2.175000e+01
## Manual 5-spd-Auto(AV-S7)                         -2.158605e+01
## Manual 6-spd-Auto(AV-S7)                         -2.263504e+01
## Automatic (AV)-Auto(AV-S8)                       -2.583333e+00
## Automatic (S4)-Auto(AV-S8)                       -8.933333e+00
## Automatic (S5)-Auto(AV-S8)                       -6.806548e+00
## Automatic (S6)-Auto(AV-S8)                       -7.558499e+00
## Automatic (S7)-Auto(AV-S8)                        3.666667e+00
## Automatic (S8)-Auto(AV-S8)                       -5.062147e+00
## Automatic (variable gear ratios)-Auto(AV-S8)     -4.701754e+00
## Automatic 3-spd-Auto(AV-S8)                      -9.363636e+00
## Automatic 4-spd-Auto(AV-S8)                      -7.451977e+00
## Automatic 5-spd-Auto(AV-S8)                      -8.994624e+00
## Automatic 6-spd-Auto(AV-S8)                      -1.333333e+01
## Manual 4-spd-Auto(AV-S8)                         -7.083333e+00
## Manual 5-spd-Auto(AV-S8)                         -6.919380e+00
## Manual 6-spd-Auto(AV-S8)                         -7.968370e+00
## Automatic (S4)-Automatic (AV)                    -6.350000e+00
## Automatic (S5)-Automatic (AV)                    -4.223214e+00
## Automatic (S6)-Automatic (AV)                    -4.975166e+00
## Automatic (S7)-Automatic (AV)                     6.250000e+00
## Automatic (S8)-Automatic (AV)                    -2.478814e+00
## Automatic (variable gear ratios)-Automatic (AV)  -2.118421e+00
## Automatic 3-spd-Automatic (AV)                   -6.780303e+00
## Automatic 4-spd-Automatic (AV)                   -4.868644e+00
## Automatic 5-spd-Automatic (AV)                   -6.411290e+00
## Automatic 6-spd-Automatic (AV)                   -1.075000e+01
## Manual 4-spd-Automatic (AV)                      -4.500000e+00
## Manual 5-spd-Automatic (AV)                      -4.336047e+00
## Manual 6-spd-Automatic (AV)                      -5.385036e+00
## Automatic (S5)-Automatic (S4)                     2.126786e+00
## Automatic (S6)-Automatic (S4)                     1.374834e+00
## Automatic (S7)-Automatic (S4)                     1.260000e+01
## Automatic (S8)-Automatic (S4)                     3.871186e+00
## Automatic (variable gear ratios)-Automatic (S4)   4.231579e+00
## Automatic 3-spd-Automatic (S4)                   -4.303030e-01
## Automatic 4-spd-Automatic (S4)                    1.481356e+00
## Automatic 5-spd-Automatic (S4)                   -6.129032e-02
## Automatic 6-spd-Automatic (S4)                   -4.400000e+00
## Manual 4-spd-Automatic (S4)                       1.850000e+00
## Manual 5-spd-Automatic (S4)                       2.013953e+00
## Manual 6-spd-Automatic (S4)                       9.649635e-01
## Automatic (S6)-Automatic (S5)                    -7.519513e-01
## Automatic (S7)-Automatic (S5)                     1.047321e+01
## Automatic (S8)-Automatic (S5)                     1.744401e+00
## Automatic (variable gear ratios)-Automatic (S5)   2.104793e+00
## Automatic 3-spd-Automatic (S5)                   -2.557089e+00
## Automatic 4-spd-Automatic (S5)                   -6.454298e-01
## Automatic 5-spd-Automatic (S5)                   -2.188076e+00
## Automatic 6-spd-Automatic (S5)                   -6.526786e+00
## Manual 4-spd-Automatic (S5)                      -2.767857e-01
## Manual 5-spd-Automatic (S5)                      -1.128322e-01
## Manual 6-spd-Automatic (S5)                      -1.161822e+00
## Automatic (S7)-Automatic (S6)                     1.122517e+01
## Automatic (S8)-Automatic (S6)                     2.496352e+00
## Automatic (variable gear ratios)-Automatic (S6)   2.856745e+00
## Automatic 3-spd-Automatic (S6)                   -1.805137e+00
## Automatic 4-spd-Automatic (S6)                    1.065215e-01
## Automatic 5-spd-Automatic (S6)                   -1.436125e+00
## Automatic 6-spd-Automatic (S6)                   -5.774834e+00
## Manual 4-spd-Automatic (S6)                       4.751656e-01
## Manual 5-spd-Automatic (S6)                       6.391191e-01
## Manual 6-spd-Automatic (S6)                      -4.098709e-01
## Automatic (S8)-Automatic (S7)                    -8.728814e+00
## Automatic (variable gear ratios)-Automatic (S7)  -8.368421e+00
## Automatic 3-spd-Automatic (S7)                   -1.303030e+01
## Automatic 4-spd-Automatic (S7)                   -1.111864e+01
## Automatic 5-spd-Automatic (S7)                   -1.266129e+01
## Automatic 6-spd-Automatic (S7)                   -1.700000e+01
## Manual 4-spd-Automatic (S7)                      -1.075000e+01
## Manual 5-spd-Automatic (S7)                      -1.058605e+01
## Manual 6-spd-Automatic (S7)                      -1.163504e+01
## Automatic (variable gear ratios)-Automatic (S8)   3.603925e-01
## Automatic 3-spd-Automatic (S8)                   -4.301489e+00
## Automatic 4-spd-Automatic (S8)                   -2.389831e+00
## Automatic 5-spd-Automatic (S8)                   -3.932477e+00
## Automatic 6-spd-Automatic (S8)                   -8.271186e+00
## Manual 4-spd-Automatic (S8)                      -2.021186e+00
## Manual 5-spd-Automatic (S8)                      -1.857233e+00
## Manual 6-spd-Automatic (S8)                      -2.906223e+00
## Automatic 3-spd-Automatic (variable gear ratios) -4.661882e+00
## Automatic 4-spd-Automatic (variable gear ratios) -2.750223e+00
## Automatic 5-spd-Automatic (variable gear ratios) -4.292869e+00
## Automatic 6-spd-Automatic (variable gear ratios) -8.631579e+00
## Manual 4-spd-Automatic (variable gear ratios)    -2.381579e+00
## Manual 5-spd-Automatic (variable gear ratios)    -2.217625e+00
## Manual 6-spd-Automatic (variable gear ratios)    -3.266615e+00
## Automatic 4-spd-Automatic 3-spd                   1.911659e+00
## Automatic 5-spd-Automatic 3-spd                   3.690127e-01
## Automatic 6-spd-Automatic 3-spd                  -3.969697e+00
## Manual 4-spd-Automatic 3-spd                      2.280303e+00
## Manual 5-spd-Automatic 3-spd                      2.444257e+00
## Manual 6-spd-Automatic 3-spd                      1.395267e+00
## Automatic 5-spd-Automatic 4-spd                  -1.542646e+00
## Automatic 6-spd-Automatic 4-spd                  -5.881356e+00
## Manual 4-spd-Automatic 4-spd                      3.686441e-01
## Manual 5-spd-Automatic 4-spd                      5.325976e-01
## Manual 6-spd-Automatic 4-spd                     -5.163924e-01
## Automatic 6-spd-Automatic 5-spd                  -4.338710e+00
## Manual 4-spd-Automatic 5-spd                      1.911290e+00
## Manual 5-spd-Automatic 5-spd                      2.075244e+00
## Manual 6-spd-Automatic 5-spd                      1.026254e+00
## Manual 4-spd-Automatic 6-spd                      6.250000e+00
## Manual 5-spd-Automatic 6-spd                      6.413953e+00
## Manual 6-spd-Automatic 6-spd                      5.364964e+00
## Manual 5-spd-Manual 4-spd                         1.639535e-01
## Manual 6-spd-Manual 4-spd                        -8.850365e-01
## Manual 6-spd-Manual 5-spd                        -1.048990e+00
##                                                           lwr          upr
## Auto(AM6)-Auto(AM-S6)                            -17.34338131  -2.25661869
## Auto(AM7)-Auto(AM-S6)                            -15.84816038  -3.75183962
## Auto(AV-S7)-Auto(AM-S6)                            6.55797103  23.84202897
## Auto(AV-S8)-Auto(AM-S6)                           -5.72130803   6.78797470
## Automatic (AV)-Auto(AM-S6)                        -8.97903818   4.87903818
## Automatic (S4)-Auto(AM-S6)                       -14.93275985  -1.86724015
## Automatic (S5)-Auto(AM-S6)                       -10.99455797  -1.55187061
## Automatic (S6)-Auto(AM-S6)                       -11.72038096  -2.32995016
## Automatic (S7)-Auto(AM-S6)                        -7.11507197  15.51507197
## Automatic (S8)-Auto(AM-S6)                        -9.33992788   0.28230076
## Automatic (variable gear ratios)-Auto(AM-S6)      -9.08229628   0.74545418
## Automatic 3-spd-Auto(AM-S6)                      -13.62144348  -4.03916258
## Automatic 4-spd-Auto(AM-S6)                      -11.63485529  -2.20243284
## Automatic 5-spd-Auto(AM-S6)                      -13.26330245  -3.65927820
## Automatic 6-spd-Auto(AM-S6)                      -24.11507197  -1.48492803
## Manual 4-spd-Auto(AM-S6)                         -12.43855015  -0.66144985
## Manual 5-spd-Auto(AM-S6)                         -11.05881007  -1.71328296
## Manual 6-spd-Auto(AM-S6)                         -12.13793476  -2.73213823
## Auto(AM7)-Auto(AM6)                               -7.12782536   7.12782536
## Auto(AV-S7)-Auto(AM6)                             15.57077336  34.42922664
## Auto(AV-S8)-Auto(AM6)                              3.02948578  17.63718088
## Automatic (AV)-Auto(AM6)                          -0.13905701  15.63905701
## Automatic (S4)-Auto(AM6)                          -6.14338131   8.94338131
## Automatic (S5)-Auto(AM6)                          -2.51612224   9.56969367
## Automatic (S6)-Auto(AM6)                          -3.24768149   8.79735036
## Automatic (S7)-Auto(AM6)                           2.07286689  25.92713311
## Automatic (S8)-Auto(AM6)                          -0.84211638  11.38448927
## Automatic (variable gear ratios)-Auto(AM6)        -0.56292024  11.82607814
## Automatic 3-spd-Auto(AM6)                         -5.12789905   7.06729299
## Automatic 4-spd-Auto(AM6)                         -3.15754287   8.92025473
## Automatic 5-spd-Auto(AM6)                         -4.76743238   7.44485174
## Automatic 6-spd-Auto(AM6)                        -14.92713311   8.92713311
## Manual 4-spd-Auto(AM6)                            -3.74290164  10.24290164
## Manual 5-spd-Auto(AM6)                            -2.59107521   9.41898219
## Manual 6-spd-Auto(AM6)                            -3.66354398   8.39347099
## Auto(AV-S7)-Auto(AM7)                             16.71821533  33.28178467
## Auto(AV-S8)-Auto(AM7)                              4.58669681  16.07996986
## Automatic (AV)-Auto(AM7)                           1.27583111  14.22416889
## Automatic (S4)-Auto(AM7)                          -4.64816038   7.44816038
## Automatic (S5)-Auto(AM7)                          -0.49743829   7.55100972
## Automatic (S6)-Auto(AM7)                          -1.21870288   6.76837176
## Automatic (S7)-Auto(AM7)                           2.95762044  25.04237956
## Automatic (S8)-Auto(AM7)                           1.14200811   9.40036477
## Automatic (variable gear ratios)-Auto(AM7)         1.38311305   9.88004484
## Automatic 3-spd-Auto(AM7)                         -3.13619142   5.07558536
## Automatic 4-spd-Auto(AM7)                         -1.13684528   6.89955715
## Automatic 5-spd-Auto(AM7)                         -2.77985963   5.45727898
## Automatic 6-spd-Auto(AM7)                        -14.04237956   8.04237956
## Manual 4-spd-Auto(AM7)                            -2.09586902   8.59586902
## Manual 5-spd-Auto(AM7)                            -0.55316283   7.38106981
## Manual 6-spd-Auto(AM7)                            -1.63760377   6.36753078
## Auto(AV-S8)-Auto(AV-S7)                          -23.10042337  -6.23290997
## Automatic (AV)-Auto(AV-S7)                       -26.19534983  -8.30465017
## Automatic (S4)-Auto(AV-S7)                       -32.24202897 -14.95797103
## Automatic (S5)-Auto(AV-S7)                       -28.84198620 -14.10444237
## Automatic (S6)-Auto(AV-S7)                       -29.57722385 -14.87310727
## Automatic (S7)-Auto(AV-S7)                       -23.65063505   1.65063505
## Automatic (S8)-Auto(AV-S7)                       -27.15542345 -12.30220367
## Automatic (variable gear ratios)-Auto(AV-S7)     -26.86201053 -11.87483158
## Automatic 3-spd-Auto(AV-S7)                      -31.44398904 -16.61661702
## Automatic 4-spd-Auto(AV-S7)                      -29.48412856 -14.75315958
## Automatic 5-spd-Auto(AV-S7)                      -31.08200686 -16.24057379
## Automatic 6-spd-Auto(AV-S7)                      -40.65063505 -15.34936495
## Manual 4-spd-Auto(AV-S7)                         -29.91594981 -13.58405019
## Manual 5-spd-Auto(AV-S7)                         -28.92378681 -14.24830621
## Manual 6-spd-Auto(AV-S7)                         -29.99200364 -15.27806935
## Automatic (AV)-Auto(AV-S8)                        -9.25080343   4.08413677
## Automatic (S4)-Auto(AV-S8)                       -15.18797470  -2.67869197
## Automatic (S5)-Auto(AV-S8)                       -11.13490453  -2.47819071
## Automatic (S6)-Auto(AV-S8)                       -11.85834018  -3.25865761
## Automatic (S7)-Auto(AV-S8)                        -7.49014476  14.82347809
## Automatic (S8)-Auto(AV-S8)                        -9.48825222  -0.63604156
## Automatic (variable gear ratios)-Auto(AV-S8)      -9.23934815  -0.16416062
## Automatic 3-spd-Auto(AV-S8)                      -13.76802216  -4.95925057
## Automatic 4-spd-Auto(AV-S8)                      -11.77473528  -3.12921952
## Automatic 5-spd-Auto(AV-S8)                      -13.41083332  -4.57841399
## Automatic 6-spd-Auto(AV-S8)                      -24.49014476  -2.17652191
## Manual 4-spd-Auto(AV-S8)                         -12.66173904  -1.50492762
## Manual 5-spd-Auto(AV-S8)                         -11.19469348  -2.64406621
## Manual 6-spd-Auto(AV-S8)                         -12.27659911  -3.66014055
## Automatic (S4)-Automatic (AV)                    -13.27903818   0.57903818
## Automatic (S5)-Automatic (AV)                     -9.47923037   1.03280180
## Automatic (S6)-Automatic (AV)                    -10.20772388   0.25739276
## Automatic (S7)-Automatic (AV)                     -5.29839697  17.79839697
## Automatic (S8)-Automatic (AV)                     -7.81561409   2.85798697
## Automatic (variable gear ratios)-Automatic (AV)   -7.54804247   3.31120036
## Automatic 3-spd-Automatic (AV)                   -12.09910418  -1.46150188
## Automatic 4-spd-Automatic (AV)                   -10.12005028   0.38276215
## Automatic 5-spd-Automatic (AV)                   -11.73988670  -1.08269395
## Automatic 6-spd-Automatic (AV)                   -22.29839697   0.79839697
## Manual 4-spd-Automatic (AV)                      -10.82531752   1.82531752
## Manual 5-spd-Automatic (AV)                       -9.54846804   0.87637501
## Manual 6-spd-Automatic (AV)                      -10.62448981  -0.14558318
## Automatic (S5)-Automatic (S4)                     -2.59455797   6.84812939
## Automatic (S6)-Automatic (S4)                     -3.32038096   6.07004984
## Automatic (S7)-Automatic (S4)                      1.28492803  23.91507197
## Automatic (S8)-Automatic (S4)                     -0.93992788   8.68230076
## Automatic (variable gear ratios)-Automatic (S4)   -0.68229628   9.14545418
## Automatic 3-spd-Automatic (S4)                    -5.22144348   4.36083742
## Automatic 4-spd-Automatic (S4)                    -3.23485529   6.19756716
## Automatic 5-spd-Automatic (S4)                    -4.86330245   4.74072180
## Automatic 6-spd-Automatic (S4)                   -15.71507197   6.91507197
## Manual 4-spd-Automatic (S4)                       -4.03855015   7.73855015
## Manual 5-spd-Automatic (S4)                       -2.65881007   6.68671704
## Manual 6-spd-Automatic (S4)                       -3.73793476   5.66786177
## Automatic (S6)-Automatic (S5)                     -2.04004388   0.53614133
## Automatic (S7)-Automatic (S5)                      0.09800399  20.84842458
## Automatic (S8)-Automatic (S5)                      0.08278828   3.40601317
## Automatic (variable gear ratios)-Automatic (S5)    0.16564273   4.04394374
## Automatic 3-spd-Automatic (S5)                    -4.15994922  -0.95422827
## Automatic 4-spd-Automatic (S5)                    -2.00806811   0.71720855
## Automatic 5-spd-Automatic (S5)                    -3.82314647  -0.55300560
## Automatic 6-spd-Automatic (S5)                   -16.90199601   3.84842458
## Manual 4-spd-Automatic (S5)                       -4.05688595   3.50331452
## Manual 5-spd-Automatic (S5)                       -1.31651580   1.09085134
## Manual 6-spd-Automatic (S5)                       -2.47764401   0.15399959
## Automatic (S7)-Automatic (S6)                      0.86181909  21.58851204
## Automatic (S8)-Automatic (S6)                      0.91050288   4.08220112
## Automatic (variable gear ratios)-Automatic (S6)    0.98210689   4.73138213
## Automatic 3-spd-Automatic (S6)                    -3.32931699  -0.28095794
## Automatic 4-spd-Automatic (S6)                    -1.16262969   1.37567268
## Automatic 5-spd-Automatic (S6)                    -2.99414172   0.12189220
## Automatic 6-spd-Automatic (S6)                   -16.13818091   4.58851204
## Manual 4-spd-Automatic (S6)                       -3.27224945   4.22258058
## Manual 5-spd-Automatic (S6)                       -0.45761048   1.73584858
## Manual 6-spd-Automatic (S6)                       -1.62861969   0.80887782
## Automatic (S8)-Automatic (S7)                    -19.14518162   1.68755450
## Automatic (variable gear ratios)-Automatic (S7)  -18.83264927   2.09580717
## Automatic 3-spd-Automatic (S7)                   -23.43746063  -2.62314543
## Automatic 4-spd-Automatic (S7)                   -21.49151979  -0.74576834
## Automatic 5-spd-Automatic (S7)                   -23.07345738  -2.24912326
## Automatic 6-spd-Automatic (S7)                   -31.60769510  -2.39230490
## Manual 4-spd-Automatic (S7)                      -21.70577133   0.20577133
## Manual 5-spd-Automatic (S7)                      -20.93924031  -0.23285272
## Manual 6-spd-Automatic (S7)                      -22.00186603  -1.26820696
## Automatic (variable gear ratios)-Automatic (S8)   -1.78810454   2.50888955
## Automatic 3-spd-Automatic (S8)                    -6.15213708  -2.45084186
## Automatic 4-spd-Automatic (S8)                    -4.03680291  -0.74285811
## Automatic 5-spd-Automatic (S8)                    -5.81109067  -2.05386286
## Automatic 6-spd-Automatic (S8)                   -18.68755450   2.14518162
## Manual 4-spd-Automatic (S8)                       -5.91283039   1.87045751
## Manual 5-spd-Automatic (S8)                       -3.37532024  -0.33914567
## Manual 6-spd-Automatic (S8)                       -4.51467619  -1.29776968
## Automatic 3-spd-Automatic (variable gear ratios)  -6.76527099  -2.55849296
## Automatic 4-spd-Automatic (variable gear ratios)  -4.67684359  -0.82360244
## Automatic 5-spd-Automatic (variable gear ratios)  -6.42090568  -2.16483286
## Automatic 6-spd-Automatic (variable gear ratios) -19.09580717   1.83264927
## Manual 4-spd-Automatic (variable gear ratios)     -6.39956867   1.63641078
## Manual 5-spd-Automatic (variable gear ratios)     -4.03529919  -0.39995173
## Manual 6-spd-Automatic (variable gear ratios)     -5.16041339  -1.37281750
## Automatic 4-spd-Automatic 3-spd                    0.32398019   3.49933773
## Automatic 5-spd-Automatic 3-spd                   -1.45784142   2.19586683
## Automatic 6-spd-Automatic 3-spd                  -14.37685457   6.43746063
## Manual 4-spd-Automatic 3-spd                      -1.58662061   6.14722667
## Manual 5-spd-Automatic 3-spd                       0.99071092   3.89780212
## Manual 6-spd-Automatic 3-spd                      -0.15241808   2.94295115
## Automatic 5-spd-Automatic 4-spd                   -3.16283683   0.07754432
## Automatic 6-spd-Automatic 4-spd                  -16.25423166   4.49151979
## Manual 4-spd-Automatic 4-spd                      -3.40504378   4.14233191
## Manual 5-spd-Automatic 4-spd                      -0.65079431   1.71598942
## Manual 6-spd-Automatic 4-spd                      -1.81367774   0.78089288
## Automatic 6-spd-Automatic 5-spd                  -14.75087674   6.07345738
## Manual 4-spd-Automatic 5-spd                      -1.96909523   5.79167588
## Manual 5-spd-Automatic 5-spd                       0.58625475   3.56423287
## Manual 6-spd-Automatic 5-spd                      -0.55476524   2.60727289
## Manual 4-spd-Automatic 6-spd                      -4.70577133  17.20577133
## Manual 5-spd-Automatic 6-spd                      -3.93924031  16.76714728
## Manual 6-spd-Automatic 6-spd                      -5.00186603  15.73179304
## Manual 5-spd-Manual 4-spd                         -3.55529252   3.88319950
## Manual 6-spd-Manual 4-spd                         -4.64207306   2.87200007
## Manual 6-spd-Manual 5-spd                         -2.17815786   0.08017790
##                                                      p adj
## Auto(AM6)-Auto(AM-S6)                            0.0008098
## Auto(AM7)-Auto(AM-S6)                            0.0000025
## Auto(AV-S7)-Auto(AM-S6)                          0.0000001
## Auto(AV-S8)-Auto(AM-S6)                          1.0000000
## Automatic (AV)-Auto(AM-S6)                       0.9999425
## Automatic (S4)-Auto(AM-S6)                       0.0010011
## Automatic (S5)-Auto(AM-S6)                       0.0005017
## Automatic (S6)-Auto(AM-S6)                       0.0000268
## Automatic (S7)-Auto(AM-S6)                       0.9986911
## Automatic (S8)-Auto(AM-S6)                       0.0940482
## Automatic (variable gear ratios)-Auto(AM-S6)     0.2221096
## Automatic 3-spd-Auto(AM-S6)                      0.0000000
## Automatic 4-spd-Auto(AM-S6)                      0.0000459
## Automatic 5-spd-Auto(AM-S6)                      0.0000001
## Automatic 6-spd-Auto(AM-S6)                      0.0097379
## Manual 4-spd-Auto(AM-S6)                         0.0125466
## Manual 5-spd-Auto(AM-S6)                         0.0002666
## Manual 6-spd-Auto(AM-S6)                         0.0000054
## Auto(AM7)-Auto(AM6)                              1.0000000
## Auto(AV-S7)-Auto(AM6)                            0.0000000
## Auto(AV-S8)-Auto(AM6)                            0.0001165
## Automatic (AV)-Auto(AM6)                         0.0608670
## Automatic (S4)-Auto(AM6)                         1.0000000
## Automatic (S5)-Auto(AM6)                         0.8593047
## Automatic (S6)-Auto(AM6)                         0.9833302
## Automatic (S7)-Auto(AM6)                         0.0053927
## Automatic (S8)-Auto(AM6)                         0.1975663
## Automatic (variable gear ratios)-Auto(AM6)       0.1292521
## Automatic 3-spd-Auto(AM6)                        1.0000000
## Automatic 4-spd-Auto(AM6)                        0.9760550
## Automatic 5-spd-Auto(AM6)                        0.9999994
## Automatic 6-spd-Auto(AM6)                        0.9999950
## Manual 4-spd-Auto(AM6)                           0.9817372
## Manual 5-spd-Auto(AM6)                           0.8845868
## Manual 6-spd-Auto(AM6)                           0.9973720
## Auto(AV-S7)-Auto(AM7)                            0.0000000
## Auto(AV-S8)-Auto(AM7)                            0.0000001
## Automatic (AV)-Auto(AM7)                         0.0038585
## Automatic (S4)-Auto(AM7)                         0.9999986
## Automatic (S5)-Auto(AM7)                         0.1746945
## Automatic (S6)-Auto(AM7)                         0.5966756
## Automatic (S7)-Auto(AM7)                         0.0013277
## Automatic (S8)-Auto(AM7)                         0.0011583
## Automatic (variable gear ratios)-Auto(AM7)       0.0005282
## Automatic 3-spd-Auto(AM7)                        0.9999981
## Automatic 4-spd-Auto(AM7)                        0.5355863
## Automatic 5-spd-Auto(AM7)                        0.9997796
## Automatic 6-spd-Auto(AM7)                        0.9999838
## Manual 4-spd-Auto(AM7)                           0.8123542
## Manual 5-spd-Auto(AM7)                           0.2004268
## Manual 6-spd-Auto(AM7)                           0.8461227
## Auto(AV-S8)-Auto(AV-S7)                          0.0000002
## Automatic (AV)-Auto(AV-S7)                       0.0000000
## Automatic (S4)-Auto(AV-S7)                       0.0000000
## Automatic (S5)-Auto(AV-S7)                       0.0000000
## Automatic (S6)-Auto(AV-S7)                       0.0000000
## Automatic (S7)-Auto(AV-S7)                       0.1855521
## Automatic (S8)-Auto(AV-S7)                       0.0000000
## Automatic (variable gear ratios)-Auto(AV-S7)     0.0000000
## Automatic 3-spd-Auto(AV-S7)                      0.0000000
## Automatic 4-spd-Auto(AV-S7)                      0.0000000
## Automatic 5-spd-Auto(AV-S7)                      0.0000000
## Automatic 6-spd-Auto(AV-S7)                      0.0000000
## Manual 4-spd-Auto(AV-S7)                         0.0000000
## Manual 5-spd-Auto(AV-S7)                         0.0000000
## Manual 6-spd-Auto(AV-S7)                         0.0000000
## Automatic (AV)-Auto(AV-S8)                       0.9977471
## Automatic (S4)-Auto(AV-S8)                       0.0000919
## Automatic (S5)-Auto(AV-S8)                       0.0000063
## Automatic (S6)-Auto(AV-S8)                       0.0000001
## Automatic (S7)-Auto(AV-S8)                       0.9997431
## Automatic (S8)-Auto(AV-S8)                       0.0082137
## Automatic (variable gear ratios)-Auto(AV-S8)     0.0328055
## Automatic 3-spd-Auto(AV-S8)                      0.0000000
## Automatic 4-spd-Auto(AV-S8)                      0.0000003
## Automatic 5-spd-Auto(AV-S8)                      0.0000000
## Automatic 6-spd-Auto(AV-S8)                      0.0039712
## Manual 4-spd-Auto(AV-S8)                         0.0012882
## Manual 5-spd-Auto(AV-S8)                         0.0000026
## Manual 6-spd-Auto(AV-S8)                         0.0000000
## Automatic (S4)-Automatic (AV)                    0.1204764
## Automatic (S5)-Automatic (AV)                    0.3140015
## Automatic (S6)-Automatic (AV)                    0.0852992
## Automatic (S7)-Automatic (AV)                    0.9225547
## Automatic (S8)-Automatic (AV)                    0.9818527
## Automatic (variable gear ratios)-Automatic (AV)  0.9975436
## Automatic 3-spd-Automatic (AV)                   0.0011913
## Automatic 4-spd-Automatic (AV)                   0.1084979
## Automatic 5-spd-Automatic (AV)                   0.0035285
## Automatic 6-spd-Automatic (AV)                   0.1045204
## Manual 4-spd-Automatic (AV)                      0.5511134
## Manual 5-spd-Automatic (AV)                      0.2535263
## Manual 6-spd-Automatic (AV)                      0.0362501
## Automatic (S5)-Automatic (S4)                    0.9869096
## Automatic (S6)-Automatic (S4)                    0.9999505
## Automatic (S7)-Automatic (S4)                    0.0123435
## Automatic (S8)-Automatic (S4)                    0.3114412
## Automatic (variable gear ratios)-Automatic (S4)  0.1994290
## Automatic 3-spd-Automatic (S4)                   1.0000000
## Automatic 4-spd-Automatic (S4)                   0.9998639
## Automatic 5-spd-Automatic (S4)                   1.0000000
## Automatic 6-spd-Automatic (S4)                   0.9976431
## Manual 4-spd-Automatic (S4)                      0.9998635
## Manual 5-spd-Automatic (S4)                      0.9919828
## Manual 6-spd-Automatic (S4)                      0.9999998
## Automatic (S6)-Automatic (S5)                    0.8590434
## Automatic (S7)-Automatic (S5)                    0.0448924
## Automatic (S8)-Automatic (S5)                    0.0278157
## Automatic (variable gear ratios)-Automatic (S5)  0.0178173
## Automatic 3-spd-Automatic (S5)                   0.0000040
## Automatic 4-spd-Automatic (S5)                   0.9777718
## Automatic 5-spd-Automatic (S5)                   0.0004289
## Automatic 6-spd-Automatic (S5)                   0.7658034
## Manual 4-spd-Automatic (S5)                      1.0000000
## Manual 5-spd-Automatic (S5)                      1.0000000
## Manual 6-spd-Automatic (S5)                      0.1647390
## Automatic (S7)-Automatic (S6)                    0.0183400
## Automatic (S8)-Automatic (S6)                    0.0000061
## Automatic (variable gear ratios)-Automatic (S6)  0.0000160
## Automatic 3-spd-Automatic (S6)                   0.0046387
## Automatic 4-spd-Automatic (S6)                   1.0000000
## Automatic 5-spd-Automatic (S6)                   0.1143728
## Automatic 6-spd-Automatic (S6)                   0.9014684
## Manual 4-spd-Automatic (S6)                      1.0000000
## Manual 5-spd-Automatic (S6)                      0.8608500
## Manual 6-spd-Automatic (S6)                      0.9996472
## Automatic (S8)-Automatic (S7)                    0.2415018
## Automatic (variable gear ratios)-Automatic (S7)  0.3226352
## Automatic 3-spd-Automatic (S7)                   0.0016949
## Automatic 4-spd-Automatic (S7)                   0.0211561
## Automatic 5-spd-Automatic (S7)                   0.0029206
## Automatic 6-spd-Automatic (S7)                   0.0062137
## Manual 4-spd-Automatic (S7)                      0.0616442
## Manual 5-spd-Automatic (S7)                      0.0385824
## Manual 6-spd-Automatic (S7)                      0.0109797
## Automatic (variable gear ratios)-Automatic (S8)  1.0000000
## Automatic 3-spd-Automatic (S8)                   0.0000000
## Automatic 4-spd-Automatic (S8)                   0.0000612
## Automatic 5-spd-Automatic (S8)                   0.0000000
## Automatic 6-spd-Automatic (S8)                   0.3357840
## Manual 4-spd-Automatic (S8)                      0.9459726
## Manual 5-spd-Automatic (S8)                      0.0026161
## Manual 6-spd-Automatic (S8)                      0.0000000
## Automatic 3-spd-Automatic (variable gear ratios) 0.0000000
## Automatic 4-spd-Automatic (variable gear ratios) 0.0000931
## Automatic 5-spd-Automatic (variable gear ratios) 0.0000000
## Automatic 6-spd-Automatic (variable gear ratios) 0.2677359
## Manual 4-spd-Automatic (variable gear ratios)    0.8426113
## Manual 5-spd-Automatic (variable gear ratios)    0.0027509
## Manual 6-spd-Automatic (variable gear ratios)    0.0000003
## Automatic 4-spd-Automatic 3-spd                  0.0034836
## Automatic 5-spd-Automatic 3-spd                  0.9999998
## Automatic 6-spd-Automatic 3-spd                  0.9981482
## Manual 4-spd-Automatic 3-spd                     0.8482949
## Manual 5-spd-Automatic 3-spd                     0.0000007
## Manual 6-spd-Automatic 3-spd                     0.1389044
## Automatic 5-spd-Automatic 4-spd                  0.0841280
## Automatic 6-spd-Automatic 4-spd                  0.8869643
## Manual 4-spd-Automatic 4-spd                     1.0000000
## Manual 5-spd-Automatic 4-spd                     0.9870357
## Manual 6-spd-Automatic 4-spd                     0.9968576
## Automatic 6-spd-Automatic 5-spd                  0.9945683
## Manual 4-spd-Automatic 5-spd                     0.9671500
## Manual 5-spd-Automatic 5-spd                     0.0001679
## Manual 6-spd-Automatic 5-spd                     0.7174492
## Manual 4-spd-Automatic 6-spd                     0.8814794
## Manual 5-spd-Automatic 6-spd                     0.7874838
## Manual 6-spd-Automatic 6-spd                     0.9476931
## Manual 5-spd-Manual 4-spd                        1.0000000
## Manual 6-spd-Manual 4-spd                        0.9999982
## Manual 6-spd-Manual 5-spd                        0.1064890
## 
## $fuel
##                              diff          lwr       upr     p adj
## Premium-Diesel         -7.9148760 -10.44245490 -5.387297 0.0000000
## Premium or E85-Diesel  -6.9955825 -10.65798591 -3.333179 0.0000062
## Regular-Diesel         -7.4505951 -10.00946499 -4.891725 0.0000000
## Premium or E85-Premium  0.9192935  -1.75982337  3.598410 0.8136849
## Regular-Premium         0.4642808  -0.09454216  1.023104 0.1418420
## Regular-Premium or E85 -0.4550127  -3.16367036  2.253645 0.9729169
TukeyHSD(modeltrm, ordered = FALSE, conf.level = 0.95)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = cty ~ (trans) + make, data = L)
## 
## $trans
##                                                           diff         lwr
## Auto(AM6)-Auto(AM-S6)                            -9.800000e+00 -15.4674188
## Auto(AM7)-Auto(AM-S6)                            -9.800000e+00 -14.3440441
## Auto(AV-S7)-Auto(AM-S6)                           1.520000e+01   8.7071561
## Auto(AV-S8)-Auto(AM-S6)                           5.333333e-01  -4.1658420
## Automatic (AV)-Auto(AM-S6)                       -2.050000e+00  -7.2558565
## Automatic (S4)-Auto(AM-S6)                       -8.400000e+00 -13.3081286
## Automatic (S5)-Auto(AM-S6)                       -6.273214e+00  -9.8204076
## Automatic (S6)-Auto(AM-S6)                       -7.025166e+00 -10.5527284
## Automatic (S7)-Auto(AM-S6)                        4.200000e+00  -4.3011281
## Automatic (S8)-Auto(AM-S6)                       -4.528814e+00  -8.1434525
## Automatic (variable gear ratios)-Auto(AM-S6)     -4.168421e+00  -7.8602653
## Automatic 3-spd-Auto(AM-S6)                      -8.830303e+00 -12.4299354
## Automatic 4-spd-Auto(AM-S6)                      -6.918644e+00 -10.4619813
## Automatic 5-spd-Auto(AM-S6)                      -8.461290e+00 -12.0690906
## Automatic 6-spd-Auto(AM-S6)                      -1.280000e+01 -21.3011281
## Manual 4-spd-Auto(AM-S6)                         -6.550000e+00 -10.9741273
## Manual 5-spd-Auto(AM-S6)                         -6.386047e+00  -9.8967411
## Manual 6-spd-Auto(AM-S6)                         -7.435036e+00 -10.9683716
## Auto(AM7)-Auto(AM6)                              -1.563194e-13  -5.3552074
## Auto(AV-S7)-Auto(AM6)                             2.500000e+01  17.9157266
## Auto(AV-S8)-Auto(AM6)                             1.033333e+01   4.8458787
## Automatic (AV)-Auto(AM6)                          7.750000e+00   1.8228716
## Automatic (S4)-Auto(AM6)                          1.400000e+00  -4.2674188
## Automatic (S5)-Auto(AM6)                          3.526786e+00  -1.0133122
## Automatic (S6)-Auto(AM6)                          2.774834e+00  -1.7499428
## Automatic (S7)-Auto(AM6)                          1.400000e+01   5.0390241
## Automatic (S8)-Auto(AM6)                          5.271186e+00   0.6782001
## Automatic (variable gear ratios)-Auto(AM6)        5.631579e+00   0.9775890
## Automatic 3-spd-Auto(AM6)                         9.696970e-01  -3.6114887
## Automatic 4-spd-Auto(AM6)                         2.881356e+00  -1.6557299
## Automatic 5-spd-Auto(AM6)                         1.338710e+00  -3.2488967
## Automatic 6-spd-Auto(AM6)                        -3.000000e+00 -11.9609759
## Manual 4-spd-Auto(AM6)                            3.250000e+00  -2.0038378
## Manual 5-spd-Auto(AM6)                            3.413953e+00  -1.0976854
## Manual 6-spd-Auto(AM6)                            2.364964e+00  -2.1643152
## Auto(AV-S7)-Auto(AM7)                             2.500000e+01  18.7778113
## Auto(AV-S8)-Auto(AM7)                             1.033333e+01   6.0158271
## Automatic (AV)-Auto(AM7)                          7.750000e+00   2.8858914
## Automatic (S4)-Auto(AM7)                          1.400000e+00  -3.1440441
## Automatic (S5)-Auto(AM7)                          3.526786e+00   0.5033455
## Automatic (S6)-Auto(AM7)                          2.774834e+00  -0.2255506
## Automatic (S7)-Auto(AM7)                          1.400000e+01   5.7037484
## Automatic (S8)-Auto(AM7)                          5.271186e+00   2.1688930
## Automatic (variable gear ratios)-Auto(AM7)        5.631579e+00   2.4396635
## Automatic 3-spd-Auto(AM7)                         9.696970e-01  -2.1150985
## Automatic 4-spd-Auto(AM7)                         2.881356e+00  -0.1375593
## Automatic 5-spd-Auto(AM7)                         1.338710e+00  -1.7556131
## Automatic 6-spd-Auto(AM7)                        -3.000000e+00 -11.2962516
## Manual 4-spd-Auto(AM7)                            3.250000e+00  -0.7664055
## Manual 5-spd-Auto(AM7)                            3.413953e+00   0.4334188
## Manual 6-spd-Auto(AM7)                            2.364964e+00  -0.6422058
## Auto(AV-S8)-Auto(AV-S7)                          -1.466667e+01 -21.0030335
## Automatic (AV)-Auto(AV-S7)                       -1.725000e+01 -23.9707319
## Automatic (S4)-Auto(AV-S7)                       -2.360000e+01 -30.0928439
## Automatic (S5)-Auto(AV-S7)                       -2.147321e+01 -27.0094472
## Automatic (S6)-Auto(AV-S7)                       -2.222517e+01 -27.7488414
## Automatic (S7)-Auto(AV-S7)                       -1.100000e+01 -20.5045502
## Automatic (S8)-Auto(AV-S7)                       -1.972881e+01 -25.3085008
## Automatic (variable gear ratios)-Auto(AV-S7)     -1.936842e+01 -24.9984307
## Automatic 3-spd-Auto(AV-S7)                      -2.403030e+01 -29.6002804
## Automatic 4-spd-Auto(AV-S7)                      -2.211864e+01 -27.6524071
## Automatic 5-spd-Auto(AV-S7)                      -2.366129e+01 -29.2365498
## Automatic 6-spd-Auto(AV-S7)                      -2.800000e+01 -37.5045502
## Manual 4-spd-Auto(AV-S7)                         -2.175000e+01 -27.8851608
## Manual 5-spd-Auto(AV-S7)                         -2.158605e+01 -27.0989651
## Manual 6-spd-Auto(AV-S7)                         -2.263504e+01 -28.1624004
## Automatic (AV)-Auto(AV-S8)                       -2.583333e+00  -7.5926711
## Automatic (S4)-Auto(AV-S8)                       -8.933333e+00 -13.6325087
## Automatic (S5)-Auto(AV-S8)                       -6.806548e+00 -10.0584860
## Automatic (S6)-Auto(AV-S8)                       -7.558499e+00 -10.7890132
## Automatic (S7)-Auto(AV-S8)                        3.666667e+00  -4.7155587
## Automatic (S8)-Auto(AV-S8)                       -5.062147e+00  -8.3875246
## Automatic (variable gear ratios)-Auto(AV-S8)     -4.701754e+00  -8.1108945
## Automatic 3-spd-Auto(AV-S8)                      -9.363636e+00 -12.6726960
## Automatic 4-spd-Auto(AV-S8)                      -7.451977e+00 -10.6997092
## Automatic 5-spd-Auto(AV-S8)                      -8.994624e+00 -12.3125667
## Automatic 6-spd-Auto(AV-S8)                      -1.333333e+01 -21.7155587
## Manual 4-spd-Auto(AV-S8)                         -7.083333e+00 -11.2744460
## Manual 5-spd-Auto(AV-S8)                         -6.919380e+00 -10.1314663
## Manual 6-spd-Auto(AV-S8)                         -7.968370e+00 -11.2051861
## Automatic (S4)-Automatic (AV)                    -6.350000e+00 -11.5558565
## Automatic (S5)-Automatic (AV)                    -4.223214e+00  -8.1721124
## Automatic (S6)-Automatic (AV)                    -4.975166e+00  -8.9064396
## Automatic (S7)-Automatic (AV)                     6.250000e+00  -2.4264276
## Automatic (S8)-Automatic (AV)                    -2.478814e+00  -6.4884058
## Automatic (variable gear ratios)-Automatic (AV)  -2.118421e+00  -6.1977506
## Automatic 3-spd-Automatic (AV)                   -6.780303e+00 -10.7763722
## Automatic 4-spd-Automatic (AV)                   -4.868644e+00  -8.8140787
## Automatic 5-spd-Automatic (AV)                   -6.411290e+00 -10.4147187
## Automatic 6-spd-Automatic (AV)                   -1.075000e+01 -19.4264276
## Manual 4-spd-Automatic (AV)                      -4.500000e+00  -9.2522751
## Manual 5-spd-Automatic (AV)                      -4.336047e+00  -8.2521916
## Manual 6-spd-Automatic (AV)                      -5.385036e+00  -9.3214908
## Automatic (S5)-Automatic (S4)                     2.126786e+00  -1.4204076
## Automatic (S6)-Automatic (S4)                     1.374834e+00  -2.1527284
## Automatic (S7)-Automatic (S4)                     1.260000e+01   4.0988719
## Automatic (S8)-Automatic (S4)                     3.871186e+00   0.2565475
## Automatic (variable gear ratios)-Automatic (S4)   4.231579e+00   0.5397347
## Automatic 3-spd-Automatic (S4)                   -4.303030e-01  -4.0299354
## Automatic 4-spd-Automatic (S4)                    1.481356e+00  -2.0619813
## Automatic 5-spd-Automatic (S4)                   -6.129032e-02  -3.6690906
## Automatic 6-spd-Automatic (S4)                   -4.400000e+00 -12.9011281
## Manual 4-spd-Automatic (S4)                       1.850000e+00  -2.5741273
## Manual 5-spd-Automatic (S4)                       2.013953e+00  -1.4967411
## Manual 6-spd-Automatic (S4)                       9.649635e-01  -2.5683716
## Automatic (S6)-Automatic (S5)                    -7.519513e-01  -1.7197083
## Automatic (S7)-Automatic (S5)                     1.047321e+01   2.6782138
## Automatic (S8)-Automatic (S5)                     1.744401e+00   0.4960145
## Automatic (variable gear ratios)-Automatic (S5)   2.104793e+00   0.6478898
## Automatic 3-spd-Automatic (S5)                   -2.557089e+00  -3.7613340
## Automatic 4-spd-Automatic (S5)                   -6.454298e-01  -1.6691938
## Automatic 5-spd-Automatic (S5)                   -2.188076e+00  -3.4165210
## Automatic 6-spd-Automatic (S5)                   -6.526786e+00 -14.3217862
## Manual 4-spd-Automatic (S5)                      -2.767857e-01  -3.1168133
## Manual 5-spd-Automatic (S5)                      -1.128322e-01  -1.0171719
## Manual 6-spd-Automatic (S5)                      -1.161822e+00  -2.1504124
## Automatic (S7)-Automatic (S6)                     1.122517e+01   3.4390784
## Automatic (S8)-Automatic (S6)                     2.496352e+00   1.3048875
## Automatic (variable gear ratios)-Automatic (S6)   2.856745e+00   1.4483103
## Automatic 3-spd-Automatic (S6)                   -1.805137e+00  -2.9502690
## Automatic 4-spd-Automatic (S6)                    1.065215e-01  -0.8470046
## Automatic 5-spd-Automatic (S6)                   -1.436125e+00  -2.6066787
## Automatic 6-spd-Automatic (S6)                   -5.774834e+00 -13.5609216
## Manual 4-spd-Automatic (S6)                       4.751656e-01  -2.3403053
## Manual 5-spd-Automatic (S6)                       6.391191e-01  -0.1848649
## Manual 6-spd-Automatic (S6)                      -4.098709e-01  -1.3255292
## Automatic (S8)-Automatic (S7)                    -8.728814e+00 -16.5547363
## Automatic (variable gear ratios)-Automatic (S7)  -8.368421e+00 -16.2303017
## Automatic 3-spd-Automatic (S7)                   -1.303030e+01 -20.8493059
## Automatic 4-spd-Automatic (S7)                   -1.111864e+01 -18.9118906
## Automatic 5-spd-Automatic (S7)                   -1.266129e+01 -20.4840568
## Automatic 6-spd-Automatic (S7)                   -1.700000e+01 -27.9749092
## Manual 4-spd-Automatic (S7)                      -1.075000e+01 -18.9811819
## Manual 5-spd-Automatic (S7)                      -1.058605e+01 -18.3645058
## Manual 6-spd-Automatic (S7)                      -1.163504e+01 -19.4237405
## Automatic (variable gear ratios)-Automatic (S8)   3.603925e-01  -1.2537951
## Automatic 3-spd-Automatic (S8)                   -4.301489e+00  -5.6918998
## Automatic 4-spd-Automatic (S8)                   -2.389831e+00  -3.6272175
## Automatic 5-spd-Automatic (S8)                   -3.932477e+00  -5.3438984
## Automatic 6-spd-Automatic (S8)                   -8.271186e+00 -16.0971092
## Manual 4-spd-Automatic (S8)                      -2.021186e+00  -4.9450179
## Manual 5-spd-Automatic (S8)                      -1.857233e+00  -2.9977873
## Manual 6-spd-Automatic (S8)                      -2.906223e+00  -4.1146702
## Automatic 3-spd-Automatic (variable gear ratios) -4.661882e+00  -6.2421794
## Automatic 4-spd-Automatic (variable gear ratios) -2.750223e+00  -4.1977126
## Automatic 5-spd-Automatic (variable gear ratios) -4.292869e+00  -5.8916846
## Automatic 6-spd-Automatic (variable gear ratios) -8.631579e+00 -16.4934596
## Manual 4-spd-Automatic (variable gear ratios)    -2.381579e+00  -5.4003353
## Manual 5-spd-Automatic (variable gear ratios)    -2.217625e+00  -3.5832621
## Manual 6-spd-Automatic (variable gear ratios)    -3.266615e+00  -4.6894450
## Automatic 4-spd-Automatic 3-spd                   1.911659e+00   0.7188198
## Automatic 5-spd-Automatic 3-spd                   3.690127e-01  -1.0035213
## Automatic 6-spd-Automatic 3-spd                  -3.969697e+00 -11.7886998
## Manual 4-spd-Automatic 3-spd                      2.280303e+00  -0.6249559
## Manual 5-spd-Automatic 3-spd                      2.444257e+00   1.3521930
## Manual 6-spd-Automatic 3-spd                      1.395267e+00   0.2324754
## Automatic 5-spd-Automatic 4-spd                  -1.542646e+00  -2.7599118
## Automatic 6-spd-Automatic 4-spd                  -5.881356e+00 -13.6746025
## Manual 4-spd-Automatic 4-spd                      3.686441e-01  -2.4665658
## Manual 5-spd-Automatic 4-spd                      5.325976e-01  -0.3564967
## Manual 6-spd-Automatic 4-spd                     -5.163924e-01  -1.4910560
## Automatic 6-spd-Automatic 5-spd                  -4.338710e+00 -12.1614762
## Manual 4-spd-Automatic 5-spd                      1.911290e+00  -1.0040826
## Manual 5-spd-Automatic 5-spd                      2.075244e+00   0.9565513
## Manual 6-spd-Automatic 5-spd                      1.026254e+00  -0.1615818
## Manual 4-spd-Automatic 6-spd                      6.250000e+00  -1.9811819
## Manual 5-spd-Automatic 6-spd                      6.413953e+00  -1.3645058
## Manual 6-spd-Automatic 6-spd                      5.364964e+00  -2.4237405
## Manual 5-spd-Manual 4-spd                         1.639535e-01  -2.6303537
## Manual 6-spd-Manual 4-spd                        -8.850365e-01  -3.7077361
## Manual 6-spd-Manual 5-spd                        -1.048990e+00  -1.8973452
##                                                          upr     p adj
## Auto(AM6)-Auto(AM-S6)                             -4.1325812 0.0000003
## Auto(AM7)-Auto(AM-S6)                             -5.2559559 0.0000000
## Auto(AV-S7)-Auto(AM-S6)                           21.6928439 0.0000000
## Auto(AV-S8)-Auto(AM-S6)                            5.2325087 1.0000000
## Automatic (AV)-Auto(AM-S6)                         3.1558565 0.9972457
## Automatic (S4)-Auto(AM-S6)                        -3.4918714 0.0000004
## Automatic (S5)-Auto(AM-S6)                        -2.7260210 0.0000001
## Automatic (S6)-Auto(AM-S6)                        -3.4976027 0.0000000
## Automatic (S7)-Auto(AM-S6)                        12.7011281 0.9661602
## Automatic (S8)-Auto(AM-S6)                        -0.9141747 0.0016730
## Automatic (variable gear ratios)-Auto(AM-S6)      -0.4765768 0.0100254
## Automatic 3-spd-Auto(AM-S6)                       -5.2306707 0.0000000
## Automatic 4-spd-Auto(AM-S6)                       -3.3753068 0.0000000
## Automatic 5-spd-Auto(AM-S6)                       -4.8534900 0.0000000
## Automatic 6-spd-Auto(AM-S6)                       -4.2988719 0.0000225
## Manual 4-spd-Auto(AM-S6)                          -2.1258727 0.0000359
## Manual 5-spd-Auto(AM-S6)                          -2.8753519 0.0000000
## Manual 6-spd-Auto(AM-S6)                          -3.9017014 0.0000000
## Auto(AM7)-Auto(AM6)                                5.3552074 1.0000000
## Auto(AV-S7)-Auto(AM6)                             32.0842734 0.0000000
## Auto(AV-S8)-Auto(AM6)                             15.8207879 0.0000000
## Automatic (AV)-Auto(AM6)                          13.6771284 0.0007078
## Automatic (S4)-Auto(AM6)                           7.0674188 0.9999962
## Automatic (S5)-Auto(AM6)                           8.0668836 0.3774665
## Automatic (S6)-Auto(AM6)                           7.2996116 0.8011234
## Automatic (S7)-Auto(AM6)                          22.9609759 0.0000077
## Automatic (S8)-Auto(AM6)                           9.8641727 0.0077782
## Automatic (variable gear ratios)-Auto(AM6)        10.2855689 0.0031899
## Automatic 3-spd-Auto(AM6)                          5.5508826 0.9999997
## Automatic 4-spd-Auto(AM6)                          7.4184417 0.7517177
## Automatic 5-spd-Auto(AM6)                          5.9263160 0.9999530
## Automatic 6-spd-Auto(AM6)                          5.9609759 0.9996683
## Manual 4-spd-Auto(AM6)                             8.5038378 0.7895018
## Manual 5-spd-Auto(AM6)                             7.9255923 0.4287792
## Manual 6-spd-Auto(AM6)                             6.8942422 0.9433051
## Auto(AV-S7)-Auto(AM7)                             31.2221887 0.0000000
## Auto(AV-S8)-Auto(AM7)                             14.6508395 0.0000000
## Automatic (AV)-Auto(AM7)                          12.6141086 0.0000042
## Automatic (S4)-Auto(AM7)                           5.9440441 0.9998966
## Automatic (S5)-Auto(AM7)                           6.5502259 0.0059814
## Automatic (S6)-Auto(AM7)                           5.7752195 0.1109776
## Automatic (S7)-Auto(AM7)                          22.2962516 0.0000006
## Automatic (S8)-Auto(AM7)                           8.3734799 0.0000005
## Automatic (variable gear ratios)-Auto(AM7)         8.8234944 0.0000001
## Automatic 3-spd-Auto(AM7)                          4.0544925 0.9998623
## Automatic 4-spd-Auto(AM7)                          5.9002712 0.0821359
## Automatic 5-spd-Auto(AM7)                          4.4330325 0.9916298
## Automatic 6-spd-Auto(AM7)                          5.2962516 0.9990674
## Manual 4-spd-Auto(AM7)                             7.2664055 0.3012746
## Manual 5-spd-Auto(AM7)                             6.3944881 0.0080227
## Manual 6-spd-Auto(AM7)                             5.3721328 0.3538890
## Auto(AV-S8)-Auto(AV-S7)                           -8.3302999 0.0000000
## Automatic (AV)-Auto(AV-S7)                       -10.5292681 0.0000000
## Automatic (S4)-Auto(AV-S7)                       -17.1071561 0.0000000
## Automatic (S5)-Auto(AV-S7)                       -15.9369813 0.0000000
## Automatic (S6)-Auto(AV-S7)                       -16.7014897 0.0000000
## Automatic (S7)-Auto(AV-S7)                        -1.4954498 0.0067999
## Automatic (S8)-Auto(AV-S7)                       -14.1491264 0.0000000
## Automatic (variable gear ratios)-Auto(AV-S7)     -13.7384114 0.0000000
## Automatic 3-spd-Auto(AV-S7)                      -18.4603257 0.0000000
## Automatic 4-spd-Auto(AV-S7)                      -16.5848810 0.0000000
## Automatic 5-spd-Auto(AV-S7)                      -18.0860309 0.0000000
## Automatic 6-spd-Auto(AV-S7)                      -18.4954498 0.0000000
## Manual 4-spd-Auto(AV-S7)                         -15.6148392 0.0000000
## Manual 5-spd-Auto(AV-S7)                         -16.0731279 0.0000000
## Manual 6-spd-Auto(AV-S7)                         -17.1076726 0.0000000
## Automatic (AV)-Auto(AV-S8)                         2.4260045 0.9493279
## Automatic (S4)-Auto(AV-S8)                        -4.2341580 0.0000000
## Automatic (S5)-Auto(AV-S8)                        -3.5546093 0.0000000
## Automatic (S6)-Auto(AV-S8)                        -4.3279846 0.0000000
## Automatic (S7)-Auto(AV-S8)                        12.0488920 0.9905241
## Automatic (S8)-Auto(AV-S8)                        -1.7367691 0.0000165
## Automatic (variable gear ratios)-Auto(AV-S8)      -1.2926143 0.0002157
## Automatic 3-spd-Auto(AV-S8)                       -6.0545767 0.0000000
## Automatic 4-spd-Auto(AV-S8)                       -4.2042456 0.0000000
## Automatic 5-spd-Auto(AV-S8)                       -5.6766806 0.0000000
## Automatic 6-spd-Auto(AV-S8)                       -4.9511080 0.0000044
## Manual 4-spd-Auto(AV-S8)                          -2.8922206 0.0000006
## Manual 5-spd-Auto(AV-S8)                          -3.7072934 0.0000000
## Manual 6-spd-Auto(AV-S8)                          -4.7315536 0.0000000
## Automatic (S4)-Automatic (AV)                     -1.1441435 0.0027617
## Automatic (S5)-Automatic (AV)                     -0.2743162 0.0218125
## Automatic (S6)-Automatic (AV)                     -1.0438915 0.0013764
## Automatic (S7)-Automatic (AV)                     14.9264276 0.5266063
## Automatic (S8)-Automatic (AV)                      1.5307787 0.7903272
## Automatic (variable gear ratios)-Automatic (AV)    1.9609085 0.9460223
## Automatic 3-spd-Automatic (AV)                    -2.7842339 0.0000005
## Automatic 4-spd-Automatic (AV)                    -0.9232094 0.0022316
## Automatic 5-spd-Automatic (AV)                    -2.4078619 0.0000036
## Automatic 6-spd-Automatic (AV)                    -2.0735724 0.0020691
## Manual 4-spd-Automatic (AV)                        0.2522751 0.0888059
## Manual 5-spd-Automatic (AV)                       -0.4199014 0.0134226
## Manual 6-spd-Automatic (AV)                       -1.4485822 0.0002607
## Automatic (S5)-Automatic (S4)                      5.6739790 0.8293566
## Automatic (S6)-Automatic (S4)                      4.9023973 0.9975756
## Automatic (S7)-Automatic (S4)                     21.1011281 0.0000348
## Automatic (S8)-Automatic (S4)                      7.4858253 0.0214033
## Automatic (variable gear ratios)-Automatic (S4)    7.9234232 0.0079369
## Automatic 3-spd-Automatic (S4)                     3.1693293 1.0000000
## Automatic 4-spd-Automatic (S4)                     5.0246932 0.9943543
## Automatic 5-spd-Automatic (S4)                     3.5465100 1.0000000
## Automatic 6-spd-Automatic (S4)                     4.1011281 0.9476266
## Manual 4-spd-Automatic (S4)                        6.2741273 0.9943395
## Manual 5-spd-Automatic (S4)                        5.5246481 0.8763060
## Manual 6-spd-Automatic (S4)                        4.4982986 0.9999824
## Automatic (S6)-Automatic (S5)                      0.2158057 0.3769800
## Automatic (S7)-Automatic (S5)                     18.2682148 0.0003925
## Automatic (S8)-Automatic (S5)                      2.9927870 0.0001579
## Automatic (variable gear ratios)-Automatic (S5)    3.5616966 0.0000686
## Automatic 3-spd-Automatic (S5)                    -1.3528434 0.0000000
## Automatic 4-spd-Automatic (S5)                     0.3783342 0.7625971
## Automatic 5-spd-Automatic (S5)                    -0.9596311 0.0000001
## Automatic 6-spd-Automatic (S5)                     1.2682148 0.2428237
## Manual 4-spd-Automatic (S5)                        2.5632419 1.0000000
## Manual 5-spd-Automatic (S5)                        0.7915074 1.0000000
## Manual 6-spd-Automatic (S5)                       -0.1732320 0.0052841
## Automatic (S7)-Automatic (S6)                     19.0112527 0.0000724
## Automatic (S8)-Automatic (S6)                      3.6878165 0.0000000
## Automatic (variable gear ratios)-Automatic (S6)    4.2651787 0.0000000
## Automatic 3-spd-Automatic (S6)                    -0.6600060 0.0000059
## Automatic 4-spd-Automatic (S6)                     1.0600476 1.0000000
## Automatic 5-spd-Automatic (S6)                    -0.2655708 0.0024838
## Automatic 6-spd-Automatic (S6)                     2.0112527 0.4685841
## Manual 4-spd-Automatic (S6)                        3.2906364 1.0000000
## Manual 5-spd-Automatic (S6)                        1.4631030 0.3803609
## Manual 6-spd-Automatic (S6)                        0.5057873 0.9877775
## Automatic (S8)-Automatic (S7)                     -0.9028908 0.0120502
## Automatic (variable gear ratios)-Automatic (S7)   -0.5065404 0.0232302
## Automatic 3-spd-Automatic (S7)                    -5.2113002 0.0000010
## Automatic 4-spd-Automatic (S7)                    -3.3253975 0.0000945
## Automatic 5-spd-Automatic (S7)                    -4.8385238 0.0000026
## Automatic 6-spd-Automatic (S7)                    -6.0250908 0.0000099
## Manual 4-spd-Automatic (S7)                       -2.5188181 0.0007255
## Manual 5-spd-Automatic (S7)                       -2.8075872 0.0002937
## Manual 6-spd-Automatic (S7)                       -3.8463325 0.0000281
## Automatic (variable gear ratios)-Automatic (S8)    1.9745801 0.9999992
## Automatic 3-spd-Automatic (S8)                    -2.9110792 0.0000000
## Automatic 4-spd-Automatic (S8)                    -1.1524435 0.0000000
## Automatic 5-spd-Automatic (S8)                    -2.5210551 0.0000000
## Automatic 6-spd-Automatic (S8)                    -0.4452637 0.0255042
## Manual 4-spd-Automatic (S8)                        0.9026451 0.6063586
## Manual 5-spd-Automatic (S8)                       -0.7166786 0.0000021
## Manual 6-spd-Automatic (S8)                       -1.6977757 0.0000000
## Automatic 3-spd-Automatic (variable gear ratios)  -3.0815845 0.0000000
## Automatic 4-spd-Automatic (variable gear ratios)  -1.3027335 0.0000000
## Automatic 5-spd-Automatic (variable gear ratios)  -2.6940540 0.0000000
## Automatic 6-spd-Automatic (variable gear ratios)  -0.7696983 0.0151649
## Manual 4-spd-Automatic (variable gear ratios)      0.6371774 0.3479240
## Manual 5-spd-Automatic (variable gear ratios)     -0.8519888 0.0000023
## Manual 6-spd-Automatic (variable gear ratios)     -1.8437859 0.0000000
## Automatic 4-spd-Automatic 3-spd                    3.1044981 0.0000035
## Automatic 5-spd-Automatic 3-spd                    1.7415467 0.9999861
## Automatic 6-spd-Automatic 3-spd                    3.8493059 0.9561417
## Manual 4-spd-Automatic 3-spd                       5.1855619 0.3576429
## Manual 5-spd-Automatic 3-spd                       3.5363200 0.0000000
## Manual 6-spd-Automatic 3-spd                       2.5580577 0.0037010
## Automatic 5-spd-Automatic 4-spd                   -0.3253807 0.0013390
## Automatic 6-spd-Automatic 4-spd                    1.9118906 0.4340852
## Manual 4-spd-Automatic 4-spd                       3.2038540 1.0000000
## Manual 5-spd-Automatic 4-spd                       1.4216918 0.8304133
## Manual 6-spd-Automatic 4-spd                       0.4582712 0.9354953
## Automatic 6-spd-Automatic 5-spd                    3.4840568 0.9051236
## Manual 4-spd-Automatic 5-spd                       4.8266633 0.7010553
## Manual 5-spd-Automatic 5-spd                       3.1939364 0.0000000
## Manual 6-spd-Automatic 5-spd                       2.2140895 0.1946702
## Manual 4-spd-Automatic 6-spd                      14.4811819 0.4219805
## Manual 5-spd-Automatic 6-spd                      14.1924128 0.2683195
## Manual 6-spd-Automatic 6-spd                      13.1536675 0.6130770
## Manual 5-spd-Manual 4-spd                          2.9582607 1.0000000
## Manual 6-spd-Manual 4-spd                          1.9376631 0.9998672
## Manual 6-spd-Manual 5-spd                         -0.2006347 0.0021487
## 
## $make
##                                                    diff         lwr
## Alfa Romeo-Acura                             -1.4703197  -2.5842516
## AM General-Acura                             -1.2117678  -3.8952968
## American Motors Corporation-Acura            -1.6630637  -2.9755040
## ASC Incorporated-Acura                       -4.2900934 -10.8033390
## Aston Martin-Acura                           -6.4947868  -7.2258738
## Audi-Acura                                   -1.0394057  -1.5236874
## AM General-Alfa Romeo                         0.2585519  -2.5924010
## American Motors Corporation-Alfa Romeo       -0.1927440  -1.8203508
## ASC Incorporated-Alfa Romeo                  -2.8197737  -9.4037673
## Aston Martin-Alfa Romeo                      -5.0244671  -6.2332237
## Audi-Alfa Romeo                               0.4309140  -0.6466449
## American Motors Corporation-AM General       -0.4512959  -3.3855057
## ASC Incorporated-AM General                  -3.0783256 -10.1003948
## Aston Martin-AM General                      -5.2830190  -8.0072760
## Audi-AM General                               0.1723621  -2.4962736
## ASC Incorporated-American Motors Corporation -2.6270297  -9.2475000
## Aston Martin-American Motors Corporation     -4.8317231  -6.2255480
## Audi-American Motors Corporation              0.6236580  -0.6580550
## Aston Martin-ASC Incorporated                -2.2046934  -8.7348247
## Audi-ASC Incorporated                         3.2506878  -3.2564357
## Audi-Aston Martin                             5.4553811   4.7810095
##                                                     upr     p adj
## Alfa Romeo-Acura                             -0.3563879 0.0019795
## AM General-Acura                              1.4717612 0.8358068
## American Motors Corporation-Acura            -0.3506235 0.0036139
## ASC Incorporated-Acura                        2.2231521 0.4502217
## Aston Martin-Acura                           -5.7636998 0.0000000
## Audi-Acura                                   -0.5551240 0.0000000
## AM General-Alfa Romeo                         3.1095047 0.9999697
## American Motors Corporation-Alfa Romeo        1.4348628 0.9998544
## ASC Incorporated-Alfa Romeo                   3.7642198 0.8676015
## Aston Martin-Alfa Romeo                      -3.8157105 0.0000000
## Audi-Alfa Romeo                               1.5084729 0.9011487
## American Motors Corporation-AM General        2.4829139 0.9993379
## ASC Incorporated-AM General                   3.9437435 0.8542677
## Aston Martin-AM General                      -2.5587620 0.0000003
## Audi-AM General                               2.8409979 0.9999960
## ASC Incorporated-American Motors Corporation  3.9934406 0.9044533
## Aston Martin-American Motors Corporation     -3.4378982 0.0000000
## Audi-American Motors Corporation              1.9053711 0.7812540
## Aston Martin-ASC Incorporated                 4.3254380 0.9545769
## Audi-ASC Incorporated                         9.7578113 0.7592058
## Audi-Aston Martin                             6.1297528 0.0000000
# Plot the results
f1 = TukeyHSD(modelcylf, which="cyl", ordered = FALSE)
f2 = TukeyHSD(modeldrf, which="drive",ordered = FALSE)
f3= TukeyHSD(modeltrf, which="trans",ordered = FALSE)
plot(f1)

plot(f2)

plot(f3)

m1 = TukeyHSD(modelcylm, which="cyl", ordered = FALSE)
m2 = TukeyHSD(modeldrm, which="drive",ordered = FALSE)
m3= TukeyHSD(modeltrm, which="trans",ordered = FALSE)
plot(m1)

plot(m2)

plot(m3)

# Tukey's test for Q2

TukeyHSD(modelQ2, ordered = FALSE, conf.level = 0.95)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = cty ~ year, data = L)
## 
## $year
##                    diff          lwr       upr     p adj
## 1985-1984 -2.421667e+00 -6.014298777  1.170965 0.7695208
## 1986-1984  8.392857e-01 -2.917196363  4.595768 1.0000000
## 1987-1984 -3.795045e-01 -3.674454037  2.915445 1.0000000
## 1988-1984 -3.750000e-01 -4.004106468  3.254106 1.0000000
## 1989-1984 -4.216667e-01 -4.014298777  3.170965 1.0000000
## 1990-1984  6.805556e-01 -3.239327442  4.600439 1.0000000
## 1991-1984 -3.242754e-01 -3.992616554  3.344066 1.0000000
## 1992-1984  2.183333e-01 -3.374298777  3.810965 1.0000000
## 1993-1984  1.121795e-01 -3.446452185  3.670811 1.0000000
## 1994-1984  5.833333e-01 -3.045773135  4.212440 1.0000000
## 1995-1984  4.583333e-01 -3.170773135  4.087440 1.0000000
## 1996-1984  6.688596e-01 -3.191627747  4.529347 1.0000000
## 1997-1984  2.797619e-01 -3.217332592  3.776856 1.0000000
## 1998-1984  2.159091e-01 -3.156693501  3.588512 1.0000000
## 1999-1984  7.797619e-01 -2.717332592  4.276856 1.0000000
## 2000-1984 -5.113636e-01 -3.883966228  2.861239 1.0000000
## 2001-1984  1.583333e-01 -3.284539360  3.601206 1.0000000
## 2002-1984 -1.223118e-01 -3.540415331  3.295792 1.0000000
## 2003-1984 -9.464286e-01 -4.163287635  2.270430 0.9999999
## 2004-1984  7.361111e-01 -2.576794682  4.049017 1.0000000
## 2005-1984  4.583333e-01 -2.719294274  3.635961 1.0000000
## 2006-1984  4.320175e-01 -2.845830059  3.709865 1.0000000
## 2007-1984  8.333333e-02 -3.162638171  3.329305 1.0000000
## 2008-1984  1.900407e-01 -3.041052373  3.421134 1.0000000
## 2009-1984  6.527778e-01 -2.660128016  3.965684 1.0000000
## 2010-1984  1.510965e+00 -1.766882690  4.788813 0.9980447
## 2011-1984  1.555894e+00 -1.675198714  4.786987 0.9959597
## 2012-1984  1.528101e+00 -1.675127469  4.731329 0.9965296
## 2013-1984  3.284420e+00  0.118829194  6.450011 0.0304282
## 2014-1984  3.349638e+00  0.184046585  6.515229 0.0228699
## 2015-1984  3.258333e+00 -1.473442590  7.990109 0.7295966
## 1986-1985  3.260952e+00 -0.460304036  6.982209 0.2023077
## 1987-1985  2.042162e+00 -1.212570415  5.296895 0.8761663
## 1988-1985  2.046667e+00 -1.545965444  5.639299 0.9564925
## 1989-1985  2.000000e+00 -1.555783628  5.555784 0.9627766
## 1990-1985  3.102222e+00 -0.783916535  6.988361 0.3939305
## 1991-1985  2.097391e+00 -1.534869538  5.729652 0.9489058
## 1992-1985  2.640000e+00 -0.915783628  6.195784 0.5655746
## 1993-1985  2.533846e+00 -0.987581271  6.055274 0.6373928
## 1994-1985  3.005000e+00 -0.587632110  6.597632 0.2908839
## 1995-1985  2.880000e+00 -0.712632110  6.472632 0.3842337
## 1996-1985  3.090526e+00 -0.735693053  6.916746 0.3669647
## 1997-1985  2.701429e+00 -0.757799903  6.160657 0.4454747
## 1998-1985  2.637576e+00 -0.695746904  5.970898 0.4144544
## 1999-1985  3.201429e+00 -0.257799903  6.660657 0.1216151
## 2000-1985  1.910303e+00 -1.423019632  5.243626 0.9532663
## 2001-1985  2.580000e+00 -0.824403634  5.984404 0.5170103
## 2002-1985  2.299355e+00 -1.079997656  5.678707 0.7524215
## 2003-1985  1.475238e+00 -1.700415217  4.650891 0.9977693
## 2004-1985  3.157778e+00 -0.115131711  6.430687 0.0773496
## 2005-1985  2.880000e+00 -0.255906398  6.015906 0.1313828
## 2006-1985  2.853684e+00 -0.383733994  6.091102 0.1923709
## 2007-1985  2.505000e+00 -0.700140048  5.710140 0.4435834
## 2008-1985  2.611707e+00 -0.578363818  5.801778 0.3367714
## 2009-1985  3.074444e+00 -0.198465044  6.347354 0.1041247
## 2010-1985  3.932632e+00  0.695213374  7.170050 0.0019898
## 2011-1985  3.977561e+00  0.787489840  7.167632 0.0011424
## 2012-1985  3.949767e+00  0.787922584  7.111612 0.0010964
## 2013-1985  5.706087e+00  2.582377829  8.829796 0.0000000
## 2014-1985  5.771304e+00  2.647595220  8.895013 0.0000000
## 2015-1985  5.680000e+00  0.976140403 10.383860 0.0022490
## 1987-1986 -1.218790e+00 -4.653529839  2.215949 0.9999887
## 1988-1986 -1.214286e+00 -4.970767791  2.542196 0.9999986
## 1989-1986 -1.260952e+00 -4.982208798  2.460304 0.9999960
## 1990-1986 -1.587302e-01 -4.196827056  3.879367 1.0000000
## 1991-1986 -1.163561e+00 -4.957961021  2.630839 0.9999996
## 1992-1986 -6.209524e-01 -4.342208798  3.100304 1.0000000
## 1993-1986 -7.271062e-01 -4.415548069  2.961336 1.0000000
## 1994-1986 -2.559524e-01 -4.012434458  3.500530 1.0000000
## 1995-1986 -3.809524e-01 -4.137434458  3.375530 1.0000000
## 1996-1986 -1.704261e-01 -4.150891713  3.810040 1.0000000
## 1997-1986 -5.595238e-01 -4.188630278  3.069583 1.0000000
## 1998-1986 -6.233766e-01 -4.132677420  2.885924 1.0000000
## 1999-1986 -5.952381e-02 -3.688630278  3.569583 1.0000000
## 2000-1986 -1.350649e+00 -4.859950148  2.158651 0.9999358
## 2001-1986 -6.809524e-01 -4.257838767  2.895934 1.0000000
## 2002-1986 -9.615975e-01 -4.514649104  2.591454 1.0000000
## 2003-1986 -1.785714e+00 -5.145613998  1.574185 0.9822807
## 2004-1986 -1.031746e-01 -3.555143409  3.348794 1.0000000
## 2005-1986 -3.809524e-01 -3.703310136  2.941405 1.0000000
## 2006-1986 -4.072682e-01 -3.825605302  3.011069 1.0000000
## 2007-1986 -7.559524e-01 -4.143735557  2.631831 1.0000000
## 2008-1986 -6.492451e-01 -4.022775257  2.724285 1.0000000
## 2009-1986 -1.865079e-01 -3.638476742  3.265461 1.0000000
## 2010-1986  6.716792e-01 -2.746657934  4.090016 1.0000000
## 2011-1986  7.166086e-01 -2.656921598  4.090139 1.0000000
## 2012-1986  6.888151e-01 -2.658036448  4.035667 1.0000000
## 2013-1986  2.445135e+00 -0.865712873  5.755982 0.5779870
## 2014-1986  2.510352e+00 -0.800495482  5.821199 0.5158209
## 2015-1986  2.419048e+00 -2.411112547  7.249208 0.9925214
## 1988-1987  4.504505e-03 -3.290445028  3.299454 1.0000000
## 1989-1987 -4.216216e-02 -3.296894739  3.212570 1.0000000
## 1990-1987  1.060060e+00 -2.552662096  4.672782 0.9999999
## 1991-1987  5.522914e-02 -3.282884961  3.393343 1.0000000
## 1992-1987  5.978378e-01 -2.656894739  3.852570 1.0000000
## 1993-1987  4.916840e-01 -2.725479051  3.708847 1.0000000
## 1994-1987  9.628378e-01 -2.332111695  4.257787 0.9999999
## 1995-1987  8.378378e-01 -2.457111695  4.132787 1.0000000
## 1996-1987  1.048364e+00 -2.499824342  4.596553 0.9999998
## 1997-1987  6.592664e-01 -2.489693511  3.808226 1.0000000
## 1998-1987  5.954136e-01 -2.414690540  3.605518 1.0000000
## 1999-1987  1.159266e+00 -1.989693511  4.308226 0.9999748
## 2000-1987 -1.318591e-01 -3.141963268  2.878245 1.0000000
## 2001-1987  5.378378e-01 -2.550794715  3.626470 1.0000000
## 2002-1987  2.571927e-01 -2.803805563  3.318191 1.0000000
## 2003-1987 -5.669241e-01 -3.401436530  2.267588 1.0000000
## 2004-1987  1.115616e+00 -1.827448003  4.058679 0.9999532
## 2005-1987  8.378378e-01 -1.952071816  3.627747 0.9999998
## 2006-1987  8.115220e-01 -2.092021230  3.715065 1.0000000
## 2007-1987  4.628378e-01 -2.404671477  3.330347 1.0000000
## 2008-1987  5.695452e-01 -2.281111048  3.420201 1.0000000
## 2009-1987  1.032282e+00 -1.910781336  3.975346 0.9999912
## 2010-1987  1.890469e+00 -1.013073862  4.794013 0.8265272
## 2011-1987  1.935399e+00 -0.915257390  4.786055 0.7564605
## 2012-1987  1.907605e+00 -0.911428215  4.726639 0.7625205
## 2013-1987  3.663925e+00  0.887732140  6.440117 0.0003045
## 2014-1987  3.729142e+00  0.952949532  6.505335 0.0001954
## 2015-1987  3.637838e+00 -0.842785116  8.118461 0.3553105
## 1989-1988 -4.666667e-02 -3.639298777  3.545965 1.0000000
## 1990-1988  1.055556e+00 -2.864327442  4.975439 1.0000000
## 1991-1988  5.072464e-02 -3.617616554  3.719066 1.0000000
## 1992-1988  5.933333e-01 -2.999298777  4.185965 1.0000000
## 1993-1988  4.871795e-01 -3.071452185  4.045811 1.0000000
## 1994-1988  9.583333e-01 -2.670773135  4.587440 1.0000000
## 1995-1988  8.333333e-01 -2.795773135  4.462440 1.0000000
## 1996-1988  1.043860e+00 -2.816627747  4.904347 1.0000000
## 1997-1988  6.547619e-01 -2.842332592  4.151856 1.0000000
## 1998-1988  5.909091e-01 -2.781693501  3.963512 1.0000000
## 1999-1988  1.154762e+00 -2.342332592  4.651856 0.9999978
## 2000-1988 -1.363636e-01 -3.508966228  3.236239 1.0000000
## 2001-1988  5.333333e-01 -2.909539360  3.976206 1.0000000
## 2002-1988  2.526882e-01 -3.165415331  3.670792 1.0000000
## 2003-1988 -5.714286e-01 -3.788287635  2.645430 1.0000000
## 2004-1988  1.111111e+00 -2.201794682  4.424017 0.9999968
## 2005-1988  8.333333e-01 -2.344294274  4.010961 1.0000000
## 2006-1988  8.070175e-01 -2.470830059  4.084865 1.0000000
## 2007-1988  4.583333e-01 -2.787638171  3.704305 1.0000000
## 2008-1988  5.650407e-01 -2.666052373  3.796134 1.0000000
## 2009-1988  1.027778e+00 -2.285128016  4.340684 0.9999995
## 2010-1988  1.885965e+00 -1.391882690  5.163813 0.9510177
## 2011-1988  1.930894e+00 -1.300198714  5.161987 0.9247348
## 2012-1988  1.903101e+00 -1.300127469  5.106329 0.9293827
## 2013-1988  3.659420e+00  0.493829194  6.825011 0.0052449
## 2014-1988  3.724638e+00  0.559046585  6.890229 0.0037595
## 2015-1988  3.633333e+00 -1.098442590  8.365109 0.4856819
## 1990-1989  1.102222e+00 -2.783916535  4.988361 0.9999999
## 1991-1989  9.739130e-02 -3.534869538  3.729652 1.0000000
## 1992-1989  6.400000e-01 -2.915783628  4.195784 1.0000000
## 1993-1989  5.338462e-01 -2.987581271  4.055274 1.0000000
## 1994-1989  1.005000e+00 -2.587632110  4.597632 1.0000000
## 1995-1989  8.800000e-01 -2.712632110  4.472632 1.0000000
## 1996-1989  1.090526e+00 -2.735693053  4.916746 0.9999999
## 1997-1989  7.014286e-01 -2.757799903  4.160657 1.0000000
## 1998-1989  6.375758e-01 -2.695746904  3.970898 1.0000000
## 1999-1989  1.201429e+00 -2.257799903  4.660657 0.9999930
## 2000-1989 -8.969697e-02 -3.423019632  3.243626 1.0000000
## 2001-1989  5.800000e-01 -2.824403634  3.984404 1.0000000
## 2002-1989  2.993548e-01 -3.079997656  3.678707 1.0000000
## 2003-1989 -5.247619e-01 -3.700415217  2.650891 1.0000000
## 2004-1989  1.157778e+00 -2.115131711  4.430687 0.9999894
## 2005-1989  8.800000e-01 -2.255906398  4.015906 1.0000000
## 2006-1989  8.536842e-01 -2.383733994  4.091102 1.0000000
## 2007-1989  5.050000e-01 -2.700140048  3.710140 1.0000000
## 2008-1989  6.117073e-01 -2.578363818  3.801778 1.0000000
## 2009-1989  1.074444e+00 -2.198465044  4.347354 0.9999980
## 2010-1989  1.932632e+00 -1.304786626  5.170050 0.9255932
## 2011-1989  1.977561e+00 -1.212510160  5.167632 0.8899149
## 2012-1989  1.949767e+00 -1.212077416  5.111612 0.8955449
## 2013-1989  3.706087e+00  0.582377829  6.829796 0.0031983
## 2014-1989  3.771304e+00  0.647595220  6.895013 0.0022567
## 2015-1989  3.680000e+00 -1.023859597  8.383860 0.4412228
## 1991-1990 -1.004831e+00 -4.961066004  2.951404 1.0000000
## 1992-1990 -4.622222e-01 -4.348360979  3.423917 1.0000000
## 1993-1990 -5.683761e-01 -4.423104119  3.286352 1.0000000
## 1994-1990 -9.722222e-02 -4.017105220  3.822661 1.0000000
## 1995-1990 -2.222222e-01 -4.142105220  3.697661 1.0000000
## 1996-1990 -1.169591e-02 -4.146720924  4.123329 1.0000000
## 1997-1990 -4.007937e-01 -4.198785077  3.397198 1.0000000
## 1998-1990 -4.646465e-01 -4.148329025  3.219036 1.0000000
## 1999-1990  9.920635e-02 -3.698785077  3.897198 1.0000000
## 2000-1990 -1.191919e+00 -4.875601752  2.491763 0.9999986
## 2001-1990 -5.222222e-01 -4.270347266  3.225903 1.0000000
## 2002-1990 -8.028674e-01 -4.528253339  2.922519 1.0000000
## 2003-1990 -1.626984e+00 -5.168629394  1.914661 0.9981562
## 2004-1990  5.555556e-02 -3.573550912  3.684662 1.0000000
## 2005-1990 -2.222222e-01 -3.728272161  3.283828 1.0000000
## 2006-1990 -2.485380e-01 -3.845669350  3.348593 1.0000000
## 2007-1990 -5.972222e-01 -4.165330960  2.970887 1.0000000
## 2008-1990 -4.905149e-01 -4.045093795  3.064064 1.0000000
## 2009-1990 -2.777778e-02 -3.656884246  3.601329 1.0000000
## 2010-1990  8.304094e-01 -2.766721982  4.427541 1.0000000
## 2011-1990  8.753388e-01 -2.679240136  4.429918 1.0000000
## 2012-1990  8.475452e-01 -2.681723847  4.376814 1.0000000
## 2013-1990  2.603865e+00 -0.891279890  6.099009 0.5575399
## 2014-1990  2.669082e+00 -0.826062499  6.164227 0.4987876
## 2015-1990  2.577778e+00 -2.380525596  7.536081 0.9870056
## 1992-1991  5.426087e-01 -3.089652146  4.174870 1.0000000
## 1993-1991  4.364548e-01 -3.162179992  4.035090 1.0000000
## 1994-1991  9.076087e-01 -2.760732496  4.575950 1.0000000
## 1995-1991  7.826087e-01 -2.885732496  4.450950 1.0000000
## 1996-1991  9.931350e-01 -2.904258512  4.890529 1.0000000
## 1997-1991  6.040373e-01 -2.933756291  4.141831 1.0000000
## 1998-1991  5.401845e-01 -2.874601277  3.954970 1.0000000
## 1999-1991  1.104037e+00 -2.433756291  4.641831 0.9999994
## 2000-1991 -1.870883e-01 -3.601874005  3.227697 1.0000000
## 2001-1991  4.826087e-01 -3.001596482  3.966814 1.0000000
## 2002-1991  2.019635e-01 -3.257768377  3.661695 1.0000000
## 2003-1991 -6.221532e-01 -3.883210642  2.638904 1.0000000
## 2004-1991  1.060386e+00 -2.295452936  4.416226 0.9999992
## 2005-1991  7.826087e-01 -2.439755430  4.004973 1.0000000
## 2006-1991  7.562929e-01 -2.564941540  4.077527 1.0000000
## 2007-1991  4.076087e-01 -2.882170073  3.697387 1.0000000
## 2008-1991  5.143160e-01 -2.760783294  3.789415 1.0000000
## 2009-1991  9.770531e-01 -2.378786269  4.332893 0.9999999
## 2010-1991  1.835240e+00 -1.485994172  5.156475 0.9702374
## 2011-1991  1.880170e+00 -1.394929635  5.155269 0.9522995
## 2012-1991  1.852376e+00 -1.395235989  5.099988 0.9558471
## 2013-1991  3.608696e+00  0.398200312  6.819191 0.0086589
## 2014-1991  3.673913e+00  0.463417703  6.884408 0.0063105
## 2015-1991  3.582609e+00 -1.179325442  8.344543 0.5343301
## 1993-1992 -1.061538e-01 -3.627581271  3.415274 1.0000000
## 1994-1992  3.650000e-01 -3.227632110  3.957632 1.0000000
## 1995-1992  2.400000e-01 -3.352632110  3.832632 1.0000000
## 1996-1992  4.505263e-01 -3.375693053  4.276746 1.0000000
## 1997-1992  6.142857e-02 -3.397799903  3.520657 1.0000000
## 1998-1992 -2.424242e-03 -3.335746904  3.330898 1.0000000
## 1999-1992  5.614286e-01 -2.897799903  4.020657 1.0000000
## 2000-1992 -7.296970e-01 -4.063019632  2.603626 1.0000000
## 2001-1992 -6.000000e-02 -3.464403634  3.344404 1.0000000
## 2002-1992 -3.406452e-01 -3.719997656  3.038707 1.0000000
## 2003-1992 -1.164762e+00 -4.340415217  2.010891 0.9999767
## 2004-1992  5.177778e-01 -2.755131711  3.790687 1.0000000
## 2005-1992  2.400000e-01 -2.895906398  3.375906 1.0000000
## 2006-1992  2.136842e-01 -3.023733994  3.451102 1.0000000
## 2007-1992 -1.350000e-01 -3.340140048  3.070140 1.0000000
## 2008-1992 -2.829268e-02 -3.218363818  3.161778 1.0000000
## 2009-1992  4.344444e-01 -2.838465044  3.707354 1.0000000
## 2010-1992  1.292632e+00 -1.944786626  4.530050 0.9998646
## 2011-1992  1.337561e+00 -1.852510160  4.527632 0.9996481
## 2012-1992  1.309767e+00 -1.852077416  4.471612 0.9997210
## 2013-1992  3.066087e+00 -0.057622171  6.189796 0.0630825
## 2014-1992  3.131304e+00  0.007595220  6.255013 0.0484632
## 2015-1992  3.040000e+00 -1.663859597  7.743860 0.8374086
## 1994-1993  4.711538e-01 -3.087477826  4.029786 1.0000000
## 1995-1993  3.461538e-01 -3.212477826  3.904786 1.0000000
## 1996-1993  5.566802e-01 -3.237632498  4.350993 1.0000000
## 1997-1993  1.675824e-01 -3.256321136  3.591486 1.0000000
## 1998-1993  1.037296e-01 -3.192919281  3.400378 1.0000000
## 1999-1993  6.675824e-01 -2.756321136  4.091486 1.0000000
## 2000-1993 -6.235431e-01 -3.920192008  2.673106 1.0000000
## 2001-1993  4.615385e-02 -3.322349977  3.414658 1.0000000
## 2002-1993 -2.344913e-01 -3.577675005  3.108692 1.0000000
## 2003-1993 -1.058608e+00 -4.195744948  2.078529 0.9999963
## 2004-1993  6.239316e-01 -2.611619399  3.859483 1.0000000
## 2005-1993  3.461538e-01 -2.750741831  3.443050 1.0000000
## 2006-1993  3.198381e-01 -2.879807319  3.519483 1.0000000
## 2007-1993 -2.884615e-02 -3.195828413  3.138136 1.0000000
## 2008-1993  7.786116e-02 -3.073869750  3.229592 1.0000000
## 2009-1993  5.405983e-01 -2.694952732  3.776149 1.0000000
## 2010-1993  1.398785e+00 -1.800859951  4.598431 0.9992334
## 2011-1993  1.443715e+00 -1.708016091  4.595446 0.9982450
## 2012-1993  1.415921e+00 -1.707236858  4.539079 0.9985330
## 2013-1993  3.172241e+00  0.087696653  6.256785 0.0344223
## 2014-1993  3.237458e+00  0.152914044  6.322002 0.0257808
## 2015-1993  3.146154e+00 -1.531788972  7.824097 0.7735187
## 1995-1994 -1.250000e-01 -3.754106468  3.504106 1.0000000
## 1996-1994  8.552632e-02 -3.774961080  3.946014 1.0000000
## 1997-1994 -3.035714e-01 -3.800665925  3.193523 1.0000000
## 1998-1994 -3.674242e-01 -3.740026835  3.005178 1.0000000
## 1999-1994  1.964286e-01 -3.300665925  3.693523 1.0000000
## 2000-1994 -1.094697e+00 -4.467299562  2.277906 0.9999985
## 2001-1994 -4.250000e-01 -3.867872693  3.017873 1.0000000
## 2002-1994 -7.056452e-01 -4.123748664  2.712458 1.0000000
## 2003-1994 -1.529762e+00 -4.746620969  1.687097 0.9967046
## 2004-1994  1.527778e-01 -3.160128016  3.465684 1.0000000
## 2005-1994 -1.250000e-01 -3.302627608  3.052628 1.0000000
## 2006-1994 -1.513158e-01 -3.429163392  3.126532 1.0000000
## 2007-1994 -5.000000e-01 -3.745971504  2.745972 1.0000000
## 2008-1994 -3.932927e-01 -3.624385706  2.837800 1.0000000
## 2009-1994  6.944444e-02 -3.243461349  3.382350 1.0000000
## 2010-1994  9.276316e-01 -2.350216024  4.205479 0.9999999
## 2011-1994  9.725610e-01 -2.258532048  4.203654 0.9999998
## 2012-1994  9.447674e-01 -2.258460802  4.147996 0.9999998
## 2013-1994  2.701087e+00 -0.464504140  5.866678 0.2509493
## 2014-1994  2.766304e+00 -0.399286748  5.931895 0.2071202
## 2015-1994  2.675000e+00 -2.056775923  7.406776 0.9603726
## 1996-1995  2.105263e-01 -3.649961080  4.071014 1.0000000
## 1997-1995 -1.785714e-01 -3.675665925  3.318523 1.0000000
## 1998-1995 -2.424242e-01 -3.615026835  3.130178 1.0000000
## 1999-1995  3.214286e-01 -3.175665925  3.818523 1.0000000
## 2000-1995 -9.696970e-01 -4.342299562  2.402906 0.9999999
## 2001-1995 -3.000000e-01 -3.742872693  3.142873 1.0000000
## 2002-1995 -5.806452e-01 -3.998748664  2.837458 1.0000000
## 2003-1995 -1.404762e+00 -4.621620969  1.812097 0.9992487
## 2004-1995  2.777778e-01 -3.035128016  3.590684 1.0000000
## 2005-1995 -1.421085e-14 -3.177627608  3.177628 1.0000000
## 2006-1995 -2.631579e-02 -3.304163392  3.251532 1.0000000
## 2007-1995 -3.750000e-01 -3.620971504  2.870972 1.0000000
## 2008-1995 -2.682927e-01 -3.499385706  2.962800 1.0000000
## 2009-1995  1.944444e-01 -3.118461349  3.507350 1.0000000
## 2010-1995  1.052632e+00 -2.225216024  4.330479 0.9999988
## 2011-1995  1.097561e+00 -2.133532048  4.328654 0.9999957
## 2012-1995  1.069767e+00 -2.133460802  4.272996 0.9999971
## 2013-1995  2.826087e+00 -0.339504140  5.991678 0.1718866
## 2014-1995  2.891304e+00 -0.274286748  6.056895 0.1387014
## 2015-1995  2.800000e+00 -1.931775923  7.531776 0.9324399
## 1997-1996 -3.890977e-01 -4.125756559  3.347561 1.0000000
## 1998-1996 -4.529506e-01 -4.073364543  3.167463 1.0000000
## 1999-1996  1.109023e-01 -3.625756559  3.847561 1.0000000
## 2000-1996 -1.180223e+00 -4.800637270  2.440191 0.9999983
## 2001-1996 -5.105263e-01 -4.196489088  3.175436 1.0000000
## 2002-1996 -7.911715e-01 -4.454009275  2.871666 1.0000000
## 2003-1996 -1.615288e+00 -5.091080420  1.860504 0.9977547
## 2004-1996  6.725146e-02 -3.497617957  3.632121 1.0000000
## 2005-1996 -2.105263e-01 -3.650041746  3.228989 1.0000000
## 2006-1996 -2.368421e-01 -3.769154957  3.295471 1.0000000
## 2007-1996 -5.855263e-01 -4.088279545  2.917227 1.0000000
## 2008-1996 -4.788190e-01 -3.967788947  3.010151 1.0000000
## 2009-1996 -1.608187e-02 -3.580951290  3.548788 1.0000000
## 2010-1996  8.421053e-01 -2.690207589  4.374418 1.0000000
## 2011-1996  8.870347e-01 -2.601935289  4.376005 1.0000000
## 2012-1996  8.592411e-01 -2.603939545  4.322422 1.0000000
## 2013-1996  2.615561e+00 -0.812837844  6.043959 0.5011139
## 2014-1996  2.680778e+00 -0.747620452  6.109177 0.4424440
## 2015-1996  2.589474e+00 -2.322008023  7.500955 0.9841516
## 1998-1997 -6.385281e-02 -3.293977332  3.166272 1.0000000
## 1999-1997  5.000000e-01 -2.859899712  3.859900 1.0000000
## 2000-1997 -7.911255e-01 -4.021250060  2.438999 1.0000000
## 2001-1997 -1.214286e-01 -3.424855359  3.181998 1.0000000
## 2002-1997 -4.020737e-01 -3.679677693  2.875530 1.0000000
## 2003-1997 -1.226190e+00 -4.293345249  1.840964 0.9998611
## 2004-1997  4.563492e-01 -2.711394621  3.624093 1.0000000
## 2005-1997  1.785714e-01 -2.847411614  3.204554 1.0000000
## 2006-1997  1.522556e-01 -2.978805054  3.283316 1.0000000
## 2007-1997 -1.964286e-01 -3.294103048  2.901246 1.0000000
## 2008-1997 -8.972125e-02 -3.171801442  2.992359 1.0000000
## 2009-1997  3.730159e-01 -2.794727955  3.540760 1.0000000
## 2010-1997  1.231203e+00 -1.899857686  4.362264 0.9999004
## 2011-1997  1.276132e+00 -1.805947784  4.358213 0.9997235
## 2012-1997  1.248339e+00 -1.804516734  4.301194 0.9997831
## 2013-1997  3.004658e+00 -0.008682477  6.017999 0.0518753
## 2014-1997  3.069876e+00  0.056534915  6.083217 0.0391612
## 2015-1997  2.978571e+00 -1.652730715  7.609874 0.8442948
## 1999-1998  5.638528e-01 -2.666271705  3.793977 1.0000000
## 2000-1998 -7.272727e-01 -3.822185122  2.367640 1.0000000
## 2001-1998 -5.757576e-02 -3.228917251  3.113766 1.0000000
## 2002-1998 -3.382209e-01 -3.482655056  2.806213 1.0000000
## 2003-1998 -1.162338e+00 -4.086754993  1.762080 0.9998764
## 2004-1998  5.202020e-01 -2.509547026  3.549951 1.0000000
## 2005-1998  2.424242e-01 -2.638782397  3.123631 1.0000000
## 2006-1998  2.161085e-01 -2.775265712  3.207483 1.0000000
## 2007-1998 -1.325758e-01 -3.088986672  2.823835 1.0000000
## 2008-1998 -2.586844e-02 -2.965935891  2.914199 1.0000000
## 2009-1998  4.368687e-01 -2.592880360  3.466618 1.0000000
## 2010-1998  1.295056e+00 -1.696318344  4.286430 0.9993587
## 2011-1998  1.339985e+00 -1.600082232  4.280053 0.9983915
## 2012-1998  1.312192e+00 -1.597225039  4.221608 0.9986605
## 2013-1998  3.068511e+00  0.200584862  5.936438 0.0193418
## 2014-1998  3.133729e+00  0.265802253  6.001655 0.0138934
## 2015-1998  3.042424e+00 -1.495608137  7.580457 0.7790697
## 2000-1999 -1.291126e+00 -4.521250060  1.938999 0.9998616
## 2001-1999 -6.214286e-01 -3.924855359  2.681998 1.0000000
## 2002-1999 -9.020737e-01 -4.179677693  2.375530 1.0000000
## 2003-1999 -1.726190e+00 -4.793345249  1.340964 0.9625014
## 2004-1999 -4.365079e-02 -3.211394621  3.124093 1.0000000
## 2005-1999 -3.214286e-01 -3.347411614  2.704554 1.0000000
## 2006-1999 -3.477444e-01 -3.478805054  2.783316 1.0000000
## 2007-1999 -6.964286e-01 -3.794103048  2.401246 1.0000000
## 2008-1999 -5.897213e-01 -3.671801442  2.492359 1.0000000
## 2009-1999 -1.269841e-01 -3.294727955  3.040760 1.0000000
## 2010-1999  7.312030e-01 -2.399857686  3.862264 1.0000000
## 2011-1999  7.761324e-01 -2.305947784  3.858213 1.0000000
## 2012-1999  7.483389e-01 -2.304516734  3.801194 1.0000000
## 2013-1999  2.504658e+00 -0.508682477  5.517999 0.3040594
## 2014-1999  2.569876e+00 -0.443465085  5.583217 0.2519282
## 2015-1999  2.478571e+00 -2.152730715  7.109874 0.9805119
## 2001-2000  6.696970e-01 -2.501644524  3.841038 1.0000000
## 2002-2000  3.890518e-01 -2.755382329  3.533486 1.0000000
## 2003-2000 -4.350649e-01 -3.359482266  2.489352 1.0000000
## 2004-2000  1.247475e+00 -1.782274299  4.277224 0.9997519
## 2005-2000  9.696970e-01 -1.911509670  3.850904 0.9999965
## 2006-2000  9.433812e-01 -2.047992985  3.934755 0.9999992
## 2007-2000  5.946970e-01 -2.361713944  3.551108 1.0000000
## 2008-2000  7.014043e-01 -2.238663163  3.641472 1.0000000
## 2009-2000  1.164141e+00 -1.865607632  4.193890 0.9999380
## 2010-2000  2.022329e+00 -0.969045616  5.013703 0.7642220
## 2011-2000  2.067258e+00 -0.872809505  5.007325 0.6873247
## 2012-2000  2.039464e+00 -0.869952312  4.948881 0.6936970
## 2013-2000  3.795784e+00  0.927857589  6.663710 0.0002838
## 2014-2000  3.861001e+00  0.993074980  6.728928 0.0001845
## 2015-2000  3.769697e+00 -0.768335409  8.307729 0.3053335
## 2002-2001 -2.806452e-01 -3.500333063  2.939043 1.0000000
## 2003-2001 -1.104762e+00 -4.109947567  1.900424 0.9999756
## 2004-2001  5.777778e-01 -2.530003331  3.685559 1.0000000
## 2005-2001  3.000000e-01 -2.663153023  3.263153 1.0000000
## 2006-2001  2.736842e-01 -2.796697448  3.344066 1.0000000
## 2007-2001 -7.500000e-02 -3.111328314  2.961328 1.0000000
## 2008-2001  3.170732e-02 -2.988709997  3.052125 1.0000000
## 2009-2001  4.944444e-01 -2.613336665  3.602226 1.0000000
## 2010-2001  1.352632e+00 -1.717750080  4.423013 0.9991187
## 2011-2001  1.397561e+00 -1.622856338  4.417978 0.9979148
## 2012-2001  1.369767e+00 -1.620822769  4.360358 0.9982480
## 2013-2001  3.126087e+00  0.175845337  6.076329 0.0224030
## 2014-2001  3.191304e+00  0.241062728  6.141546 0.0163191
## 2015-2001  3.100000e+00 -1.490496924  7.690497 0.7662139
## 2003-2002 -8.241167e-01 -3.800893530  2.152660 1.0000000
## 2004-2002  8.584229e-01 -2.221895648  3.938742 1.0000000
## 2005-2002  5.806452e-01 -2.353692075  3.514982 1.0000000
## 2006-2002  5.543294e-01 -2.488252214  3.596911 1.0000000
## 2007-2002  2.056452e-01 -2.802568396  3.213859 1.0000000
## 2008-2002  3.123525e-01 -2.679800580  3.304506 1.0000000
## 2009-2002  7.750896e-01 -2.305228981  3.855408 1.0000000
## 2010-2002  1.633277e+00 -1.409304846  4.675858 0.9796904
## 2011-2002  1.678206e+00 -1.313946922  4.670359 0.9640672
## 2012-2002  1.650413e+00 -1.311628751  4.612454 0.9669166
## 2013-2002  3.406732e+00  0.485433641  6.328031 0.0044541
## 2014-2002  3.471950e+00  0.550651032  6.393248 0.0030913
## 2015-2002  3.380645e+00 -1.191304225  7.952595 0.5751155
## 2004-2003  1.682540e+00 -1.172826017  4.537905 0.9355417
## 2005-2003  1.404762e+00 -1.292474773  4.101999 0.9866710
## 2006-2003  1.378446e+00 -1.436168137  4.193060 0.9947105
## 2007-2003  1.029762e+00 -1.747664869  3.807189 0.9999707
## 2008-2003  1.136469e+00 -1.623554438  3.896493 0.9997516
## 2009-2003  1.599206e+00 -1.256159350  4.454572 0.9647004
## 2010-2003  2.457393e+00 -0.357220768  5.272008 0.2086828
## 2011-2003  2.502323e+00 -0.257700780  5.262347 0.1489442
## 2012-2003  2.474529e+00 -0.252820954  5.201880 0.1478973
## 2013-2003  4.230849e+00  1.547802930  6.913895 0.0000015
## 2014-2003  4.296066e+00  1.613020321  6.979112 0.0000009
## 2015-2003  4.204762e+00 -0.218751616  8.628275 0.0915570
## 2005-2004 -2.777778e-01 -3.088871560  2.533316 1.0000000
## 2006-2004 -3.040936e-01 -3.227997797  2.619811 1.0000000
## 2007-2004 -6.527778e-01 -3.540902091  2.235347 1.0000000
## 2008-2004 -5.460705e-01 -3.417462660  2.325322 1.0000000
## 2009-2004 -8.333333e-02 -3.046486356  2.879820 1.0000000
## 2010-2004  7.748538e-01 -2.149050429  3.698758 1.0000000
## 2011-2004  8.197832e-01 -2.051609002  3.691175 0.9999999
## 2012-2004  7.919897e-01 -2.048010727  3.631990 1.0000000
## 2013-2004  2.548309e+00 -0.249171479  5.345790 0.1423299
## 2014-2004  2.613527e+00 -0.183954087  5.411007 0.1103208
## 2015-2004  2.522222e+00 -1.971621837  7.016066 0.9637527
## 2006-2005 -2.631579e-02 -2.796006813  2.743375 1.0000000
## 2007-2005 -3.750000e-01 -3.106892103  2.356892 1.0000000
## 2008-2005 -2.682927e-01 -2.982489725  2.445904 1.0000000
## 2009-2005  1.944444e-01 -2.616649338  3.005538 1.0000000
## 2010-2005  1.052632e+00 -1.717059444  3.822323 0.9999506
## 2011-2005  1.097561e+00 -1.616636066  3.811758 0.9998257
## 2012-2005  1.069767e+00 -1.611197802  3.750733 0.9998663
## 2013-2005  2.826087e+00  0.190205615  5.461968 0.0187358
## 2014-2005  2.891304e+00  0.255423007  5.527186 0.0130509
## 2015-2005  2.800000e+00 -1.595066193  7.195066 0.8571139
## 2007-2006 -3.486842e-01 -3.196525877  2.499157 1.0000000
## 2008-2006 -2.419769e-01 -3.072848362  2.588895 1.0000000
## 2009-2006  2.207602e-01 -2.703143996  3.144664 1.0000000
## 2010-2006  1.078947e+00 -1.805173998  3.963069 0.9999645
## 2011-2006  1.123877e+00 -1.706994704  3.954748 0.9998792
## 2012-2006  1.096083e+00 -1.702942016  3.895108 0.9999085
## 2013-2006  2.852403e+00  0.096529357  5.608276 0.0314864
## 2014-2006  2.917620e+00  0.161746748  5.673494 0.0226929
## 2015-2006  2.826316e+00 -1.641745819  7.294377 0.8662532
## 2008-2007  1.067073e-01 -2.687193070  2.900608 1.0000000
## 2009-2007  5.694444e-01 -2.318679868  3.457569 1.0000000
## 2010-2007  1.427632e+00 -1.420210087  4.275473 0.9924112
## 2011-2007  1.472561e+00 -1.321339411  4.266461 0.9842212
## 2012-2007  1.444767e+00 -1.316860417  4.206395 0.9857914
## 2013-2007  3.201087e+00  0.483204649  5.918969 0.0036872
## 2014-2007  3.266304e+00  0.548422040  5.984187 0.0024770
## 2015-2007  3.175000e+00 -1.269729534  7.619730 0.6534712
## 2009-2008  4.627371e-01 -2.408655072  3.334129 1.0000000
## 2010-2008  1.320924e+00 -1.509947207  4.151796 0.9975956
## 2011-2008  1.365854e+00 -1.410746869  4.142454 0.9943305
## 2012-2008  1.338060e+00 -1.406064426  4.082185 0.9950635
## 2013-2008  3.094380e+00  0.394284205  5.794475 0.0061453
## 2014-2008  3.159597e+00  0.459501596  5.859692 0.0041740
## 2015-2008  3.068293e+00 -1.365582795  7.502168 0.7198832
## 2010-2009  8.581871e-01 -2.065717096  3.782091 0.9999999
## 2011-2009  9.031165e-01 -1.968275669  3.774509 0.9999993
## 2012-2009  8.753230e-01 -1.964677394  3.715323 0.9999996
## 2013-2009  2.631643e+00 -0.165838145  5.429123 0.1025292
## 2014-2009  2.696860e+00 -0.100620754  5.494341 0.0780860
## 2015-2009  2.605556e+00 -1.888288503  7.099400 0.9464022
## 2011-2010  4.492940e-02 -2.785942072  2.875801 1.0000000
## 2012-2010  1.713586e-02 -2.781889384  2.816161 1.0000000
## 2013-2010  1.773455e+00 -0.982418012  4.529329 0.8434714
## 2014-2010  1.838673e+00 -0.917200621  4.594546 0.7874304
## 2015-2010  1.747368e+00 -2.720693187  6.215430 0.9999109
## 2012-2011 -2.779353e-02 -2.771918084  2.716331 1.0000000
## 2013-2011  1.728526e+00 -0.971569454  4.428621 0.8506492
## 2014-2011  1.793743e+00 -0.906352062  4.493839 0.7946651
## 2015-2011  1.702439e+00 -2.731436454  6.136315 0.9999389
## 2013-2012  1.756320e+00 -0.910368396  4.423007 0.8087538
## 2014-2012  1.821537e+00 -0.845151005  4.488225 0.7451067
## 2015-2012  1.730233e+00 -2.683378301  6.143843 0.9999064
## 2014-2013  6.521739e-02 -2.556141077  2.686576 1.0000000
## 2015-2013 -2.608696e-02 -4.412458648  4.360285 1.0000000
## 2015-2014 -9.130435e-02 -4.477676040  4.295067 1.0000000
f4 = TukeyHSD(modelQ2, which="year", ordered = FALSE)
plot (f4)

Results

Q1. There is a significant difference in mean between almost all levels of ‘number of cylinders’ except for just 2 pairs that have negligible difference in means. For the factor ‘drive’ there are just 3 pairs that have significant difference in means, rest all other pairs have not much difference.Transmission type also shows that there is no significant difference in means for most of the pairs. However there is are some levels for ‘Automatic’ transmission types that do deviate from other levels with a significant difference.

In conclusion, there exists a significant difference in many pairs of the treatment levels for all three factors.However, the number of pairs that do not show a significant difference in means are more, therefore we can conclude that our testing is appropriate.

Q2. The Tukey’s test for the difference in means of the factor year shows that there is no significant difference in means of any 2 pairs. This shows that our testing is appropriate.

Resampling

Although the dataset we are using is well randomized in the sense that it is a survey data so we can assume that it is a true representative of the whole population.

Contingencies

Based on the model adequacy testing, it seems that the data does deviate from normality in the fitted models of the residuals. Since normality is an assumption for using ANOVA tests therefore in order to verify the results of the ANOVA testing, a nonparametric analysis of multiple factors can be used.

A Kruskal-Wallis test can be used to evaluate whether groups’ distributions are identical, without the assumption that the data is normally distributed.

# Test for the transmission type

kruskal.test(cty~trans, data = L)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  cty by trans
## Kruskal-Wallis chi-squared = 188.9517, df = 18, p-value < 2.2e-16
# Test for drive type

kruskal.test(cty~drive, data = L)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  cty by drive
## Kruskal-Wallis chi-squared = 420.2375, df = 4, p-value < 2.2e-16
# Test for number of cylinders

kruskal.test(cty~cyl, data = L)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  cty by cyl
## Kruskal-Wallis chi-squared = 694.2979, df = 4, p-value < 2.2e-16
# Test for Q2 (year)

kruskal.test(cty~year, data = L)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  cty by year
## Kruskal-Wallis chi-squared = 100.1663, df = 31, p-value =
## 3.264e-09

The p-value of this Kruskal-Wallis test is less than an alpha of 0.05. Therefore, we must reject the null hypothesis- that variation in city gas mileage cannot be explained by anything other than randomization. Instead, all the three factors used in our initial ANOVA analysis can help in explaining variation in city gas mileage. Similarly for our second hypothesis we can reject the null hypothesis and conclude that the variation in city mileage can be explained by the factor ‘year’.

5. Appendices

The data from the fueleconomy data set is available at https://github.com/hadley/fueleconomy.