Average Reaction Time

Compared with School Students

Chris Timke s3868828

25/10/2020

Introduction

Introduction Cont.

Problem Statement

Data

Data Cont.

Descriptive Statistics and Visualisation

# reading in data set

students <- read.csv("1602471975663_DATA.csv")

str(students$Reaction_time)
##  chr [1:250] ".509" ".395" ".384" "0.5" ".386" ".346" "" ".69" ".39" ".761" ...
students$Reaction_time <- as.numeric(students$Reaction_time)

studentsTest <- students %>% select(Reaction_time)

# number of NAs

sum(is.na(studentsTest))
## [1] 22
# remove NAs

studentsTest <- na.omit(studentsTest)

sum(is.na(studentsTest))
## [1] 0

Decsriptive Statistics Cont.

# reaction_time outliers and NAs
boxplot(studentsTest$Reaction_time)

which(abs(studentsTest$Reaction_time) >0.9)
## [1]  13  17  31  65 175 184 213
reaction_time_outliers <- studentsTest %>% filter(Reaction_time >1)

studentsTest2 <- studentsTest %>% filter(Reaction_time <0.9 & Reaction_time >0.10)

boxplot(studentsTest2$Reaction_time)

hist(studentsTest2$Reaction_time)

- While the distribution is skewed, we know the sampling distribution of a population mean with a sample size greater than 30, as is here n = 216, will be approximately normally distributed with a mean equal to the population mean.

Decsriptive Statistics Cont.

studentsTest2 %>% summarise(Min = min(Reaction_time,na.rm = TRUE),
                                           Q1 = quantile(Reaction_time,probs = .25,na.rm = TRUE),
                                           Median = median(Reaction_time, na.rm = TRUE),
                                           Q3 = quantile(Reaction_time,probs = .75,na.rm = TRUE),
                                           Max = max(Reaction_time,na.rm = TRUE),
                                           Mean = mean(Reaction_time, na.rm = TRUE),
                                           SD = sd(Reaction_time, na.rm = TRUE),
                                           n = n(),
                                           Missing = sum(is.na(Reaction_time))) -> table
knitr::kable(table)
Min Q1 Median Q3 Max Mean SD n Missing
0.129 0.35475 0.4305 0.58525 0.891 0.4729306 0.1677707 216 0

Hypothesis Testing

The Null hypothesis for this question is \[H_0: \mu = 0.2\sec\]

The Alternate hypothesis for this question is \[H_A: \mu \ne 0.2\sec\]

Hypthesis Testing Cont.

t.test(studentsTest2$Reaction_time, mu = 0.2)
## 
##  One Sample t-test
## 
## data:  studentsTest2$Reaction_time
## t = 23.909, df = 215, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 0.2
## 95 percent confidence interval:
##  0.4504302 0.4954309
## sample estimates:
## mean of x 
## 0.4729306
qt(p = .975, df = 216-1)
## [1] 1.971059

Discussion

Discussion Cont.

References