19BCE1567_EDA_LAB4

pdf

School

University of South Carolina *

*We aren’t endorsed by this school

Course

MISC

Subject

Statistics

Date

Apr 3, 2024

Type

pdf

Pages

3

Uploaded by JudgeDeerMaster933

Report
19BCE1567 03/02/2022 SARA KULKARNI L21+L22 SLOT: PROF LAKHSMI PATHI EDA LAB 4 Tasks for Week-4: Analysis of Variance (ANOVA) Aim: Perform ANOVA test and determine the statistical differences between the means of individual groups given in the data ALGORITHM: 1. Start 2. Read the data into the data variable 3. Group the data with respect to color using the group_by command in dplyr library, summarize the count and mean for the column responses 4. Generate the ANOVA model using the ANOVA command, display the summary 5. The F-value is less than 0.05, we reject the null hypothesis 6. Using Tukey HSD (Tukey Honest Significant Differences) we compare the p-adj value for the 3 groups (red,blue,green) STATISTICS: > head(data) block color response 1 a red 1.9
2 b red 2.6 3 c red 3.4 4 d red 0.8 5 e red 5.3 6 f red 1.5 > group_by(data,color) %>% summarise(count = n(),mean = mean(response, na.rm = TRUE)) # A tibble: 3 x 3 color count mean <chr> <int> <dbl> 1 blue 24 10.6 2 green 24 8.53 3 red 24 2.49 > ANOVA <- aov(response~color, data = data) > summary(ANOVA) Df Sum Sq Mean Sq F value Pr(>F) color 2 857.2 428.6 14.81 4.44e-06 *** Residuals 69 1996.4 28.9 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > TukeyHSD(ANOVA) Tukey multiple comparisons of means 95% family-wise confidence level Fit: aov(formula = response ~ color, data = data) $color diff lwr upr p adj green-blue -2.101667 -5.821045 1.617711 0.3709119 red-blue -8.140417 -11.859795 -4.421039 0.0000049 red-green -6.038750 -9.758128 -2.319372 0.0006628 INFERENCE: We can infer that on performing ANOVA , we get the p-value as 4.44e-06 (which is less than 0.05) , so we can reject the null hypothesis.
Using Tukey HSD (Tukey Honest Significant Differences) we compare the p-adj values of the different groups PROGRAM: # To clear the environment rm(list=ls()) # To create the data data <-read.csv("color- anova.csv") head(data) library(dplyr) # To group the data group_by(data,color) %>% summarise(count = n(),mean = mean(response, na.rm = TRUE)) # ANOVA ANOVA <- aov(response~color, data = data) summary(ANOVA) TukeyHSD(ANOVA)
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