MAT 3378 Midterm (Spring 2022)
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
MAT 3378 Midterm (Spring 2022)
Instructions
1) Please submit your solutions to this assignment in one PDF file in brightspace. Only one file will be accepted.
2) You can submit a PDF file more than once. However, only the last submission will be saved. If you want to modify your submission, that is fine as long as it is before the deadline.
3) Late submissions of the assignment are not going to be marked.
4) You will need to use R to compute a few quantiles and probabilities from t and F distributions, and Tukey’s studentized range distribution.
5) Your answer must be hand-written. Typed solutions are not going to be accepted.
6) It is not necessary to print the questions. Only provide your answers without the questions.
7) If you do not have a scanner, please combine images of your hand-written solutions as one PDF. (See https://imagetopdf.com/ as a possible solution to combine images as one PDF or camscanner).
8) The duration of the exam is 60 minutes, and an extra 20 minutes is given to prepare and upload your documents.
9) There are 3 questions.
10) The midterm will be a proctored exam. Please go to the zoom meeting with your camera open. You will stratified in 4 breakrooms. Each breakout room will have a proctor. The professor will be moving from breakout room to breakout room during the midterm.
11) For students registered with SASS, the professor will manually give you extra time in Brightspace. An email will be sent to you once the extra time has been entered in the system.
12) It is individual work. Do not work in teams.
13) Good luck on your midterm.
1. A rehabilitation researcher was interested in examining the relationship between physical fitness prior to surgery of persons undergoing corrective knee surgery and time required in physical therapy until successful rehabilitation. Data on the number of days required for successful completion of physical therapy and the prior physical fitness status (below average, average, above average) were collected.
(a) Is this study experimental, observations, or mixed?
(b) Identify all factors, factor levels, and factor-level combinations. For each factor indicate if it is experi- mental or observational.
(c) What is the response variable?
(d) We import the data and display the structure of the dataframe.
rehab<-read .csv ("RehabilitationStudy .csv")
str(rehab)
## ’data .frame’: 24 obs . of 2 variables:
## $ Time : int 29 42 38 40 43 40 30 42 30 35 . . .
## $ Fitness: chr "Below avg" "Below avg" "Below avg" "Below avg" . . .
We coerse Fitness as a factor and reorder its levels since it is an ordinal variable (i.e. its levels have a natural order). We also display group descriptive statistics for the rehab time according to the prior-surgery fitness level.
rehab$Fitness<-factor(rehab$Fitness,
levels=c ("Below avg" , "Avg" , "Above Avg"))
source ("MyFunctions .r")
library(plyr)
stats<-ddply(rehab, . (Fitness), summarize,
Mean = my .mean (Time),
StdDev = my .sd (Time),
n = my .size (Time))
stats
## Fitness Mean StdDev n
## 1 Below ## 2 ## 3 Above |
avg Avg Avg |
38 32 24 |
5 .477 8 3 .464 10 4 .427 6 |
Suppose that it is reasonable to analyze these data with a one-factor ANOVA model with fixed effects. Give a point estimate for the error variance 72 .
2. Refer to the study from Question 1. Consider the following linear combination of the group level
means:
L = (u1 − u2 ) − (u2 − u3 ) = u1 − 2 u2 + u3 ,
where 1=“below avg”, 2=“avg”, 3=“above avg”. We want to know if the gap in mean rehab time is bigger between “below avg” and “avg” or bigger between “avg” and “above avg”.
(a) Is L is a contrast of the group means? (Why?)
(b) Assume homogeneity of variance. Give a 95% confidence for L.
(c) Using the confidence interval from (b). Answer the following question: Is the gap in mean rehab time is bigger between “below avg” and “avg” or bigger between “avg” and “above avg”? Write a few sentences to answer this question.
3. A company uses six filling machines of the same make and model to place detergent into cartons that show a label of 32 ounces. The production manager has complained that the six machines do not place the same amount of fill into the cartons. A consultant requested that 20 filled cartons be selected randomly from each of the six machines and the content of each carton carefully weighed. The response is the deviation from 32 ounces.
(a) Is this study experimental, observations, or mixed?
(b) Identify all factors, factor levels, and factor-level combinations. For each factor indicate if it is experi- mental or observational.
(c) What type of design is being implemented here?
(d) We import the data and display the structure of the dataframe. We also coerse the variable Machine to a factor, and display the factor levels.
filling<-read .csv ("FillingMachine .csv")
filling$Machine<-factor(filling$Machine)
str(filling)
## ’data .frame’: 120 obs . of 2 variables:
## $ Response: num -0 .14 0 .2 0 .07 0 .18 0 .38 0 .1 -0 .04 -0 .27 0 .27 -0 .21 . . . ## $ Machine : Factor w/ 6 levels "1","2","3","4", . . : 1 1 1 1 1 1 1 1 1 1 . . .
levels(filling$Machine)
## [1] "1" "2" "3" "4" "5" "6"
Assume that it is reasonable to use a one-Factor ANOVA model with fixed effects to analyze these data. We use Tukey’s method to compare the machines pairwise.
model<-aov (Response ~ Machine, data=filling)
TukeyHSD(model)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = Response ~ Machine, data = filling)
##
## $Machine
## diff lwr upr p adj
## 2-1 0 .1170 -0 .0443194 0 .2783194 0 .2934937
## 3-1 0 .3865 0 .2251806 0 .5478194 0 .0000000
## 4-1 0 .2920 0 .1306806 0 .4533194 0 .0000106
## 5-1 0 .0515 -0 .1098194 0 .2128194 0 .9392011
## 6-1 0 .0780 -0 .0833194 0 .2393194 0 .7260015
## 3-2 0 .2695 0 .1081806 0 .4308194 0 .0000588
## 4-2 0 .1750 0 .0136806 0 .3363194 0 .0252432
## 5-2 -0 .0655 -0 .2268194 0 .0958194 0 .8469184
## 6-2 -0 .0390 -0 .2003194 0 .1223194 0 .9815028
## 4-3 -0 .0945 -0 .2558194 0 .0668194 0 .5359056
## 5-3 -0 .3350 -0 .4963194 -0 .1736806 0 .0000003
## 6-3 -0 .3085 -0 .4698194 -0 .1471806 0 .0000029
## 5-4 -0 .2405 -0 .4018194 -0 .0791806 0 .0004684
## 6-4 -0 .2140 -0 .3753194 -0 .0526806 0 .0026737
## 6-5 0 .0265 -0 .1348194 0 .1878194 0 .9968910
Use the Insert and Absorb Algorithm to group machines that a non-HDS with a familywise error of 5%. Give your final result with a table where each row are machines that are non-HSD.
2022-07-26