12 points Six samples of each of four types of cereal grain
(12 points) Six samples of each of four types of cereal grain grown in a certain region were analyzed to determine thiamine content (g/g). Use the graindata.csv data set and R code from Data Sets and Code to analyze whether there is evidence that the mean thiamine content differs among the grain types.
a. (3 points) Plot and paste a side-by-side box plot that compares the thiamine content among the grain types. From the side-by-side box plot does there look to be a difference in the average thiamine content among grains? Explain which grains look to be different/same.
b. Perform a Single Factor ANOVA to test whether there is evidence that the mean thiamine content differs among the grain types.
a. (2 points) State the null and alternative hypotheses.
b. (4 points) Paste ANOVA test output from R. Use the F statistic and p-value from the output to make a conclusion about the test. Use a significance level of 0.05. Include context from the problem.
c. (3 points) Perform a Tukey’s Multiple Comparison procedure. Paste the R output. Are there any individual comparisons that are significant at the 0.05 significance level? If so, state which ones and give the estimated difference.
data of ST314 Student Information Survey(2).
Data of graindata:
GIVEN CODE:
# Download the ST314 Student Survey Data.
# Save it where you will remember.
# Upload Data Set into R.
# Highlight and Run the line below. Select the data file from browse window.
# The data has now been named \"st314data\"
st314data = read.csv(file.choose(), header = TRUE)
# Take a look at st314data. By running the name.
st314data
# Part 1 OPTIONAL.
# This code will recreate the information provided in the Data Analysis Part 1
# Creates a side by side boxplot
boxplot(st314data$CloseFriends~st314data$Profile, horizontal = TRUE,
main = \"Number of Reported Close Friends
among ST314 Summer Students w/
or w/out a Social Networking Profile\", col = \"aquamarine\" ,
xlab = \"Number of Close Friends\",
axes = FALSE)
axis(1, at = seq(0,50,5))
axis(2, at = c(1,2), labels = c(\"No Profile\", \"Profile\"))
# Performs a Pooled Two Sample T Test assumes population variances are the same.
t.test(st314data$CloseFriends~st314data$Profile, var.equal = TRUE)
# Get Summary Statistics for each group
Profile.Average = mean(st314data$CloseFriends[st314data$Profile==\"TRUE\"])
Profile.Average
Profile.sd = sd(st314data$CloseFriends[st314data$Profile==\"TRUE\"])
Profile.sd
Profile.n = length(st314data$CloseFriends[st314data$Profile==\"TRUE\"])
Profile.n
NOProfile.Average = mean(st314data$CloseFriends[st314data$Profile==\"FALSE\"])
NOProfile.Average
NOProfile.sd = sd(st314data$CloseFriends[st314data$Profile==\"FALSE\"])
NOProfile.sd
NOProfile.n = length(st314data$CloseFriends[st314data$Profile==\"FALSE\"])
NOProfile.n
# Part 2g
# Perform a Welch\'s Two Sample T Test
t.test(st314data$CloseFriends~st314data$Profile)
# Part 3
# Download and Save the grain data set.
# Upload Data Set into R.
# Highlight and Run the line below. Select the data file from browse window.
# The data has now been named \"gdata\"
gdata = read.csv(file.choose(), header = TRUE)
# Take a look at gdata. By running the name.
gdata
# Create a boxplot of thiamin content vs grain type.
boxplot(gdata$thiamine~gdata$grain, col = \"yellow\", main = \"Thiamine Content among Four Types of Cereal Grain\")
# Perform a Single-Factor ANOVA to compare mean thiamine of the four grain types.
mod = aov(gdata$thiamine~gdata$grain)
summary(mod)
# If the test is significant from the Single Factor ANOVA, perform a multiple comparisons procedure.
TukeyHSD(mod)
| SchoolWorkHours | CreditHours | SchoolMaterialsDollars | TermstoGrad | Height | Job | Salary | CloseFriends | Activity | TextMessages | Profile | SocialTime | WeightDesire | DayBorn | Gender | FemalePresident | GradSchool | SubjectPreferred |
| 14 | 6 | 100 | 9 | 62 | 2 | 57000 | 3 | 60 | 60 | TRUE | 10 | Maintain | Wednesday | Female | FALSE | FALSE | Math |
| 12 | 3 | 75 | 6 | 64 | 4 | 70000 | 3 | 60 | 100 | TRUE | 30 | Maintain | Sunday | Female | TRUE | TRUE | Math |
| 8 | 3 | 900 | 2 | 66 | 8 | 85000 | 3 | 120 | 30 | TRUE | 30 | Maintain | Friday | Female | TRUE | TRUE | Math |
| 24 | 7 | 100 | 8 | 63 | 1 | 50000 | 3 | 30 | 28 | FALSE | 0 | Increase | Thursday | Female | TRUE | FALSE | Math |
| 10 | 3 | 85 | 2 | 62 | 8 | 60000 | 11 | 300 | 26 | TRUE | 20 | Maintain | Saturday | Female | TRUE | TRUE | Math |
| 10 | 12 | 100 | 8 | 60 | 2 | 20000 | 5 | 60 | 60 | TRUE | 100 | Decrease | Tuesday | Female | TRUE | TRUE | Math |
| 20 | 10 | 200 | 2 | 49 | 3 | 80000 | 5 | 75 | 60 | TRUE | 15 | Maintain | Monday | Female | TRUE | TRUE | Math |
| 14 | 6 | 130 | 9 | 68.5 | 4 | 55000 | 15 | 30 | 34 | TRUE | 60 | Decrease | Wednesday | Female | TRUE | FALSE | Writing |
| 9 | 3 | 80 | 10 | 69 | 1 | 55000 | 10 | 30 | 55 | TRUE | 60 | Decrease | Friday | Female | TRUE | TRUE | Math |
| 10 | 6 | 100 | 8 | 72 | 6 | 70000 | 4 | 45 | 75 | TRUE | 45 | Maintain | Tuesday | Female | TRUE | FALSE | Math |
| 8 | 6 | 150 | 12 | 62 | 3 | 60000 | 4 | 60 | 20 | TRUE | 60 | Maintain | Monday | Female | TRUE | FALSE | Math |
| 10 | 6 | 0 | 3 | 78 | 1 | 50000 | 2 | 100 | 100 | TRUE | 120 | Decrease | Friday | Female | TRUE | TRUE | Math |
| 4 | 6 | 200 | 7 | 63 | 1 | 50000 | 5 | 60 | 500 | TRUE | 300 | Decrease | Sunday | Female | TRUE | TRUE | Math |
| 12 | 15 | 400 | 3 | 62 | 7 | 70000 | 3 | 90 | 100 | TRUE | 45 | Decrease | Tuesday | Female | TRUE | TRUE | Math |
| 3 | 3 | 80 | 2 | 64 | 3 | 55000 | 4 | 60 | 30 | TRUE | 30 | Decrease | Friday | Female | TRUE | TRUE | Math |
| 3 | 3 | 75 | 8 | 65 | 0 | 40000 | 15 | 30 | 10 | TRUE | 30 | Decrease | Friday | Male | TRUE | TRUE | Math |
| 2 | 7 | 200 | 8 | 76 | 3 | 60000 | 5 | 60 | 30 | TRUE | 120 | Decrease | Thursday | Male | TRUE | FALSE | Math |
| 18 | 8 | 0 | 4 | 72 | 2 | 50000 | 6 | 30 | 10 | TRUE | 5 | Increase | Wednesday | Male | TRUE | FALSE | Math |
| 6.5 | 3 | 1000 | 5 | 70 | 5 | 50000 | 8 | 60 | 5 | FALSE | 0 | Increase | Wednesday | Male | TRUE | TRUE | Math |
| 3 | 12 | 100 | 1 | 69 | 1 | 50000 | 2 | 120 | 100 | TRUE | 4 | Maintain | Sunday | Male | TRUE | FALSE | Math |
| 24 | 12 | 200 | 8 | 180 | 1 | 58000 | 6 | 120 | 60 | TRUE | 60 | Decrease | Wednesday | Male | TRUE | TRUE | Math |
| 20 | 6 | 75 | 1 | 73 | 4 | 65000 | 4 | 45 | 100 | TRUE | 60 | Decrease | Monday | Male | FALSE | FALSE | Math |
| 4 | 3 | 0 | 8 | 74 | 3 | 60000 | 8 | 30 | 100 | TRUE | 20 | Decrease | Monday | Male | TRUE | FALSE | Math |
| 7 | 8 | 200 | 14 | 71 | 1 | 80000 | 2 | 100 | 10 | TRUE | 360 | Maintain | Monday | Male | TRUE | TRUE | Writing |
| 15 | 3 | 30 | 4 | 74 | 8 | 70000 | 8 | 30 | 62 | TRUE | 5 | Decrease | Thursday | Male | TRUE | FALSE | Math |
| 21 | 9 | 3000 | 8 | 67 | 2 | 70000 | 17 | 60 | 12 | TRUE | 30 | Decrease | Wednesday | Male | TRUE | TRUE | Math |
| 25 | 13 | 400 | 8 | 71 | 1 | 65000 | 5 | 190 | 15 | TRUE | 45 | Increase | Thursday | Male | TRUE | FALSE | Math |
| 50 | 16 | 300 | 2 | 75 | 5 | 95000 | 15 | 30 | 400 | TRUE | 180 | Decrease | Tuesday | Male | TRUE | FALSE | Math |
| 8 | 3 | 200 | 4 | 70 | 6 | 70000 | 6 | 60 | 500 | TRUE | 300 | Increase | Sunday | Male | TRUE | TRUE | Math |
| 22 | 8 | 2000 | 8 | 69 | 2 | 40000 | 12 | 60 | 20 | TRUE | 2 | Maintain | Thursday | Male | FALSE | TRUE | Math |
| 6 | 10 | 150 | 8 | 69 | 1 | 60000 | 3 | 60 | 10 | TRUE | 60 | Maintain | Saturday | Male | TRUE | FALSE | Math |
| 24 | 11 | 130 | 7 | 72 | 18 | 55000 | 5 | 30 | 10 | TRUE | 60 | Maintain | Saturday | Male | TRUE | FALSE | Math |
| 20 | 3 | 1000 | 1 | 69 | 4 | 40000 | 1 | 65 | 4 | TRUE | 80 | Decrease | Tuesday | Male | FALSE | FALSE | Math |
| 5 | 7 | 150 | 2 | 72 | 8 | 110000 | 9 | 60 | 200 | TRUE | 15 | Maintain | Wednesday | Male | TRUE | FALSE | Writing |
| 3 | 3 | 0 | 8 | 73 | 2 | 70000 | 5 | 30 | 30 | TRUE | 60 | Decrease | Tuesday | Male | TRUE | TRUE | Math |
| 25 | 10 | 300 | 1 | 72 | 3 | 70000 | 4 | 30 | 10 | TRUE | 60 | Maintain | Thursday | Male | TRUE | TRUE | Math |
| 2 | 3 | 70 | 3 | 70 | 1 | 30000 | 4 | 0 | 8 | TRUE | 0 | Increase | Wednesday | Male | TRUE | FALSE | Math |
| 3.5 | 8 | 200 | 4 | 72 | 2 | 45000 | 3 | 45 | 3 | TRUE | 0 | Increase | Saturday | Male | TRUE | FALSE | Writing |
| 6 | 6 | 200 | 7 | 72 | 0 | 30000 | 3 | 15 | 3 | TRUE | 300 | Increase | Tuesday | Male | FALSE | TRUE | Math |
| 10 | 13 | 250 | 10 | 70 | 2 | 50000 | 3 | 70 | 20 | TRUE | 30 | Maintain | Thursday | Male | TRUE | FALSE | Math |
| 5 | 4 | 150 | 8 | 75 | 2 | 70000 | 10 | 40 | 20 | TRUE | 45 | Decrease | Monday | Male | TRUE | TRUE | Math |
| 20 | 7 | 160 | 7 | 71 | 4 | 70000 | 10 | 0 | 20 | TRUE | 20 | Maintain | Tuesday | Male | TRUE | TRUE | Writing |
| 45 | 19 | 175 | 4 | 75 | 7 | 60000 | 9 | 45 | 50 | TRUE | 30 | Increase | Thursday | Male | TRUE | TRUE | Math |
| 8 | 10 | 250 | 6 | 72 | 5 | 60000 | 10 | 120 | 50 | TRUE | 75 | Increase | Wednesday | Male | FALSE | FALSE | Math |
| 20 | 3 | 100 | 6 | 71.5 | 0 | 77720 | 5 | 60 | 15 | TRUE | 90 | Increase | Tuesday | Male | FALSE | TRUE | Math |
| 30 | 14 | 600 | 13 | 73 | 2 | 79000 | 12 | 30 | 500 | TRUE | 60 | Decrease | Tuesday | Male | TRUE | FALSE | Math |
| 30 | 12 | 600 | 4 | 69 | 10 | 70000 | 4 | 30 | 20 | TRUE | 30 | Maintain | Tuesday | Male | TRUE | FALSE | Math |
| 4 | 6 | 100 | 8 | 73 | 13 | 50000 | 1 | 20 | 0 | TRUE | 30 | Decrease | Sunday | Male | TRUE | TRUE | Math |
| 10 | 4 | 0 | 2 | 76 | 3 | 35000 | 2 | 60 | 5 | TRUE | 60 | Decrease | Wednesday | Male | TRUE | FALSE | Writing |
| 9 | 3 | 80 | 4 | 66 | 6 | 50000 | 5 | 90 | 12 | FALSE | 0 | Decrease | Thursday | Male | TRUE | FALSE | Math |
| 10 | 3 | 0 | 7 | 72 | 1 | 35000 | 5 | 60 | 10 | TRUE | 40 | Maintain | Sunday | Male | TRUE | FALSE | Math |
| 10 | 6 | 75 | 8 | 65 | 0 | 20000 | 50 | 180 | 100 | FALSE | 0 | Decrease | Wednesday | Male | TRUE | TRUE | Writing |
| 6 | 3 | 200 | 6 | 68 | 3 | 63000 | 1 | 120 | 10 | TRUE | 10 | Decrease | Tuesday | Male | TRUE | FALSE | Math |
| 4 | 3 | 200 | 8 | 69 | 4 | 75000 | 4 | 300 | 250 | TRUE | 60 | Decrease | Wednesday | Male | TRUE | TRUE | Math |
| 6 | 9 | 300 | 8 | 5.6 | 0 | 58000 | 1 | 50 | 23 | TRUE | 300 | Decrease | Sunday | Male | TRUE | TRUE | Math |
| 16 | 12 | 100 | 8 | 72 | 4 | 40000 | 3 | 20 | 18 | TRUE | 120 | Decrease | Thursday | Male | TRUE | TRUE | Writing |
| 10 | 3 | 75 | 10 | 67 | 3 | 80000 | 4 | 120 | 2 | TRUE | 120 | Increase | Tuesday | Male | TRUE | TRUE | Math |
| 5 | 3 | 1350 | 9 | 70 | 12 | 75000 | 2 | 510 | 11 | FALSE | 0 | Maintain | Saturday | Male | TRUE | FALSE | Math |
| 20 | 10 | 150 | 8 | 71 | 3 | 40000 | 3 | 60 | 10 | TRUE | 30 | Increase | Tuesday | Male | FALSE | TRUE | Math |
| 15 | 4 | 133 | 8 | 64.5 | 0 | 40000 | 8 | 15 | 56 | TRUE | 30 | Increase | Wednesday | Male | TRUE | TRUE | Math |
| 4 | 13 | 300 | 8 | 67 | 3 | 80000 | 2 | 70 | 150 | TRUE | 15 | Maintain | Monday | Male | TRUE | TRUE | Math |
Solution
Using Minitab the oneway ANOVA code is,
Minitab output is,



