You are on page 1of 2

One Sample t-test

1.)> x=c(12,12,32,43,32,12,32,43,54,12,13,42);

> t.test(x,alternative="greater",mu=0.3)

data: x

t = 6.2757, df = 11, p-value = 3.019e-05

alternative hypothesis: true mean is greater than 0.3

95 percent confidence interval:

20.25171 Inf

sample estimates:

mean of x

28.25

Two Sample t-test

2.)> ctrl=c(12,32,43,5,45,23,12,43,54)

> treat=c(12,43,54,32,12,3,43,34,23)

> t.test(ctrl,treat,alternative="less",var.=TRUE)

data: ctrl and treat

t = 0.17685, df = 16, p-value = 0.5691

alternative hypothesis: true difference in means is less than 0


95 percent confidence interval:

-Inf 15.70414

sample estimates:

mean of x mean of y

29.88889 28.44444

Paired t-test
3.)> x=c(1,2,3,4,5,6,7,8,9,7)

> reg=c(12,32,43,54,56,45,32,12,23,54)

> pre=c(1,2,3,4,2,5,7,6,7,9)

> t.test(pre,reg,alternative="greater",paired=TRUE)

data: pre and reg

t = -5.9788, df = 9, p-value = 0.9999

alternative hypothesis: true difference in means is greater than 0

95 percent confidence interval:

-41.41934 Inf

sample estimates:

mean of the differences

-31.7

You might also like