R - (dependent|paired sample) t-test

> Procedural Languages > R

1 - About

(dependent|paired sample) t-test in R

  • The Mean of differences is the point estimate
  • The confidence interval is the interval estimate around the mean difference (not around the mean of the samples)

3 - Package

3.1 - stats

3.1.1 - dependent t-test

t.test(data$pre, data$post, paired = T)
	Paired t-test

data:  data$pre and data$post
t = -9.0089, df = 39, p-value = 4.511e-11
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -2.41843 -1.53157
sample estimates:
mean of the differences 
                 -1.975 
Advertising

3.2 - lsr

3.2.1 - Effect size

<MATH> \text{Cohen's d} = \frac{\text{Mean of difference scores}}{\text{Standard deviation of difference scores}} </MATH>

cohensD(data$post, data$post, method="paired")
[1] 0.4485912