Question
Please use R, provide R code if possible 1. A random sample of irises of three different species (A, B, and C) from a particular
Please use R, provide R code if possible
1. A random sample of irises of three different species (A, B, and C) from a
particular region was collected. The length and width of one petal on each flower were
recorded, along with its species. The data are available in the file flower.txt. Of interest
is the linear relationship between mean petal length and petal width, and how this
relationship differs across species. You may assume that petal lengths are independent.
a.
Write down the linear model for these data using regression notation for all
predictors. Be sure to define your variables and to state all assumptions.
b.
Write down the linear model for these data using regression notation for
numeric predictors and ANOVA notation for categorical predictors. Be sure to define
your variables and to state all assumptions.
c.
Fit the model in (a) and provide the table of parameter estimates, standard
errors, etc.
d.
Write down the equation for the fitted regression line separately for each
species.
e.
Produce a scatterplot to illustrate the relationship between petal length and
width, using a different colour for each species. Be sure to label the axes appropriately.
Include the fitted regression lines.
f.
Does the common SD assumption seem reasonable in this setting? Justify
your response, considering this question both within and across species.
g.
Does the normality assumption seem reasonable in this setting? Justify your
response.
h.
Conduct the test of whether the slopes of the regression lines vary across
species. In particular:
i.
Specify the null and alternative hypotheses.
ii.
Specify the value of the test statistic.
iii.
Specify the p-value.
iv.
Using a significance level of = 0.01, state your conclusions in the language
of the problem.
Below is data:
"Length" "Width" "Species"
1.22 0.132 "A"
1.32 0.198 "A"
1.25 0.556 "A"
1.08 0.258 "A"
1.58 0.27 "A"
1.79 0.587 "A"
1.53 0.336 "A"
1.67 -0.009 "A"
2.14 0.107 "A"
1.24 0.155 "A"
0.75 0.489 "A"
1.86 0.316 "A"
1.24 0.324 "A"
1.22 0.266 "A"
1.78 0.133 "A"
1.53 0.601 "A"
1.07 0.344 "A"
1.33 -0.149 "A"
1.48 0.384 "A"
1.42 0.149 "A"
1.49 0.03 "A"
1.3 0.2 "A"
1.59 0.039 "A"
3.9 1.18 "B"
4.14 1.201 "B"
4.02 0.989 "B"
4.72 1.494 "B"
4.19 1.357 "B"
4.24 1.098 "B"
5.08 1.577 "B"
4.61 1.411 "B"
4.23 1.267 "B"
4.36 1.505 "B"
5.07 1.502 "B"
4.34 1.49 "B"
5.3 1.464 "B"
5.01 1.437 "B"
4.14 1.314 "B"
3.77 1.265 "B"
3.85 1.25 "B"
5.55 1.887 "C"
5.43 1.984 "C"
5.26 1.773 "C"
5.48 2.46 "C"
5.69 2.268 "C"
5.12 1.801 "C"
4.89 1.945 "C"
5.35 1.933 "C"
5.98 2.182 "C"
5.33 2.009 "C"
5.8 2.077 "C"
4.96 2.02 "C"
5.52 2.017 "C"
5.91 2.3 "C"
5.63 1.981 "C"
5.78 2.329 "C"
5.12 1.716 "C"
5.32 2.143 "C"
5.19 2.051 "C"
5.62 2.069 "C"
5.25 2.102 "C"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started