Recipe 3: Multiple Factors with multiple levels

This is an R Markdown document. Markdown is a simple formatting syntax for authoring web pages (click the MD toolbar button for help on Markdown).

When you click the Knit HTML button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

Recipes for the Design of Experiments: Recipe Outline

as of August 28, 2014, superceding the version of August 24. Always use the most recent version.

Analysis of Diamond Pricing in Singapore

Wei Zou

RPI

Oct 9 Version 1

1. Setting

System under test

In this study, we conduct an experiment to investigate the influencing factors of diamond stone prices in Singapore. To do so, the dataset “Diamond” under the “Ecdat” package in R was used and we examed the effect of “Color” and “Clarity” factors in this study.

install.packages("Ecdat")
## Installing package into 'C:/Users/wei/Documents/R/win-library/3.1'
## (as 'lib' is unspecified)
## Error: trying to use CRAN without setting a mirror
library("Ecdat", lib.loc="C:/Users/wei/Documents/R/win-library/3.1")
## Loading required package: Ecfun
## 
## Attaching package: 'Ecdat'
## 
## The following object is masked from 'package:datasets':
## 
##     Orange
data1<-data.frame(Diamond)
head(data1)
##   carat colour clarity certification price
## 1  0.30      D     VS2           GIA  1302
## 2  0.30      E     VS1           GIA  1510
## 3  0.30      G    VVS1           GIA  1510
## 4  0.30      G     VS1           GIA  1260
## 5  0.31      D     VS1           GIA  1641
## 6  0.31      E     VS1           GIA  1555

Factors and Levels

In this multi-factor, multi-level experiment, we exam the effects of two factors: “colour” with 6 levels and “clarity” with 5 levels.

data1$colour<-as.factor(data1$colour)
nlevels(data1$colour)
## [1] 6
data1$clarity<-as.factor(data1$clarity)
nlevels(data1$clarity)
## [1] 5

Continuous variables (if any)

In this study, the continuous variable is the response variable: “price” indicating the price of the diamond.

Response variables

The response variable is the “price” mentioned above.

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

Singfat Chu at the National University of Singapore used data pertaining to 308 diamond stones listed in an advertisement to conduct his study on the pricing of the C's of Diamond Stones. The dataset has information on the price of the diamond stone and 4Cs (Carat, Clarity, Colour and Cut) that charaterize the quality of a diamond stone. In this study, we focus on two of them: Colour and Clarity.

Randomization

The dataset was selected from an advertisement and thus the data were not collected under a well designed random experiment, we may conclude that the data are not random.

2. (Experimental) Design

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

To test the effect of colour and clarity on diamond pricing, we conduct a multi-factor, multi-level analysis of variance on the two factors and also investigate their interaction effect.

What is the rationale for this design?

Traditionally, 4C's are the factors that characterize the quality (and thus influence the price) of a diamond stone. Therefore, it is interesting for us to conduct this experiment to test the validity of thiscommon rule.

Randomize: What is the Randomization Scheme?

Since the data were not collected in a pre-designed experiment, they are not random.

Replicate: Are there replicates and/or repeated measures?

No, there are no replicated or repeated measures.

Block: Did you use blocking in the design?

No, since there's no obvious nuisance variable and the data size is relatively small.

3. (Statistical) Analysis

(Exploratory Data Analysis) Graphics and descriptive summary

For the first boxplot (by colour), the median of diamond price doesn't show much variance in different levels (different colors), indicating that the variation in diamond pricing might simply due to the sample randomization. For the second boxplot (by clarity), we can see that the median of the diamond price does show some variability among different clarity levels, indicating that the variation in the diamond pricing might have something to do with the clarity level.

boxplot(price~colour, data1)

plot of chunk unnamed-chunk-3

boxplot(price~clarity, data1)

plot of chunk unnamed-chunk-3

Testing

In this section we estimate three models to conduct the analysis of variance: the first two are used to test the effect of colour/clarity on diamond pricing separately and the third one is to test whehter there is an interaction effect between the diamond colour and clarity.

model_colour=aov(price~colour,data=data1)
model_clarity=aov(price~clarity,data=data1)
model_colour_clarity=aov(price~colour*clarity,data=data1)

Estimation (of Parameters)

According to the estimation results, we may conclude that the variation in diamond pricing may due the variation in diamond clarity levels and/or the interaction effect between the diamond colour and clarity. The first model estimation result shows that diamond colour itself might not be able to explain the variation in the pricing, in other words, the variation in pricing might simply due to the randomization of the sample.

summary(model_colour)
##              Df   Sum Sq  Mean Sq F value Pr(>F)  
## colour        5 1.08e+08 21645956     1.9  0.095 .
## Residuals   302 3.45e+09 11414561                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_clarity)
##              Df   Sum Sq  Mean Sq F value  Pr(>F)    
## clarity       4 3.00e+08 74917212    6.97 2.2e-05 ***
## Residuals   303 3.26e+09 10745078                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(model_colour_clarity)
##                 Df   Sum Sq  Mean Sq F value  Pr(>F)    
## colour           5 1.08e+08 21645956    2.16   0.058 .  
## clarity          4 2.96e+08 74015430    7.40 1.1e-05 ***
## colour:clarity  20 3.71e+08 18537589    1.85   0.016 *  
## Residuals      278 2.78e+09 10001382                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Diagnostics/Model Adequacy Checking

The qqplot and fitted Y vs. residuals plot show that our data generally follows the normal distribution assumption.

qqnorm(residuals(model_colour))
qqline(residuals(model_colour))

plot of chunk unnamed-chunk-6

qqnorm(residuals(model_clarity))
qqline(residuals(model_clarity))

plot of chunk unnamed-chunk-6

qqnorm(residuals(model_colour_clarity))
qqline(residuals(model_colour_clarity))

plot of chunk unnamed-chunk-6

plot(fitted(model_colour),residuals(model_colour))

plot of chunk unnamed-chunk-6

plot(fitted(model_clarity),residuals(model_clarity))

plot of chunk unnamed-chunk-6

plot(fitted(model_colour_clarity),residuals(model_colour_clarity))

plot of chunk unnamed-chunk-6

###Interaction Plot The interaction plot shows that the interaction effect does exist, which is consistent with our analysis of variance result.

interaction.plot(data1$colour,data1$clarity,data1$price, xlab= "Colour", ylab="Price", main ="Interaction plot", trace.label="Clarity")

plot of chunk unnamed-chunk-7

###Post-Hoc Test The purpose of Tukey's HSD test is to determine which groups in the sample differ. While ANOVA can tell the researcher whether groups in the sample differ, it cannot tell the researcher which groups differ.

TukeyHSD(model_colour_clarity)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = price ~ colour * clarity, data = data1)
## 
## $colour
##        diff   lwr    upr  p adj
## E-D -1591.9 -4241 1057.5 0.5169
## F-D -2313.5 -4794  166.9 0.0832
## G-D -2673.7 -5206 -140.9 0.0318
## H-D -2134.9 -4684  414.2 0.1586
## I-D -1924.8 -4609  759.7 0.3128
## F-E  -721.5 -2418  974.4 0.8264
## G-E -1081.7 -2853  690.0 0.4986
## H-E  -542.9 -2338 1252.1 0.9538
## I-E  -332.9 -2316 1649.8 0.9968
## G-F  -360.2 -1867 1147.0 0.9834
## H-F   178.6 -1356 1713.1 0.9994
## I-F   388.6 -1362 2138.9 0.9881
## H-G   538.8 -1079 2156.7 0.9313
## I-G   748.8 -1075 2572.6 0.8469
## I-H   210.0 -1636 2056.4 0.9995
## 
## $clarity
##             diff     lwr  upr  p adj
## VS1-IF    2152.6   526.3 3779 0.0030
## VS2-IF    3103.3  1332.3 4874 0.0000
## VVS1-IF   2885.7  1107.1 4664 0.0001
## VVS2-IF   2622.6   985.4 4260 0.0002
## VS2-VS1    950.7  -583.4 2485 0.4346
## VVS1-VS1   733.2  -809.8 2276 0.6885
## VVS2-VS1   470.0  -907.5 1848 0.8823
## VVS1-VS2  -217.5 -1912.5 1477 0.9967
## VVS2-VS2  -480.7 -2026.5 1065 0.9132
## VVS2-VVS1 -263.2 -1817.8 1291 0.9904
## 
## $`colour:clarity`
##                     diff      lwr     upr  p adj
## E:IF-D:IF      -7653.600 -20779.7  5472.5 0.9264
## F:IF-D:IF      -6095.750 -18805.1  6613.6 0.9937
## G:IF-D:IF      -8039.909 -20555.2  4475.4 0.8192
## H:IF-D:IF      -7431.909 -19947.2  5083.4 0.9113
## I:IF-D:IF      -7393.250 -20102.6  5316.1 0.9282
## D:VS1-D:IF     -5411.857 -18221.7  7397.9 0.9992
## E:VS1-D:IF     -4362.611 -16673.4  7948.2 1.0000
## F:VS1-D:IF     -4916.440 -17136.2  7303.3 0.9997
## G:VS1-D:IF     -5631.750 -18103.5  6840.0 0.9975
## H:VS1-D:IF     -4445.182 -16960.5  8070.1 1.0000
## I:VS1-D:IF     -4408.250 -17117.6  8301.1 1.0000
## D:VS2-D:IF     -7489.000 -22164.5  7186.5 0.9850
## E:VS2-D:IF     -3575.714 -16385.5  9234.1 1.0000
## F:VS2-D:IF     -3969.857 -16372.9  8433.2 1.0000
## G:VS2-D:IF     -3980.444 -16611.1  8650.2 1.0000
## H:VS2-D:IF     -3649.071 -16052.1  8754.0 1.0000
## I:VS2-D:IF     -4417.857 -17227.7  8391.9 1.0000
## D:VVS1-D:IF     5910.000  -8765.5 20585.5 0.9997
## E:VVS1-D:IF    -1823.200 -14949.3 11302.9 1.0000
## F:VVS1-D:IF    -5395.278 -17706.1  6915.5 0.9985
## G:VVS1-D:IF    -5316.500 -17788.3  7155.3 0.9990
## H:VVS1-D:IF    -4974.600 -17541.9  7592.7 0.9997
## I:VVS1-D:IF    -3309.600 -16435.7  9816.5 1.0000
## D:VVS2-D:IF     -880.250 -14277.1 12516.6 1.0000
## E:VVS2-D:IF    -4627.778 -17258.4  8002.9 0.9999
## F:VVS2-D:IF    -5512.647 -17842.5  6817.2 0.9979
## G:VVS2-D:IF    -4722.905 -16987.4  7541.5 0.9998
## H:VVS2-D:IF    -4575.867 -16951.3  7799.6 0.9999
## I:VVS2-D:IF    -3876.167 -16347.9  8595.6 1.0000
## F:IF-E:IF       1557.850  -5273.2  8388.9 1.0000
## G:IF-E:IF       -386.309  -6849.2  6076.6 1.0000
## H:IF-E:IF        221.691  -6241.2  6684.6 1.0000
## I:IF-E:IF        260.350  -6570.7  7091.4 1.0000
## D:VS1-E:IF      2241.743  -4774.5  9258.0 1.0000
## E:VS1-E:IF      3290.989  -2766.5  9348.4 0.9667
## F:VS1-E:IF      2737.160  -3133.0  8607.3 0.9959
## G:VS1-E:IF      2021.850  -4356.3  8400.0 1.0000
## H:VS1-E:IF      3208.418  -3254.4  9671.3 0.9897
## I:VS1-E:IF      3245.350  -3585.7 10076.4 0.9946
## D:VS2-E:IF       164.600  -9860.7 10189.9 1.0000
## E:VS2-E:IF      4077.886  -2938.3 11094.1 0.9288
## F:VS2-E:IF      3683.743  -2559.0  9926.5 0.9168
## G:VS2-E:IF      3673.156  -3010.3 10356.7 0.9618
## H:VS2-E:IF      4004.529  -2238.2 10247.3 0.8214
## I:VS2-E:IF      3235.743  -3780.5 10252.0 0.9966
## D:VVS1-E:IF    13563.600   3538.3 23588.9 0.0002
## E:VVS1-E:IF     5830.400  -1748.0 13408.8 0.4561
## F:VVS1-E:IF     2258.322  -3799.1  8315.8 0.9999
## G:VVS1-E:IF     2337.100  -4041.1  8715.3 0.9999
## H:VVS1-E:IF     2679.000  -3884.1  9242.1 0.9996
## I:VVS1-E:IF     4344.000  -3234.4 11922.4 0.9386
## D:VVS2-E:IF     6773.350  -1264.7 14811.4 0.2622
## E:VVS2-E:IF     3025.822  -3657.7  9709.3 0.9974
## F:VVS2-E:IF     2140.953  -3955.1  8237.0 1.0000
## G:VVS2-E:IF     2930.695  -3031.9  8893.3 0.9911
## H:VVS2-E:IF     3077.733  -3110.0  9265.5 0.9895
## I:VVS2-E:IF     3777.433  -2600.7 10155.6 0.9137
## G:IF-F:IF      -1944.159  -7511.9  3623.6 1.0000
## H:IF-F:IF      -1336.159  -6903.9  4231.6 1.0000
## I:IF-F:IF      -1297.500  -7288.7  4693.7 1.0000
## D:VS1-F:IF       683.893  -5517.6  6885.4 1.0000
## E:VS1-F:IF      1733.139  -3358.4  6824.7 1.0000
## F:VS1-F:IF      1179.310  -3688.0  6046.6 1.0000
## G:VS1-F:IF       464.000  -5005.2  5933.2 1.0000
## H:VS1-F:IF      1650.568  -3917.2  7218.3 1.0000
## I:VS1-F:IF      1687.500  -4303.7  7678.7 1.0000
## D:VS2-F:IF     -1393.250 -10866.2  8079.7 1.0000
## E:VS2-F:IF      2520.036  -3681.5  8721.6 0.9996
## F:VS2-F:IF      2125.893  -3184.8  7436.6 0.9997
## G:VS2-F:IF      2115.306  -3707.1  7937.7 1.0000
## H:VS2-F:IF      2446.679  -2864.0  7757.3 0.9966
## I:VS2-F:IF      1677.893  -4523.6  7879.4 1.0000
## D:VVS1-F:IF    12005.750   2532.8 21478.7 0.0010
## E:VVS1-F:IF     4272.550  -2558.5 11103.6 0.8558
## F:VVS1-F:IF      700.472  -4391.1  5792.0 1.0000
## G:VVS1-F:IF      779.250  -4690.0  6248.5 1.0000
## H:VVS1-F:IF     1121.150  -4562.6  6804.9 1.0000
## I:VVS1-F:IF     2786.150  -4044.9  9617.2 0.9996
## D:VVS2-F:IF     5215.500  -2122.2 12553.2 0.6339
## E:VVS2-F:IF     1467.972  -4354.5  7290.4 1.0000
## F:VVS2-F:IF      583.103  -4554.3  5720.5 1.0000
## G:VVS2-F:IF     1372.845  -3605.6  6351.3 1.0000
## H:VVS2-F:IF     1519.883  -3726.0  6765.8 1.0000
## I:VVS2-F:IF     2219.583  -3249.6  7688.8 0.9996
## H:IF-G:IF        608.000  -4501.3  5717.3 1.0000
## I:IF-G:IF        646.659  -4921.1  6214.4 1.0000
## D:VS1-G:IF      2628.052  -3165.4  8421.5 0.9973
## E:VS1-G:IF      3677.298   -908.5  8263.1 0.3635
## F:VS1-G:IF      3123.469  -1212.0  7458.9 0.6046
## G:VS1-G:IF      2408.159  -2593.6  7409.9 0.9934
## H:VS1-G:IF      3594.727  -1514.6  8704.1 0.6555
## I:VS1-G:IF      3631.659  -1936.1  9199.4 0.7960
## D:VS2-G:IF       550.909  -8660.1  9761.9 1.0000
## E:VS2-G:IF      4464.195  -1329.3 10257.6 0.4525
## F:VS2-G:IF      4070.052   -757.8  8897.9 0.2613
## G:VS2-G:IF      4059.465  -1326.3  9445.2 0.5029
## H:VS2-G:IF      4390.838   -437.0  9218.7 0.1394
## I:VS2-G:IF      3622.052  -2171.4  9415.5 0.8563
## D:VVS1-G:IF    13949.909   4738.9 23160.9 0.0000
## E:VVS1-G:IF     6216.709   -246.2 12679.6 0.0787
## F:VVS1-G:IF     2644.631  -1941.1  7230.4 0.9344
## G:VVS1-G:IF     2723.409  -2278.4  7725.2 0.9658
## H:VVS1-G:IF     3065.309  -2170.2  8300.8 0.9232
## I:VVS1-G:IF     4730.309  -1732.6 11193.2 0.5696
## D:VVS2-G:IF     7159.659    163.4 14155.9 0.0373
## E:VVS2-G:IF     3412.131  -1973.6  8797.9 0.8389
## F:VVS2-G:IF     2527.262  -2109.4  7163.9 0.9654
## G:VVS2-G:IF     3317.004  -1142.8  7776.8 0.5333
## H:VVS2-G:IF     3464.042  -1292.5  8220.6 0.5808
## I:VVS2-G:IF     4163.742   -838.0  9165.5 0.2858
## I:IF-H:IF         38.659  -5529.1  5606.4 1.0000
## D:VS1-H:IF      2020.052  -3773.4  7813.5 1.0000
## E:VS1-H:IF      3069.298  -1516.5  7655.1 0.7525
## F:VS1-H:IF      2515.469  -1820.0  6850.9 0.9301
## G:VS1-H:IF      1800.159  -3201.6  6801.9 1.0000
## H:VS1-H:IF      2986.727  -2122.6  8096.1 0.9244
## I:VS1-H:IF      3023.659  -2544.1  8591.4 0.9669
## D:VS2-H:IF       -57.091  -9268.1  9153.9 1.0000
## E:VS2-H:IF      3856.195  -1937.3  9649.6 0.7622
## F:VS2-H:IF      3462.052  -1365.8  8289.9 0.6148
## G:VS2-H:IF      3451.465  -1934.3  8837.2 0.8228
## H:VS2-H:IF      3782.838  -1045.0  8610.7 0.4147
## I:VS2-H:IF      3014.052  -2779.4  8807.5 0.9806
## D:VVS1-H:IF    13341.909   4130.9 22552.9 0.0000
## E:VVS1-H:IF     5608.709   -854.2 12071.6 0.2095
## F:VVS1-H:IF     2036.631  -2549.1  6622.4 0.9981
## G:VVS1-H:IF     2115.409  -2886.4  7117.2 0.9992
## H:VVS1-H:IF     2457.309  -2778.2  7692.8 0.9955
## I:VVS1-H:IF     4122.309  -2340.6 10585.2 0.8295
## D:VVS2-H:IF     6551.659   -444.6 13547.9 0.1047
## E:VVS2-H:IF     2804.131  -2581.6  8189.9 0.9805
## F:VVS2-H:IF     1919.262  -2717.4  6555.9 0.9994
## G:VVS2-H:IF     2709.004  -1750.8  7168.8 0.8895
## H:VVS2-H:IF     2856.042  -1900.5  7612.6 0.9011
## I:VVS2-H:IF     3555.742  -1446.0  8557.5 0.6336
## D:VS1-I:IF      1981.393  -4220.1  8182.9 1.0000
## E:VS1-I:IF      3030.639  -2060.9  8122.2 0.9092
## F:VS1-I:IF      2476.810  -2390.5  7344.1 0.9856
## G:VS1-I:IF      1761.500  -3707.7  7230.7 1.0000
## H:VS1-I:IF      2948.068  -2619.7  8515.8 0.9758
## I:VS1-I:IF      2985.000  -3006.2  8976.2 0.9892
## D:VS2-I:IF       -95.750  -9568.7  9377.2 1.0000
## E:VS2-I:IF      3817.536  -2384.0 10019.1 0.8749
## F:VS2-I:IF      3423.393  -1887.3  8734.1 0.8141
## G:VS2-I:IF      3412.806  -2409.6  9235.2 0.9223
## H:VS2-I:IF      3744.179  -1566.5  9054.8 0.6511
## I:VS2-I:IF      2975.393  -3226.1  9176.9 0.9937
## D:VVS1-I:IF    13303.250   3830.3 22776.2 0.0001
## E:VVS1-I:IF     5570.050  -1261.0 12401.1 0.3279
## F:VVS1-I:IF     1997.972  -3093.6  7089.5 0.9998
## G:VVS1-I:IF     2076.750  -3392.5  7546.0 0.9999
## H:VVS1-I:IF     2418.650  -3265.1  8102.4 0.9991
## I:VVS1-I:IF     4083.650  -2747.4 10914.7 0.9053
## D:VVS2-I:IF     6513.000   -824.7 13850.7 0.1736
## E:VVS2-I:IF     2765.472  -3057.0  8587.9 0.9946
## F:VVS2-I:IF     1880.603  -3256.8  7018.0 0.9999
## G:VVS2-I:IF     2670.345  -2308.1  7648.8 0.9715
## H:VVS2-I:IF     2817.383  -2428.5  8063.3 0.9711
## I:VVS2-I:IF     3517.083  -1952.1  8986.3 0.8177
## E:VS1-D:VS1     1049.246  -4288.2  6386.7 1.0000
## F:VS1-D:VS1      495.417  -4628.5  5619.3 1.0000
## G:VS1-D:VS1     -219.893  -5918.7  5478.9 1.0000
## H:VS1-D:VS1      966.675  -4826.8  6760.1 1.0000
## I:VS1-D:VS1     1003.607  -5197.9  7205.1 1.0000
## D:VS2-D:VS1    -2077.143 -11684.5  7530.2 1.0000
## E:VS2-D:VS1     1836.143  -4568.8  8241.0 1.0000
## F:VS2-D:VS1     1442.000  -4104.8  6988.8 1.0000
## G:VS2-D:VS1     1431.413  -4607.2  7470.0 1.0000
## H:VS2-D:VS1     1762.786  -3784.0  7309.6 1.0000
## I:VS2-D:VS1      994.000  -5410.9  7398.9 1.0000
## D:VVS1-D:VS1   11321.857   1714.5 20929.2 0.0041
## E:VVS1-D:VS1    3588.657  -3427.6 10604.9 0.9845
## F:VVS1-D:VS1      16.579  -5320.8  5354.0 1.0000
## G:VVS1-D:VS1      95.357  -5603.4  5794.2 1.0000
## H:VVS1-D:VS1     437.257  -5467.8  6342.3 1.0000
## I:VVS1-D:VS1    2102.257  -4914.0  9118.5 1.0000
## D:VVS2-D:VS1    4531.607  -2978.8 12042.0 0.8963
## E:VVS2-D:VS1     784.079  -5254.5  6822.7 1.0000
## F:VVS2-D:VS1    -100.790  -5482.0  5280.4 1.0000
## G:VVS2-D:VS1     688.952  -4540.6  5918.5 1.0000
## H:VVS2-D:VS1     835.990  -4648.8  6320.8 1.0000
## I:VVS2-D:VS1    1535.690  -4163.1  7234.5 1.0000
## F:VS1-E:VS1     -553.829  -4257.9  3150.2 1.0000
## G:VS1-E:VS1    -1269.139  -5734.7  3196.5 1.0000
## H:VS1-E:VS1      -82.571  -4668.3  4503.2 1.0000
## I:VS1-E:VS1      -45.639  -5137.2  5045.9 1.0000
## D:VS2-E:VS1    -3126.389 -12057.6  5804.8 1.0000
## E:VS2-E:VS1      786.897  -4550.5  6124.3 1.0000
## F:VS2-E:VS1      392.754  -3877.2  4662.7 1.0000
## G:VS2-E:VS1      382.167  -4509.7  5274.0 1.0000
## H:VS2-E:VS1      713.540  -3556.4  4983.5 1.0000
## I:VS2-E:VS1      -55.246  -5392.7  5282.2 1.0000
## D:VVS1-E:VS1   10272.611   1341.4 19203.8 0.0064
## E:VVS1-E:VS1    2539.411  -3518.0  8596.9 0.9993
## F:VVS1-E:VS1   -1032.667  -5026.8  2961.5 1.0000
## G:VVS1-E:VS1    -953.889  -5419.5  3511.7 1.0000
## H:VVS1-E:VS1    -611.989  -5337.9  4114.0 1.0000
## I:VVS1-E:VS1    1053.011  -5004.4  7110.5 1.0000
## D:VVS2-E:VS1    3482.361  -3141.2 10105.9 0.9778
## E:VVS2-E:VS1    -265.167  -5157.0  4626.7 1.0000
## F:VVS2-E:VS1   -1150.036  -5202.5  2902.4 1.0000
## G:VVS2-E:VS1    -360.294  -4209.2  3488.6 1.0000
## H:VVS2-E:VS1    -213.256  -4402.4  3975.9 1.0000
## I:VVS2-E:VS1     486.444  -3979.2  4952.0 1.0000
## G:VS1-F:VS1     -715.310  -4923.4  3492.8 1.0000
## H:VS1-F:VS1      471.258  -3864.2  4806.7 1.0000
## I:VS1-F:VS1      508.190  -4359.1  5375.5 1.0000
## D:VS2-F:VS1    -2572.560 -11377.8  6232.7 1.0000
## E:VS2-F:VS1     1340.726  -3783.2  6464.6 1.0000
## F:VS2-F:VS1      946.583  -3053.3  4946.4 1.0000
## G:VS2-F:VS1      935.996  -3722.0  5593.9 1.0000
## H:VS2-F:VS1     1267.369  -2732.5  5267.2 1.0000
## I:VS2-F:VS1      498.583  -4625.3  5622.5 1.0000
## D:VVS1-F:VS1   10826.440   2021.2 19631.7 0.0018
## E:VVS1-F:VS1    3093.240  -2776.9  8963.4 0.9772
## F:VVS1-F:VS1    -478.838  -4182.9  3225.2 1.0000
## G:VVS1-F:VS1    -400.060  -4608.2  3808.0 1.0000
## H:VVS1-F:VS1     -58.160  -4541.6  4425.3 1.0000
## I:VVS1-F:VS1    1606.840  -4263.3  7477.0 1.0000
## D:VVS2-F:VS1    4036.190  -2416.6 10488.9 0.8557
## E:VVS2-F:VS1     288.662  -4369.3  4946.6 1.0000
## F:VVS2-F:VS1    -596.207  -4363.0  3170.6 1.0000
## G:VVS2-F:VS1     193.535  -3353.3  3740.4 1.0000
## H:VVS2-F:VS1     340.573  -3572.9  4254.0 1.0000
## I:VVS2-F:VS1    1040.273  -3167.8  5248.4 1.0000
## H:VS1-G:VS1     1186.568  -3815.2  6188.3 1.0000
## I:VS1-G:VS1     1223.500  -4245.7  6692.7 1.0000
## D:VS2-G:VS1    -1857.250 -11009.0  7294.5 1.0000
## E:VS2-G:VS1     2056.036  -3642.8  7754.8 1.0000
## F:VS2-G:VS1     1661.893  -3052.0  6375.8 1.0000
## G:VS2-G:VS1     1651.306  -3632.5  6935.1 1.0000
## H:VS2-G:VS1     1982.679  -2731.2  6696.6 0.9992
## I:VS2-G:VS1     1213.893  -4484.9  6912.7 1.0000
## D:VVS1-G:VS1   11541.750   2390.0 20693.5 0.0011
## E:VVS1-G:VS1    3808.550  -2569.6 10186.7 0.9063
## F:VVS1-G:VS1     236.472  -4229.1  4702.1 1.0000
## G:VVS1-G:VS1     315.250  -4576.6  5207.1 1.0000
## H:VVS1-G:VS1     657.150  -4473.4  5787.7 1.0000
## I:VVS1-G:VS1    2322.150  -4056.0  8700.3 0.9999
## D:VVS2-G:VS1    4751.500  -2166.6 11669.6 0.7042
## E:VVS2-G:VS1    1003.972  -4279.8  6287.7 1.0000
## F:VVS2-G:VS1     119.103  -4398.7  4636.9 1.0000
## G:VVS2-G:VS1     908.845  -3427.3  5245.0 1.0000
## H:VVS2-G:VS1    1055.883  -3584.9  5696.7 1.0000
## I:VVS2-G:VS1    1755.583  -3136.2  6647.4 1.0000
## I:VS1-H:VS1       36.932  -5530.8  5604.7 1.0000
## D:VS2-H:VS1    -3043.818 -12254.8  6167.2 1.0000
## E:VS2-H:VS1      869.468  -4924.0  6662.9 1.0000
## F:VS2-H:VS1      475.325  -4352.6  5303.2 1.0000
## G:VS2-H:VS1      464.737  -4921.0  5850.5 1.0000
## H:VS2-H:VS1      796.110  -4031.8  5624.0 1.0000
## I:VS2-H:VS1       27.325  -5766.1  5820.8 1.0000
## D:VVS1-H:VS1   10355.182   1144.2 19566.2 0.0093
## E:VVS1-H:VS1    2621.982  -3840.9  9084.8 0.9996
## F:VVS1-H:VS1    -950.096  -5535.9  3635.7 1.0000
## G:VVS1-H:VS1    -871.318  -5873.1  4130.4 1.0000
## H:VVS1-H:VS1    -529.418  -5764.9  4706.1 1.0000
## I:VVS1-H:VS1    1135.582  -5327.3  7598.4 1.0000
## D:VVS2-H:VS1    3564.932  -3431.3 10561.2 0.9853
## E:VVS2-H:VS1    -182.596  -5568.3  5203.1 1.0000
## F:VVS2-H:VS1   -1067.465  -5704.1  3569.2 1.0000
## G:VVS2-H:VS1    -277.723  -4737.5  4182.1 1.0000
## H:VVS2-H:VS1    -130.685  -4887.2  4625.9 1.0000
## I:VVS2-H:VS1     569.015  -4432.8  5570.8 1.0000
## D:VS2-I:VS1    -3080.750 -12553.7  6392.2 1.0000
## E:VS2-I:VS1      832.536  -5369.0  7034.1 1.0000
## F:VS2-I:VS1      438.393  -4872.3  5749.1 1.0000
## G:VS2-I:VS1      427.806  -5394.6  6250.2 1.0000
## H:VS2-I:VS1      759.179  -4551.5  6069.8 1.0000
## I:VS2-I:VS1       -9.607  -6211.1  6191.9 1.0000
## D:VVS1-I:VS1   10318.250    845.3 19791.2 0.0154
## E:VVS1-I:VS1    2585.050  -4246.0  9416.1 0.9999
## F:VVS1-I:VS1    -987.028  -6078.6  4104.5 1.0000
## G:VVS1-I:VS1    -908.250  -6377.5  4561.0 1.0000
## H:VVS1-I:VS1    -566.350  -6250.1  5117.4 1.0000
## I:VVS1-I:VS1    1098.650  -5732.4  7929.7 1.0000
## D:VVS2-I:VS1    3528.000  -3809.7 10865.7 0.9935
## E:VVS2-I:VS1    -219.528  -6042.0  5602.9 1.0000
## F:VVS2-I:VS1   -1104.397  -6241.8  4033.0 1.0000
## G:VVS2-I:VS1    -314.655  -5293.1  4663.8 1.0000
## H:VVS2-I:VS1    -167.617  -5413.5  5078.3 1.0000
## I:VVS2-I:VS1     532.083  -4937.1  6001.3 1.0000
## E:VS2-D:VS2     3913.286  -5694.1 13520.6 0.9996
## F:VS2-D:VS2     3519.143  -5538.8 12577.0 0.9998
## G:VS2-D:VS2     3508.556  -5858.6 12875.7 0.9999
## H:VS2-D:VS2     3839.929  -5218.0 12897.8 0.9991
## I:VS2-D:VS2     3071.143  -6536.2 12678.5 1.0000
## D:VVS1-D:VS2   13399.000   1416.5 25381.5 0.0102
## E:VVS1-D:VS2    5665.800  -4359.5 15691.1 0.9474
## F:VVS1-D:VS2    2093.722  -6837.5 11024.9 1.0000
## G:VVS1-D:VS2    2172.500  -6979.3 11324.3 1.0000
## H:VVS1-D:VS2    2514.400  -6767.2 11796.0 1.0000
## I:VVS1-D:VS2    4179.400  -5845.9 14204.7 0.9994
## D:VVS2-D:VS2    6608.750  -3768.4 16985.9 0.8317
## E:VVS2-D:VS2    2861.222  -6505.9 12228.4 1.0000
## F:VVS2-D:VS2    1976.353  -6981.1 10933.8 1.0000
## G:VVS2-D:VS2    2766.095  -6101.1 11633.3 1.0000
## H:VVS2-D:VS2    2913.133  -6106.9 11933.2 1.0000
## I:VVS2-D:VS2    3612.833  -5538.9 12764.6 0.9998
## F:VS2-E:VS2     -394.143  -5941.0  5152.7 1.0000
## G:VS2-E:VS2     -404.730  -6443.3  5633.9 1.0000
## H:VS2-E:VS2      -73.357  -5620.2  5473.5 1.0000
## I:VS2-E:VS2     -842.143  -7247.0  5562.8 1.0000
## D:VVS1-E:VS2    9485.714   -121.6 19093.1 0.0583
## E:VVS1-E:VS2    1752.514  -5263.7  8768.7 1.0000
## F:VVS1-E:VS2   -1819.563  -7157.0  3517.9 1.0000
## G:VVS1-E:VS2   -1740.786  -7439.6  3958.0 1.0000
## H:VVS1-E:VS2   -1398.886  -7303.9  4506.1 1.0000
## I:VVS1-E:VS2     266.114  -6750.1  7282.3 1.0000
## D:VVS2-E:VS2    2695.464  -4814.9 10205.9 1.0000
## E:VVS2-E:VS2   -1052.063  -7090.7  4986.5 1.0000
## F:VVS2-E:VS2   -1936.933  -7318.1  3444.3 1.0000
## G:VVS2-E:VS2   -1147.190  -6376.8  4082.4 1.0000
## H:VVS2-E:VS2   -1000.152  -6485.0  4484.7 1.0000
## I:VVS2-E:VS2    -300.452  -5999.3  5398.4 1.0000
## G:VS2-F:VS2      -10.587  -5130.1  5108.9 1.0000
## H:VS2-F:VS2      320.786  -4208.2  4849.7 1.0000
## I:VS2-F:VS2     -448.000  -5994.8  5098.8 1.0000
## D:VVS1-F:VS2    9879.857    822.0 18937.8 0.0151
## E:VVS1-F:VS2    2146.657  -4096.1  8389.4 1.0000
## F:VVS1-F:VS2   -1425.421  -5695.4  2844.5 1.0000
## G:VVS1-F:VS2   -1346.643  -6060.5  3367.2 1.0000
## H:VVS1-F:VS2   -1004.743  -5966.0  3956.5 1.0000
## I:VVS1-F:VS2     660.257  -5582.5  6903.0 1.0000
## D:VVS2-F:VS2    3089.607  -3703.8  9883.0 0.9972
## E:VVS2-F:VS2    -657.921  -5777.4  4461.6 1.0000
## F:VVS2-F:VS2   -1542.790  -5867.3  2781.7 1.0000
## G:VVS2-F:VS2    -753.048  -4887.4  3381.3 1.0000
## H:VVS2-F:VS2    -606.010  -5058.8  3846.8 1.0000
## I:VVS2-F:VS2      93.690  -4620.2  4807.6 1.0000
## H:VS2-G:VS2      331.373  -4788.1  5450.8 1.0000
## I:VS2-G:VS2     -437.413  -6476.0  5601.2 1.0000
## D:VVS1-G:VS2    9890.444    523.3 19257.6 0.0244
## E:VVS1-G:VS2    2157.244  -4526.3  8840.7 1.0000
## F:VVS1-G:VS2   -1414.833  -6306.7  3477.0 1.0000
## G:VVS1-G:VS2   -1336.056  -6619.8  3947.7 1.0000
## H:VVS1-G:VS2    -994.156  -6499.7  4511.4 1.0000
## I:VVS1-G:VS2     670.844  -6012.7  7354.3 1.0000
## D:VVS2-G:VS2    3100.194  -4100.4 10300.8 0.9989
## E:VVS2-G:VS2    -647.333  -6295.9  5001.3 1.0000
## F:VVS2-G:VS2   -1532.203  -6471.8  3407.3 1.0000
## G:VVS2-G:VS2    -742.460  -5516.4  4031.5 1.0000
## H:VVS2-G:VS2    -595.422  -5647.7  4456.8 1.0000
## I:VVS2-G:VS2     104.278  -5179.5  5388.1 1.0000
## I:VS2-H:VS2     -768.786  -6315.6  4778.0 1.0000
## D:VVS1-H:VS2    9559.071    501.2 18617.0 0.0245
## E:VVS1-H:VS2    1825.871  -4416.9  8068.6 1.0000
## F:VVS1-H:VS2   -1746.206  -6016.1  2523.7 0.9995
## G:VVS1-H:VS2   -1667.429  -6381.3  3046.5 1.0000
## H:VVS1-H:VS2   -1325.529  -6286.7  3635.7 1.0000
## I:VVS1-H:VS2     339.471  -5903.3  6582.2 1.0000
## D:VVS2-H:VS2    2768.821  -4024.6  9562.2 0.9996
## E:VVS2-H:VS2    -978.706  -6098.2  4140.8 1.0000
## F:VVS2-H:VS2   -1863.576  -6188.1  2461.0 0.9989
## G:VVS2-H:VS2   -1073.833  -5208.2  3060.5 1.0000
## H:VVS2-H:VS2    -926.795  -5379.6  3526.0 1.0000
## I:VVS2-H:VS2    -227.095  -4941.0  4486.8 1.0000
## D:VVS1-I:VS2   10327.857    720.5 19935.2 0.0188
## E:VVS1-I:VS2    2594.657  -4421.6  9610.9 0.9999
## F:VVS1-I:VS2    -977.421  -6314.8  4360.0 1.0000
## G:VVS1-I:VS2    -898.643  -6597.4  4800.2 1.0000
## H:VVS1-I:VS2    -556.743  -6461.8  5348.3 1.0000
## I:VVS1-I:VS2    1108.257  -5908.0  8124.5 1.0000
## D:VVS2-I:VS2    3537.607  -3972.8 11048.0 0.9952
## E:VVS2-I:VS2    -209.921  -6248.5  5828.7 1.0000
## F:VVS2-I:VS2   -1094.790  -6476.0  4286.4 1.0000
## G:VVS2-I:VS2    -305.048  -5534.6  4924.5 1.0000
## H:VVS2-I:VS2    -158.010  -5642.8  5326.8 1.0000
## I:VVS2-I:VS2     541.690  -5157.1  6240.5 1.0000
## E:VVS1-D:VVS1  -7733.200 -17758.5  2292.1 0.4501
## F:VVS1-D:VVS1 -11305.278 -20236.5 -2374.1 0.0010
## G:VVS1-D:VVS1 -11226.500 -20378.3 -2074.7 0.0019
## H:VVS1-D:VVS1 -10884.600 -20166.2 -1603.0 0.0045
## I:VVS1-D:VVS1  -9219.600 -19244.9   805.7 0.1254
## D:VVS2-D:VVS1  -6790.250 -17167.4  3586.9 0.7908
## E:VVS2-D:VVS1 -10537.778 -19904.9 -1170.6 0.0092
## F:VVS2-D:VVS1 -11422.647 -20380.1 -2465.2 0.0009
## G:VVS2-D:VVS1 -10632.905 -19500.1 -1765.7 0.0030
## H:VVS2-D:VVS1 -10485.867 -19505.9 -1465.8 0.0053
## I:VVS2-D:VVS1  -9786.167 -18937.9  -634.4 0.0203
## F:VVS1-E:VVS1  -3572.078  -9629.5  2485.4 0.9173
## G:VVS1-E:VVS1  -3493.300  -9871.5  2884.9 0.9633
## H:VVS1-E:VVS1  -3151.400  -9714.5  3411.7 0.9936
## I:VVS1-E:VVS1  -1486.400  -9064.8  6092.0 1.0000
## D:VVS2-E:VVS1    942.950  -7095.1  8981.0 1.0000
## E:VVS2-E:VVS1  -2804.578  -9488.1  3878.9 0.9993
## F:VVS2-E:VVS1  -3689.447  -9785.5  2406.6 0.8933
## G:VVS2-E:VVS1  -2899.705  -8862.3  3062.9 0.9923
## H:VVS2-E:VVS1  -2752.667  -8940.4  3435.1 0.9981
## I:VVS2-E:VVS1  -2052.967  -8431.1  4325.2 1.0000
## G:VVS1-F:VVS1     78.778  -4386.8  4544.4 1.0000
## H:VVS1-F:VVS1    420.678  -4305.3  5146.6 1.0000
## I:VVS1-F:VVS1   2085.678  -3971.8  8143.1 1.0000
## D:VVS2-F:VVS1   4515.028  -2108.5 11138.6 0.7188
## E:VVS2-F:VVS1    767.500  -4124.3  5659.3 1.0000
## F:VVS2-F:VVS1   -117.369  -4169.8  3935.1 1.0000
## G:VVS2-F:VVS1    672.373  -3176.5  4521.2 1.0000
## H:VVS2-F:VVS1    819.411  -3369.7  5008.5 1.0000
## I:VVS2-F:VVS1   1519.111  -2946.5  5984.7 1.0000
## H:VVS1-G:VVS1    341.900  -4788.7  5472.5 1.0000
## I:VVS1-G:VVS1   2006.900  -4371.3  8385.1 1.0000
## D:VVS2-G:VVS1   4436.250  -2481.8 11354.3 0.8219
## E:VVS2-G:VVS1    688.722  -4595.1  5972.5 1.0000
## F:VVS2-G:VVS1   -196.147  -4714.0  4321.7 1.0000
## G:VVS2-G:VVS1    593.595  -3742.5  4929.7 1.0000
## H:VVS2-G:VVS1    740.633  -3900.2  5381.4 1.0000
## I:VVS2-G:VVS1   1440.333  -3451.5  6332.2 1.0000
## I:VVS1-H:VVS1   1665.000  -4898.1  8228.1 1.0000
## D:VVS2-H:VVS1   4094.350  -2994.6 11183.3 0.9334
## E:VVS2-H:VVS1    346.822  -5158.7  5852.4 1.0000
## F:VVS2-H:VVS1   -538.047  -5313.4  4237.3 1.0000
## G:VVS2-H:VVS1    251.695  -4352.1  4855.5 1.0000
## H:VVS2-H:VVS1    398.733  -4493.1  5290.6 1.0000
## I:VVS2-H:VVS1   1098.433  -4032.2  6229.0 1.0000
## D:VVS2-I:VVS1   2429.350  -5608.7 10467.4 1.0000
## E:VVS2-I:VVS1  -1318.178  -8001.7  5365.3 1.0000
## F:VVS2-I:VVS1  -2203.047  -8299.1  3893.0 1.0000
## G:VVS2-I:VVS1  -1413.305  -7375.9  4549.3 1.0000
## H:VVS2-I:VVS1  -1266.267  -7454.0  4921.5 1.0000
## I:VVS2-I:VVS1   -566.567  -6944.7  5811.6 1.0000
## E:VVS2-D:VVS2  -3747.528 -10948.1  3453.0 0.9806
## F:VVS2-D:VVS2  -4632.397 -11291.3  2026.5 0.6787
## G:VVS2-D:VVS2  -3842.655 -10379.6  2694.3 0.9200
## H:VVS2-D:VVS2  -3695.617 -10438.5  3047.3 0.9630
## I:VVS2-D:VVS2  -2995.917  -9914.0  3922.2 0.9988
## F:VVS2-E:VVS2   -884.869  -5824.4  4054.7 1.0000
## G:VVS2-E:VVS2    -95.127  -4869.1  4678.8 1.0000
## H:VVS2-E:VVS2     51.911  -5000.3  5104.2 1.0000
## I:VVS2-E:VVS2    751.611  -4532.2  6035.4 1.0000
## G:VVS2-F:VVS2    789.742  -3119.6  4699.1 1.0000
## H:VVS2-F:VVS2    936.780  -3308.0  5181.5 1.0000
## I:VVS2-F:VVS2   1636.480  -2881.4  6154.3 1.0000
## H:VVS2-G:VVS2    147.038  -3903.8  4197.9 1.0000
## I:VVS2-G:VVS2    846.738  -3489.4  5182.9 1.0000
## I:VVS2-H:VVS2    699.700  -3941.1  5340.5 1.0000
plot(TukeyHSD(model_colour_clarity))

plot of chunk unnamed-chunk-8 plot of chunk unnamed-chunk-8 plot of chunk unnamed-chunk-8

4. References to the literature

http://cran.r-project.org/web/packages/Ecdat/Ecdat.pdf http://www.amstat.org/publications/jse/v9n2/datasets.chu.html

5. Appendices

A summary of, or pointer to, the raw data

complete and documented R code