0% found this document useful (0 votes)
16 views

One Sample T-Test

This document contains examples of three different t-tests: 1) A one sample t-test to test if the mean of a sample is greater than 0.3. 2) A two sample t-test to test if the mean difference between two independent samples is less than 0. 3) A paired t-test to test if the mean difference between two paired samples is greater than 0.

Uploaded by

Sandeep More
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

One Sample T-Test

This document contains examples of three different t-tests: 1) A one sample t-test to test if the mean of a sample is greater than 0.3. 2) A two sample t-test to test if the mean difference between two independent samples is less than 0. 3) A paired t-test to test if the mean difference between two paired samples is greater than 0.

Uploaded by

Sandeep More
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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