IQ <- read.csv("C:/Users/mason/Downloads/IQ.csv")
View(IQ)
DRP <- read.csv("C:/Users/mason/Downloads/DRP.csv")
View(DRP)
t.test(DRP$Response~DRP$Treatment, conf.level = 0.95, alternative="two.sided")
## 
##  Welch Two Sample t-test
## 
## data:  DRP$Response by DRP$Treatment
## t = -2.3109, df = 37.855, p-value = 0.02638
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -18.67588  -1.23302
## sample estimates:
## mean in group Control mean in group Treated 
##              41.52174              51.47619

The lower bound for the 95% confidence interval for the difference in average DRP score is (-18.6759)

The upper bound for the 95% confidence interval for the difference in average DRP score is (-1.2330)

teststatistic = t.test(DRP$Response~DRP$Treatment, conf.level = 0.95, alternative = "less")

I am 95% confident that on average the treatment group scored higher than the control on the DRP test by between 1.2330 and 18.6759.

Null Hypothesis: (Control Group Average Score)≥(Treatment Group Average Score)

Alternative Hypothesis: (Control Group Average Score)<(Treatment Group Average Score)

Test Statistic= -2.3109

The average difference between (Average of Control)-(Average of Treatment) is 2.3109 standard errors below the hypothesized difference of 0, according to the null hypothesis.

teststatistic$p.value
## [1] 0.01319121

The p-value for the test statistic if the null were true is 0.01319

If the null hypothesis is true, that the control groups average scores on the DRP test are greater than or equal to the treatment groups average scores, then we would observe our data 1.319% of the time.

α = .05

p-value (0.01319) < α (.05), therefore we reject the null hypothesis.

At the 5% significance level, there is sufficient evidence to support the claim that on average the treatment group scored higher on the DRP test than the control group.

anova(lm(IQ$iq~IQ$group))
## Analysis of Variance Table
## 
## Response: IQ$iq
##           Df Sum Sq Mean Sq F value    Pr(>F)    
## IQ$group   2 1529.4  764.69  20.016 7.843e-07 ***
## Residuals 42 1604.5   38.20                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Null Hypothesis: mean of a=mean of b=mean of c

Alternative Hypothesis: At least one of the group means is not equal to another

The F-statistic value is 20.016

The P-value from the F table is Pr(F>11.70)=.0001

The P-value from ANOVA table is 7.843e-07

If the null hypothesis were true, that there is no difference in the average IQ scores between majors, then we would observe our data .00007843% of the time.

Given α=.001 P-Value (7.843e-07) < α (.001) We reject the null hypothesis as p-value is less than alpha.

At the 0.1% significance level, there is sufficient evidence to support the claim that at least one of the means in IQ scores between majors differs.

qqnorm(IQ$iq, main = "Plot of Sample versus Theoretical Quantiles", pch=19)
qqline(IQ$iq)

hist(IQ$iq, main = "Histogram of IQ", col = rainbow(9), xlab = "IQ")

By analyzing the QQ plot, it is reasonable to conclude the data is not normally distributed as a seemingly significant portion of the data is not near the normal line. Furthermore, when the data is plotted on a histogram, it is evident from the shape of said histogram that the data is not normally distributed and appears to be left skewed.

IQ <- read.csv("C:/Users/mason/Downloads/IQ.csv")
View(IQ)
DRP <- read.csv("C:/Users/mason/Downloads/DRP.csv")
View(DRP)
t.test(DRP$Response~DRP$Treatment, conf.level = 0.95, alternative="two.sided")
teststatistic = t.test(DRP$Response~DRP$Treatment, conf.level = 0.95, alternative = "less")
teststatistic$p.value
anova(lm(IQ$iq~IQ$group))
qqnorm(IQ$iq, main = "Plot of Sample versus Theoretical Quantiles", pch=19)
qqline(IQ$iq)
hist(IQ$iq, main = "Histogram of IQ", col = rainbow(9), xlab = "IQ")