Wk9_assignment_SP24 (1)

.docx

School

Phoenix College *

*We aren’t endorsed by this school

Course

24

Subject

Statistics

Date

Apr 3, 2024

Type

docx

Pages

5

Uploaded by ProfessorFog12950

Report
MAR2801 Week 9 In-Class Assignment Please highlight or change the text color of your answers and code to make them distinct from the questions. Light blue highlighted code is necessary, but showing the output is not. Gray highlighted code is necessary AND you are required to show the output. For this lab, we will be using the “chickwts” dataset built into R which was an experiment “conducted to measure and compare the effectiveness of various feed supplements on the growth rate of chickens.” From the documentation we know “newly hatched chicks were randomly allocated into six groups, and each group was given a different feed supplement. Their weights in grams after six weeks are given along with feed types.” 1. (1 point) What is the independent/predictor variable in chickwts? Feed 2. (1 point) What is the dependent/response variable in chickwts? Weight 3. (2 points) Assuming we want to use a parametric test to compare the mean weight of chicks across feeds, list the five assumptions we must meet: The weights of chicks for each group should be normal distributed(normality) The variances of the weight of the chickens should be approximately equal between all of them The weight of each chick should be independent compared to the weight of other chicks The weight data should be measured on an interval or ratio scale The sampling for the data collection should be random 4. (2 points) Use the given code to subset the “horsebean” feed from the “chickwts” dataset. If we were to run a Shapiro-Wilk test of normality on this subset, what would our null and alternative hypotheses be? Make sure they are tailored to the dataset. HB <- subset(chickwts,feed=="horsebean") H0: The data is normally distributed among the chicks that were fed horsebean Ha: The data is not normally distributed among the chicks that were fed horsebean 5. (2 points) Run the Shapiro-Wilk test of normality on the subset created in question 4. Interpret the output. Shapiro-Wilk normality test data: HB$weight W = 0.93758, p-value = 0.5264
shapiro.test(HB$weight) The p-value is greater than 0.05 so we cannot reject the null hypothesis, meaning the data cannot statistically reject the claim of normality. 6. (2 points) Use the given code to create a q-q plot of the subset created in Question 4. a) Does this confirm the results of Shapiro-Wilk test from question 5? Yes b) Why or why not? Since Shapiro-Wilk test provides a p-value (0.5264) that suggests we fail to reject the null hypothesis of normality but Q-Q shows the data points scattered around a diagonal line nad the points close to the diagonal, indicating potential normality.But we should have bigger data info to be more sure c) Include the plot in your answer. library(ggplot2) ggplot(HB,aes(sample=weight))+ geom_qq()+ geom_qq_line() 7. (2 points) Consider the contents of the subset “HB” created in Question 4: a. Can we run a homogeneity of variance test on this subset? No b. Why or why not?
The test assesses if the variances spread of data are equal across different groups but I only have one Hb that I cannot compare with nothing else . 8. (2 points) Run the Shapiro-Wilk test of normality on the full “chickwts” dataset to determine if each feed is normally distributed. Interpret the output. For all feed types (casein, horsebean, linseed, meatmeal, soybean, sunflower), the p-values are greater than 0.05 so is no evidence to reject the null hypothesis of normality so we have normal distribution tapply(chickwts$weight,chickwts$feed,function(x) shapiro.test(x)) > tapply(chickwts$weight,chickwts$feed,function(x) shapiro.test(x)) $casein Shapiro-Wilk normality test data: x W = 0.91663, p-value = 0.2592 $horsebean Shapiro-Wilk normality test data: x W = 0.93758, p-value = 0.5264 $linseed Shapiro-Wilk normality test data: x W = 0.96931, p-value = 0.9035 $meatmeal Shapiro-Wilk normality test data: x W = 0.97914, p-value = 0.9612 $soybean Shapiro-Wilk normality test data: x W = 0.9464, p-value = 0.5064
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