C2M2_peer_reviewed

.pdf

School

Poolesville High *

*We aren’t endorsed by this school

Course

DTSA5003

Subject

Statistics

Date

Jun 3, 2024

Type

pdf

Pages

12

Uploaded by MateComputerAntelope99

C2M2_peer_reviewed May 19, 2024 1 C2M2: Peer Reviewed Assignment 1.0.1 Outline: The objectives for this assignment: 1. Utilize contrasts to see how different pairwise comparison tests can be conducted. 2. Understand power and why it’s important to statistical conclusions. 3. Understand the different kinds of post-hoc tests and when they should be used. General tips: 1. Read the questions carefully to understand what is being asked. 2. This work will be reviewed by another human, so make sure that you are clear and concise in what your explanations and answers. 2 Problem 1: Contrasts and Coupons Consider a hardness testing machine that presses a rod with a pointed tip into a metal specimen with a known force. By measuring the depth of the depression caused by the tip, the hardness of the specimen is determined. Suppose we wish to determine whether or not four different tips produce different readings on a hardness testing machine. The experimenter has decided to obtain four observations on Rockwell C- scale hardness for each tip. There is only one factor - tip type - and a completely randomized single- factor design would consist of randomly assigning each one of the 4×4=16 runs to an experimental unit, that is, a metal coupon, and observing the hardness reading that results. Thus, 16 different metal test coupons would be required in this experiment, one for each run in the design. [8]: tip <- factor(rep( 1 : 4 , each = 4 )) coupon <- factor(rep( 1 : 4 , times = 4 )) y <- c( 9.3 , 9.4 , 9.6 , 10 , 9.4 , 9.3 , 9.8 , 9.9 , 9.2 , 9.4 , 9.5 , 9.7 , 9.7 , 9.6 , 10 , 10.2 ) hardness <- data . frame(y, tip, coupon) hardness 1
A data.frame: 16 × 3 y tip coupon <dbl> <fct> <fct> 9.3 1 1 9.4 1 2 9.6 1 3 10.0 1 4 9.4 2 1 9.3 2 2 9.8 2 3 9.9 2 4 9.2 3 1 9.4 3 2 9.5 3 3 9.7 3 4 9.7 4 1 9.6 4 2 10.0 4 3 10.2 4 4 2.0.1 1. (a) Visualize the Groups Before we start throwing math at anything, let’s visualize our data to get an idea of what to expect from the eventual results. Construct interaction plots for tip and coupon using ggplot(). Be sure to explain what you can from the plots. [14]: # Your Code Here library(dplyr) library(ggplot2) hardness %>% ggplot(aes(x = tip, y = y, fill = coupon)) + geom_boxplot() + labs(x = "Tip Type" , y = "Hardness" , fill = "Coupon Type" , title = "Boxplot of Hardness by Tip Type and Coupon Type" ) hardness %>% ggplot(aes(y = y, x = tip)) + geom_smooth(method = "lm" , se = TRUE, aes(group = coupon, color = coupon)) + labs(x = "Tip Type" , color = "Coupon Type" , y = "Hardness" , title = "Linear Models for Tip type Vs. Hardness" ) 2
hardness %>% ggplot(aes(y = y, x = tip)) + geom_line(aes(group = coupon, color = coupon)) + labs(x = "Tip Type" , color = "Coupon Type" , y = "Hardness" , title = "Line Plots of Tip type Vs. Hardness, group by Coupon Type" ) hardness %>% ggplot(aes(x = tip, y = y)) + geom_point(aes(color = coupon)) + facet_wrap( ~ coupon) + labs(x = "Tip Type" , y = "Hardness" , color = "Coupon Type" , title = "Scatterplot for Tip type Vs. Hardness, Faceted by Coupon Type" ) `geom_smooth()` using formula 'y ~ x' 3
4
5
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help