corn <- read.csv("~/RPI/Classes/Design of Experiments/R/Cornsilk.csv")
#reads in the csv file "Cornsilk.csv" form My Documents and stores it in the variable "corn"
corn$Type = as.factor(corn$Type)
#makes the column "Type" a factor
corn$Varieties = as.factor(corn$Varieties)
#makes the column "Varieties" a factor
#Summary of Data
head(corn)
## Type Varieties Silkingstage Milkystage Maturitystage Mean
## 1 Purple waxy corn P1 123.8 179.6 149.1 150.8
## 2 Purple waxy corn P1 127.6 182.8 146.5 152.3
## 3 Purple waxy corn P1 120.0 176.4 151.7 149.4
## 4 Purple waxy corn P2 112.8 169.2 114.7 132.2
## 5 Purple waxy corn P2 114.9 166.8 117.8 133.2
## 6 Purple waxy corn P2 110.7 171.6 111.6 131.3
#displays the first 6 sets of variables
tail(corn)
## Type Varieties Silkingstage Milkystage Maturitystage Mean
## 25 Super sweet corn S1 85.5 75.2 65.5 75.4
## 26 Super sweet corn S1 83.1 78.4 63.5 75.0
## 27 Super sweet corn S1 87.9 72.0 67.5 75.8
## 28 Super sweet corn S2 93.4 78.3 69.4 80.4
## 29 Super sweet corn S2 90.2 81.4 71.6 81.1
## 30 Super sweet corn S2 96.6 75.2 67.2 79.7
#displays the last 6 sets of variables
summary(corn)
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:15 P1 : 3 Min. : 83.1 Min. : 54.4
## Super sweet corn: 6 P2 : 3 1st Qu.: 89.8 1st Qu.: 59.3
## White waxy corn : 9 P3 : 3 Median :105.9 Median :112.9
## P4 : 3 Mean :110.7 Mean :121.3
## P5 : 3 3rd Qu.:122.8 3rd Qu.:178.8
## S1 : 3 Max. :176.0 Max. :212.3
## (Other):12
## Maturitystage Mean
## Min. : 24.4 Min. : 58.8
## 1st Qu.: 48.0 1st Qu.: 64.8
## Median : 91.6 Median :106.2
## Mean : 97.8 Mean :109.9
## 3rd Qu.:146.0 3rd Qu.:150.4
## Max. :190.3 Max. :192.9
##
#displays a summary of the variables
#Boxplot
boxplot(Mean~Type,data=corn, xlab="Type of Corn", ylab="Total phenolic content (ug GAE/g dried sample)")
title("Effect of Corn Type on Phenolic Content")
#boxplot of the horse power data from each model year
boxplot(Mean~Varieties,data=corn, xlab="Variety of Corn", ylab="Total phenolic content (ug GAE/g dried sample)", las=2)
title("Effect of Corn Variety on Phenolic Content")
#boxplot of the horse power data from each model year
# ANOVA
#Corn Type
model_type = aov(Mean~Type,data=corn)
anova(model_type)
## Analysis of Variance Table
##
## Response: Mean
## Df Sum Sq Mean Sq F value Pr(>F)
## Type 2 53032 26516 109 1.2e-13 ***
## Residuals 27 6561 243
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#performs an anova test
#Corn Variety
model_variety = aov(Mean~Varieties,data=corn)
anova(model_variety)
## Analysis of Variance Table
##
## Response: Mean
## Df Sum Sq Mean Sq F value Pr(>F)
## Varieties 9 59546 6616 2850 <2e-16 ***
## Residuals 20 46 2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#performs an anova test
#Corn Type and Variety
model_type_variety = aov(Mean~Type*Varieties,data=corn)
anova(model_type_variety)
## Analysis of Variance Table
##
## Response: Mean
## Df Sum Sq Mean Sq F value Pr(>F)
## Type 2 53032 26516 11423 <2e-16 ***
## Varieties 7 6515 931 401 <2e-16 ***
## Residuals 20 46 2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#performs an anova test
#Tukey's HSD
#Corn Type
TukeyHSD(model_type, ordered = FALSE, conf.level = 0.95)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Mean ~ Type, data = corn)
##
## $Type
## diff lwr upr p adj
## Super sweet corn-Purple waxy corn -73.69 -92.36 -55.023 0.0000
## White waxy corn-Purple waxy corn -89.78 -106.08 -73.486 0.0000
## White waxy corn-Super sweet corn -16.09 -36.46 4.282 0.1421
#performs a THSD test for the type of corn
#Corn Variety
TukeyHSD(model_variety, ordered = FALSE, conf.level = 0.95)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Mean ~ Varieties, data = corn)
##
## $Varieties
## diff lwr upr p adj
## P2-P1 -18.6000 -23.0052 -14.1948 0.0000
## P3-P1 2.3667 -2.0385 6.7718 0.6678
## P4-P1 -18.2333 -22.6385 -13.8282 0.0000
## P5-P1 38.2667 33.8615 42.6718 0.0000
## S1-P1 -75.4333 -79.8385 -71.0282 0.0000
## S2-P1 -70.4333 -74.8385 -66.0282 0.0000
## W1-P1 -89.6333 -94.0385 -85.2282 0.0000
## W2-P1 -86.1667 -90.5718 -81.7615 0.0000
## W3-P1 -91.2667 -95.6718 -86.8615 0.0000
## P3-P2 20.9667 16.5615 25.3718 0.0000
## P4-P2 0.3667 -4.0385 4.7718 1.0000
## P5-P2 56.8667 52.4615 61.2718 0.0000
## S1-P2 -56.8333 -61.2385 -52.4282 0.0000
## S2-P2 -51.8333 -56.2385 -47.4282 0.0000
## W1-P2 -71.0333 -75.4385 -66.6282 0.0000
## W2-P2 -67.5667 -71.9718 -63.1615 0.0000
## W3-P2 -72.6667 -77.0718 -68.2615 0.0000
## P4-P3 -20.6000 -25.0052 -16.1948 0.0000
## P5-P3 35.9000 31.4948 40.3052 0.0000
## S1-P3 -77.8000 -82.2052 -73.3948 0.0000
## S2-P3 -72.8000 -77.2052 -68.3948 0.0000
## W1-P3 -92.0000 -96.4052 -87.5948 0.0000
## W2-P3 -88.5333 -92.9385 -84.1282 0.0000
## W3-P3 -93.6333 -98.0385 -89.2282 0.0000
## P5-P4 56.5000 52.0948 60.9052 0.0000
## S1-P4 -57.2000 -61.6052 -52.7948 0.0000
## S2-P4 -52.2000 -56.6052 -47.7948 0.0000
## W1-P4 -71.4000 -75.8052 -66.9948 0.0000
## W2-P4 -67.9333 -72.3385 -63.5282 0.0000
## W3-P4 -73.0333 -77.4385 -68.6282 0.0000
## S1-P5 -113.7000 -118.1052 -109.2948 0.0000
## S2-P5 -108.7000 -113.1052 -104.2948 0.0000
## W1-P5 -127.9000 -132.3052 -123.4948 0.0000
## W2-P5 -124.4333 -128.8385 -120.0282 0.0000
## W3-P5 -129.5333 -133.9385 -125.1282 0.0000
## S2-S1 5.0000 0.5948 9.4052 0.0184
## W1-S1 -14.2000 -18.6052 -9.7948 0.0000
## W2-S1 -10.7333 -15.1385 -6.3282 0.0000
## W3-S1 -15.8333 -20.2385 -11.4282 0.0000
## W1-S2 -19.2000 -23.6052 -14.7948 0.0000
## W2-S2 -15.7333 -20.1385 -11.3282 0.0000
## W3-S2 -20.8333 -25.2385 -16.4282 0.0000
## W2-W1 3.4667 -0.9385 7.8718 0.2061
## W3-W1 -1.6333 -6.0385 2.7718 0.9390
## W3-W2 -5.1000 -9.5052 -0.6948 0.0155
#performs a THSD test for the variety of corn
#Corn Type and Variety
TukeyHSD(model_type_variety, ordered = FALSE, conf.level = 0.95)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Mean ~ Type * Varieties, data = corn)
##
## $Type
## diff lwr upr p adj
## Super sweet corn-Purple waxy corn -73.69 -75.56 -71.83 0
## White waxy corn-Purple waxy corn -89.78 -91.41 -88.16 0
## White waxy corn-Super sweet corn -16.09 -18.12 -14.06 0
##
## $Varieties
## diff lwr upr p adj
## P2-P1 -18.6000 -23.0052 -14.1948 0.0000
## P3-P1 2.3667 -2.0385 6.7718 0.6678
## P4-P1 -18.2333 -22.6385 -13.8282 0.0000
## P5-P1 38.2667 33.8615 42.6718 0.0000
## S1-P1 -1.7400 -6.1452 2.6652 0.9139
## S2-P1 3.2600 -1.1452 7.6652 0.2702
## W1-P1 0.1489 -4.2563 4.5541 1.0000
## W2-P1 3.6156 -0.7896 8.0207 0.1677
## W3-P1 -1.4844 -5.8896 2.9207 0.9651
## P3-P2 20.9667 16.5615 25.3718 0.0000
## P4-P2 0.3667 -4.0385 4.7718 1.0000
## P5-P2 56.8667 52.4615 61.2718 0.0000
## S1-P2 16.8600 12.4548 21.2652 0.0000
## S2-P2 21.8600 17.4548 26.2652 0.0000
## W1-P2 18.7489 14.3437 23.1541 0.0000
## W2-P2 22.2156 17.8104 26.6207 0.0000
## W3-P2 17.1156 12.7104 21.5207 0.0000
## P4-P3 -20.6000 -25.0052 -16.1948 0.0000
## P5-P3 35.9000 31.4948 40.3052 0.0000
## S1-P3 -4.1067 -8.5118 0.2985 0.0806
## S2-P3 0.8933 -3.5118 5.2985 0.9990
## W1-P3 -2.2178 -6.6229 2.1874 0.7380
## W2-P3 1.2489 -3.1563 5.6541 0.9885
## W3-P3 -3.8511 -8.2563 0.5541 0.1191
## P5-P4 56.5000 52.0948 60.9052 0.0000
## S1-P4 16.4933 12.0882 20.8985 0.0000
## S2-P4 21.4933 17.0882 25.8985 0.0000
## W1-P4 18.3822 13.9771 22.7874 0.0000
## W2-P4 21.8489 17.4437 26.2541 0.0000
## W3-P4 16.7489 12.3437 21.1541 0.0000
## S1-P5 -40.0067 -44.4118 -35.6015 0.0000
## S2-P5 -35.0067 -39.4118 -30.6015 0.0000
## W1-P5 -38.1178 -42.5229 -33.7126 0.0000
## W2-P5 -34.6511 -39.0563 -30.2459 0.0000
## W3-P5 -39.7511 -44.1563 -35.3459 0.0000
## S2-S1 5.0000 0.5948 9.4052 0.0184
## W1-S1 1.8889 -2.5163 6.2941 0.8696
## W2-S1 5.3556 0.9504 9.7607 0.0100
## W3-S1 0.2556 -4.1496 4.6607 1.0000
## W1-S2 -3.1111 -7.5163 1.2941 0.3244
## W2-S2 0.3556 -4.0496 4.7607 1.0000
## W3-S2 -4.7444 -9.1496 -0.3393 0.0285
## W2-W1 3.4667 -0.9385 7.8718 0.2061
## W3-W1 -1.6333 -6.0385 2.7718 0.9390
## W3-W2 -5.1000 -9.5052 -0.6948 0.0155
#performs a THSD test for the interaction of the type and variety of corn
#Summary
pwc<-corn$Type=="Purple waxy corn"
summary(corn[pwc,])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:15 P1 :3 Min. :111 Min. :144
## Super sweet corn: 0 P2 :3 1st Qu.:115 1st Qu.:168
## White waxy corn : 0 P3 :3 Median :124 Median :180
## P4 :3 Mean :131 Mean :178
## P5 :3 3rd Qu.:129 3rd Qu.:186
## S1 :0 Max. :176 Max. :212
## (Other):0
## Maturitystage Mean
## Min. :112 Min. :131
## 1st Qu.:133 1st Qu.:133
## Median :146 Median :151
## Mean :147 Mean :152
## 3rd Qu.:151 3rd Qu.:154
## Max. :190 Max. :193
##
#displays a summary of the data of the type "Purple Waxy Corn"
wwc<-corn$Type=="White waxy corn"
summary(corn[wwc,])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:0 W1 :3 Min. : 84.1 Min. :54.4
## Super sweet corn:0 W2 :3 1st Qu.: 87.1 1st Qu.:55.0
## White waxy corn :9 W3 :3 Median : 89.6 Median :56.8
## P1 :0 Mean : 91.8 Mean :56.9
## P2 :0 3rd Qu.: 98.5 3rd Qu.:58.8
## P3 :0 Max. :101.1 Max. :59.6
## (Other):0
## Maturitystage Mean
## Min. :24.4 Min. :58.8
## 1st Qu.:28.6 1st Qu.:59.6
## Median :36.1 Median :61.2
## Mean :36.7 Mean :61.8
## 3rd Qu.:45.8 3rd Qu.:64.0
## Max. :49.4 Max. :65.3
##
#displays a summary of the data of the type "White Waxy Corn"
ssc<-corn$Type=="Super sweet corn"
summary(corn[ssc,])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:0 S1 :3 Min. :83.1 Min. :72.0
## Super sweet corn:6 S2 :3 1st Qu.:86.1 1st Qu.:75.2
## White waxy corn :0 P1 :0 Median :89.0 Median :76.8
## P2 :0 Mean :89.5 Mean :76.8
## P3 :0 3rd Qu.:92.6 3rd Qu.:78.4
## P4 :0 Max. :96.6 Max. :81.4
## (Other):0
## Maturitystage Mean
## Min. :63.5 Min. :75.0
## 1st Qu.:65.9 1st Qu.:75.5
## Median :67.3 Median :77.8
## Mean :67.5 Mean :77.9
## 3rd Qu.:68.9 3rd Qu.:80.2
## Max. :71.6 Max. :81.1
##
#displays a summary of the data of the type "Super sweet Corn"
summary(corn[corn$Varieties=="P1",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:3 P1 :3 Min. :120 Min. :176
## Super sweet corn:0 P2 :0 1st Qu.:122 1st Qu.:178
## White waxy corn :0 P3 :0 Median :124 Median :180
## P4 :0 Mean :124 Mean :180
## P5 :0 3rd Qu.:126 3rd Qu.:181
## S1 :0 Max. :128 Max. :183
## (Other):0
## Maturitystage Mean
## Min. :146 Min. :149
## 1st Qu.:148 1st Qu.:150
## Median :149 Median :151
## Mean :149 Mean :151
## 3rd Qu.:150 3rd Qu.:152
## Max. :152 Max. :152
##
#displays a summary of the data of the variety P1
summary(corn[corn$Varieties=="P2",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:3 P2 :3 Min. :111 Min. :167
## Super sweet corn:0 P1 :0 1st Qu.:112 1st Qu.:168
## White waxy corn :0 P3 :0 Median :113 Median :169
## P4 :0 Mean :113 Mean :169
## P5 :0 3rd Qu.:114 3rd Qu.:170
## S1 :0 Max. :115 Max. :172
## (Other):0
## Maturitystage Mean
## Min. :112 Min. :131
## 1st Qu.:113 1st Qu.:132
## Median :115 Median :132
## Mean :115 Mean :132
## 3rd Qu.:116 3rd Qu.:133
## Max. :118 Max. :133
##
#displays a summary of the data of the variety P2
summary(corn[corn$Varieties=="P3",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:3 P3 :3 Min. :124 Min. :183
## Super sweet corn:0 P1 :0 1st Qu.:126 1st Qu.:184
## White waxy corn :0 P2 :0 Median :127 Median :185
## P4 :0 Mean :127 Mean :185
## P5 :0 3rd Qu.:128 3rd Qu.:186
## S1 :0 Max. :130 Max. :187
## (Other):0
## Maturitystage Mean
## Min. :145 Min. :153
## 1st Qu.:146 1st Qu.:153
## Median :147 Median :153
## Mean :147 Mean :153
## 3rd Qu.:149 3rd Qu.:154
## Max. :150 Max. :154
##
#displays a summary of the data of the variety P3
summary(corn[corn$Varieties=="P4",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:3 P4 :3 Min. :113 Min. :144
## Super sweet corn:0 P1 :0 1st Qu.:114 1st Qu.:146
## White waxy corn :0 P2 :0 Median :116 Median :148
## P3 :0 Mean :116 Mean :148
## P5 :0 3rd Qu.:117 3rd Qu.:149
## S1 :0 Max. :118 Max. :151
## (Other):0
## Maturitystage Mean
## Min. :132 Min. :132
## 1st Qu.:133 1st Qu.:132
## Median :134 Median :133
## Mean :134 Mean :133
## 3rd Qu.:136 3rd Qu.:133
## Max. :137 Max. :133
##
#displays a summary of the data of the variety P4
summary(corn[corn$Varieties=="P5",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:3 P5 :3 Min. :171 Min. :201
## Super sweet corn:0 P1 :0 1st Qu.:172 1st Qu.:204
## White waxy corn :0 P2 :0 Median :173 Median :207
## P3 :0 Mean :173 Mean :207
## P4 :0 3rd Qu.:175 3rd Qu.:210
## S1 :0 Max. :176 Max. :212
## (Other):0
## Maturitystage Mean
## Min. :184 Min. :185
## 1st Qu.:186 1st Qu.:187
## Median :187 Median :189
## Mean :187 Mean :189
## 3rd Qu.:189 3rd Qu.:191
## Max. :190 Max. :193
##
#displays a summary of the data of the variety P5
summary(corn[corn$Varieties=="W1",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:0 W1 :3 Min. : 98.5 Min. :55.0
## Super sweet corn:0 P1 :0 1st Qu.: 99.2 1st Qu.:56.1
## White waxy corn :3 P2 :0 Median : 99.8 Median :57.3
## P3 :0 Mean : 99.8 Mean :57.3
## P4 :0 3rd Qu.:100.5 3rd Qu.:58.5
## P5 :0 Max. :101.1 Max. :59.6
## (Other):0
## Maturitystage Mean
## Min. :24.4 Min. :59.3
## 1st Qu.:25.4 1st Qu.:60.2
## Median :26.5 Median :61.2
## Mean :26.5 Mean :61.2
## 3rd Qu.:27.6 3rd Qu.:62.1
## Max. :28.6 Max. :63.1
##
#displays a summary of the data of the variety W1
summary(corn[corn$Varieties=="W2",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:0 W2 :3 Min. :87.1 Min. :54.4
## Super sweet corn:0 P1 :0 1st Qu.:88.3 1st Qu.:55.6
## White waxy corn :3 P2 :0 Median :89.6 Median :56.8
## P3 :0 Mean :89.6 Mean :56.8
## P4 :0 3rd Qu.:90.8 3rd Qu.:58.0
## P5 :0 Max. :92.1 Max. :59.2
## (Other):0
## Maturitystage Mean
## Min. :45.8 Min. :64.0
## 1st Qu.:46.7 1st Qu.:64.3
## Median :47.6 Median :64.7
## Mean :47.6 Mean :64.7
## 3rd Qu.:48.5 3rd Qu.:65.0
## Max. :49.4 Max. :65.3
##
#displays a summary of the data of the variety W2
summary(corn[corn$Varieties=="W3",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:0 W3 :3 Min. :84.1 Min. :54.6
## Super sweet corn:0 P1 :0 1st Qu.:85.0 1st Qu.:55.6
## White waxy corn :3 P2 :0 Median :85.9 Median :56.7
## P3 :0 Mean :85.9 Mean :56.7
## P4 :0 3rd Qu.:86.8 3rd Qu.:57.8
## P5 :0 Max. :87.7 Max. :58.8
## (Other):0
## Maturitystage Mean
## Min. :34.2 Min. :58.8
## 1st Qu.:35.1 1st Qu.:59.2
## Median :36.1 Median :59.6
## Mean :36.1 Mean :59.6
## 3rd Qu.:37.0 3rd Qu.:60.0
## Max. :38.0 Max. :60.3
##
#displays a summary of the data of the variety W3
summary(corn[corn$Varieties=="S1",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:0 S1 :3 Min. :83.1 Min. :72.0
## Super sweet corn:3 P1 :0 1st Qu.:84.3 1st Qu.:73.6
## White waxy corn :0 P2 :0 Median :85.5 Median :75.2
## P3 :0 Mean :85.5 Mean :75.2
## P4 :0 3rd Qu.:86.7 3rd Qu.:76.8
## P5 :0 Max. :87.9 Max. :78.4
## (Other):0
## Maturitystage Mean
## Min. :63.5 Min. :75.0
## 1st Qu.:64.5 1st Qu.:75.2
## Median :65.5 Median :75.4
## Mean :65.5 Mean :75.4
## 3rd Qu.:66.5 3rd Qu.:75.6
## Max. :67.5 Max. :75.8
##
#displays a summary of the data of the variety S1
summary(corn[corn$Varieties=="S2",])
## Type Varieties Silkingstage Milkystage
## Purple waxy corn:0 S2 :3 Min. :90.2 Min. :75.2
## Super sweet corn:3 P1 :0 1st Qu.:91.8 1st Qu.:76.8
## White waxy corn :0 P2 :0 Median :93.4 Median :78.3
## P3 :0 Mean :93.4 Mean :78.3
## P4 :0 3rd Qu.:95.0 3rd Qu.:79.8
## P5 :0 Max. :96.6 Max. :81.4
## (Other):0
## Maturitystage Mean
## Min. :67.2 Min. :79.7
## 1st Qu.:68.3 1st Qu.:80.0
## Median :69.4 Median :80.4
## Mean :69.4 Mean :80.4
## 3rd Qu.:70.5 3rd Qu.:80.8
## Max. :71.6 Max. :81.1
##
#displays a summary of the data of the variety S2
#Q-Q Plots
#Corn Type
qqnorm(residuals(model_type), main="Normal Q-Q Plot for Corn Type", ylab="Total phenolic content Residuals")
qqline(residuals(model_type))
#produces a Q-Q normal plot for the corn type residuals with a normal fit line
#Corn Type
qqnorm(residuals(model_variety), main="Normal Q-Q Plot for Corn Variety", ylab="Total phenolic content Residuals")
qqline(residuals(model_variety))
#produces a Q-Q normal plot for the corn variety residuals with a normal fit line
#Corn Type
qqnorm(residuals(model_type_variety), main="Normal Q-Q Plot for Interaction of Corn Type and Variety", ylab="Total phenolic content Residuals")
qqline(residuals(model_type_variety))
#produces a Q-Q normal plot for the corn type-variety interaction residuals with a normal fit line
interaction.plot(corn$Varieties,corn$Type,corn$Mean, xlab="Corn Variety", ylab="Means of Total Phenolic Content", main="Corn Interaction Plot", trace.label="Corn Type")
#creates a plot that shows the interaction of corn type and variety on a corn's phenolic content
#Residual vs Fit
#Corn Type
plot(fitted(model_type),residuals(model_type), main="Residual vs Fitted Plot for Corn Type")
#Corn Variety
plot(fitted(model_variety),residuals(model_variety), main="Residual vs Fitted Plot for Country of Origin")
#Corn Interaction
plot(fitted(model_type_variety),residuals(model_type_variety), main="Residual vs Fitted Plot for Interaction")