Alfredo Eduardo Job - S#3685764
Last updated: 23 October, 2017
# Data reading:
Stopwatch <- read.csv('C:/Users/Alfredo/Documents/Stopwatch_data.csv')Data was generated online and copied to Ms Excel, where the rest of the variables had been added for each testing. From Excel, a .csv file was created and imported into RStudio.
Stopwatch$Gender <- Stopwatch$Gender %>% factor(levels=c(1,0), labels=c('Female','Male'))
Stopwatch$Watching <- Stopwatch$Watching %>% factor(levels=c(1,0), labels=c('Yes','No'))Stopwatch %>% group_by(Watching) %>% summarise(Min = min(Time, na.rm=TRUE),
Q1 = quantile(Time,probs= .25, na.rm=TRUE),
Median = median(Time, na.rm=TRUE),
Q3 = quantile(Time,probs= .75, na.rm=TRUE),
Max = max(Time, na.rm=TRUE),
Mean = mean(Time, na.rm=TRUE),
SD = sd(Time, na.rm=TRUE),
n=n(),
Missing=sum(is.na(Time)))boxplot(Time~Watching, data=Stopwatch, ylab="Reaction time", xlab="Watching status")
abline(h=3.000, col="red")Watching_Y <- Stopwatch %>% filter(Watching=="Yes")
Watching_Y$Time %>% qqPlot(dist="norm")Watching_N <- Stopwatch %>% filter(Watching=="No")
Watching_N$Time %>% qqPlot(dist="norm")leveneTest(Time~Watching, data=Stopwatch)TimeWatching <- Stopwatch %>% filter(Watching == 'Yes')
t.test(TimeWatching$Time, mu=3.000)##
## One Sample t-test
##
## data: TimeWatching$Time
## t = 0.78579, df = 99, p-value = 0.4339
## alternative hypothesis: true mean is not equal to 3
## 95 percent confidence interval:
## 2.954033 3.106247
## sample estimates:
## mean of x
## 3.03014
testing <- t.test(
Time~Watching,
data=Stopwatch,
var.equal=TRUE,
alternative="two.sided"
)
testing##
## Two Sample t-test
##
## data: Time by Watching
## t = 0.47167, df = 198, p-value = 0.6377
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.08435911 0.13739911
## sample estimates:
## mean in group Yes mean in group No
## 3.03014 3.00362
One-sample t-test: Our decision should be to fail to reject H0: mu = 3.000 secs as the p = 0.4339 > 0.05 and the 95% CI of the estimated population mean 3.030 secs was (2.954, 3.106), which captures mu = 3.000. The results of the one-sample t-test were not statistically significant. This meant that the mean time of rhyhtm while watching was similar to the 3.000 secs stated.
Two independet samples t-test: Our decision should be to fail to reject H0: mu1 = mu2 as the p = 0.6377 > 0.05 and the 95% CI of the estimated population difference (-0.084, 0.137), which captures H0: mu1 - mu2 = 0. The results of the two-sample t-test were not statistically significant. This meant that the mean time of rhyhtm while watching was not too different to the mean time of rhythm while not watching.