Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_twosampletests_mean.wasp
Title produced by softwarePaired and Unpaired Two Samples Tests about the Mean
Date of computationThu, 22 Dec 2011 13:38:34 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/22/t1324579135rs17te2l6pxrt5d.htm/, Retrieved Fri, 03 May 2024 06:40:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=159837, Retrieved Fri, 03 May 2024 06:40:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact94
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Paired and Unpaired Two Samples Tests about the Mean] [] [2011-12-22 18:38:34] [98013ab554c8e0dbe4733b402984d95f] [Current]
Feedback Forum

Post a new message
Dataseries X:
52	110
47	158
45	75
45	136
44	86
44	101
43	114
43	100
43	46
42	44
42	133
41	93
41	129
41	135
40	104
40	77
40	66
40	64
40	95
39	83
39	34
39	91
39	115
39	79
39	120
39	131
38	60
38	78
38	128
38	118
38	32
38	130
37	135
37	113
37	109
36	115
36	101
36	84
36	55
36	75
36	71
35	94
35	56
35	123
35	100
35	48
35	92
34	63
34	123
34	76
34	105
34	73
33	105
33	105
33	107
33	85
33	116
33	62
33	68
33	124
33	118
33	98
32	71
32	96
32	56
32	98
32	39
32	151
32	106
32	70
32	87
32	37
31	77
31	73
31	81
31	131
31	81
31	109
31	54
31	116
31	59
31	63
31	91
31	111
30	79
30	108
30	44
30	102
30	80
30	38
30	106
30	99
30	83
30	14
30	47
30	47
29	76
29	41
29	67
29	57
29	58
28	58
28	59
28	59
28	39
28	76
28	92
28	75
28	114
28	69
28	88
28	68
28	81
28	32
27	67
27	19
26	0
26	43
26	20
26	30
25	121
25	69
25	50
25	47
25	72
25	33
25	44
24	24
24	130
24	62
24	25
24	46
24	7
24	15
23	82
23	105
23	118
23	22
23	28
23	0
23	35
22	49
22	53
22	59
22	29
22	54
22	43
22	5
22	25
22	27
21	94
21	37
21	41
21	26
21	28
21	41
21	35
20	57
20	46
20	74
20	56
20	50
20	10
20	29
20	15
19	13
19	60
19	14
19	17
19	40
19	28
18	1
18	21
18	51
18	7
18	41
18	25
18	28
18	32
18	20
18	23
18	38
18	23
18	12
18	37
17	42
17	40
17	37
17	58
17	15
17	33
17	22
17	37
17	55
17	5
17	34
17	0
17	16
17	22
17	30
17	29
17	21
17	42
17	17
16	27
16	36
16	37
16	21
16	31
16	32
16	32
16	27
16	11
16	16
16	32
16	27
16	13
16	2
16	32
16	20
16	46
16	10
16	17
15	32
15	38
15	28
15	18
15	23
15	50
15	12
15	37
15	28
14	33
14	30
14	45
14	45
14	36
14	37
14	21
14	17
14	38
14	37
14	19
13	30
13	28
13	12
13	14
13	25
13	27
13	16
13	26
13	10
12	27
12	54
12	43
12	29
12	3
12	15
11	20
11	23
11	42
11	29
10	27
10	21
10	26
10	24
9	0
9	16
8	49
8	18
8	16
8	27
7	29
7	23
7	5
6	18
5	12
4	8
4	8
4	8
2	10
1	12
1	0
1	13
1	7
0	0
0	4
0	4
0	7




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=159837&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=159837&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=159837&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net







Two Sample t-test (paired)
Difference: Mean1 - Mean2-29.0103806228374
t-stat-22.3835576378486
df288
p-value5.51037447453084e-65
H0 value10
Alternativetwo.sided
CI Level0.95
CI[-32.4406487026594,-25.5801125430153]
F-test to compare two variances
F-stat0.0824479567570376
df288
p-value2.88655100649171e-81
H0 value1
Alternativetwo.sided
CI Level0.95
CI[0.0654132884918215,0.103918725539387]

\begin{tabular}{lllllllll}
\hline
Two Sample t-test (paired) \tabularnewline
Difference: Mean1 - Mean2 & -29.0103806228374 \tabularnewline
t-stat & -22.3835576378486 \tabularnewline
df & 288 \tabularnewline
p-value & 5.51037447453084e-65 \tabularnewline
H0 value & 10 \tabularnewline
Alternative & two.sided \tabularnewline
CI Level & 0.95 \tabularnewline
CI & [-32.4406487026594,-25.5801125430153] \tabularnewline
F-test to compare two variances \tabularnewline
F-stat & 0.0824479567570376 \tabularnewline
df & 288 \tabularnewline
p-value & 2.88655100649171e-81 \tabularnewline
H0 value & 1 \tabularnewline
Alternative & two.sided \tabularnewline
CI Level & 0.95 \tabularnewline
CI & [0.0654132884918215,0.103918725539387] \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=159837&T=1

[TABLE]
[ROW][C]Two Sample t-test (paired)[/C][/ROW]
[ROW][C]Difference: Mean1 - Mean2[/C][C]-29.0103806228374[/C][/ROW]
[ROW][C]t-stat[/C][C]-22.3835576378486[/C][/ROW]
[ROW][C]df[/C][C]288[/C][/ROW]
[ROW][C]p-value[/C][C]5.51037447453084e-65[/C][/ROW]
[ROW][C]H0 value[/C][C]10[/C][/ROW]
[ROW][C]Alternative[/C][C]two.sided[/C][/ROW]
[ROW][C]CI Level[/C][C]0.95[/C][/ROW]
[ROW][C]CI[/C][C][-32.4406487026594,-25.5801125430153][/C][/ROW]
[ROW][C]F-test to compare two variances[/C][/ROW]
[ROW][C]F-stat[/C][C]0.0824479567570376[/C][/ROW]
[ROW][C]df[/C][C]288[/C][/ROW]
[ROW][C]p-value[/C][C]2.88655100649171e-81[/C][/ROW]
[ROW][C]H0 value[/C][C]1[/C][/ROW]
[ROW][C]Alternative[/C][C]two.sided[/C][/ROW]
[ROW][C]CI Level[/C][C]0.95[/C][/ROW]
[ROW][C]CI[/C][C][0.0654132884918215,0.103918725539387][/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=159837&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=159837&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Two Sample t-test (paired)
Difference: Mean1 - Mean2-29.0103806228374
t-stat-22.3835576378486
df288
p-value5.51037447453084e-65
H0 value10
Alternativetwo.sided
CI Level0.95
CI[-32.4406487026594,-25.5801125430153]
F-test to compare two variances
F-stat0.0824479567570376
df288
p-value2.88655100649171e-81
H0 value1
Alternativetwo.sided
CI Level0.95
CI[0.0654132884918215,0.103918725539387]







Welch Two Sample t-test (paired)
Difference: Mean1 - Mean2-29.0103806228374
t-stat-22.3835576378486
df288
p-value5.51037447453084e-65
H0 value10
Alternativetwo.sided
CI Level0.95
CI[-32.4406487026594,-25.5801125430153]

\begin{tabular}{lllllllll}
\hline
Welch Two Sample t-test (paired) \tabularnewline
Difference: Mean1 - Mean2 & -29.0103806228374 \tabularnewline
t-stat & -22.3835576378486 \tabularnewline
df & 288 \tabularnewline
p-value & 5.51037447453084e-65 \tabularnewline
H0 value & 10 \tabularnewline
Alternative & two.sided \tabularnewline
CI Level & 0.95 \tabularnewline
CI & [-32.4406487026594,-25.5801125430153] \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=159837&T=2

[TABLE]
[ROW][C]Welch Two Sample t-test (paired)[/C][/ROW]
[ROW][C]Difference: Mean1 - Mean2[/C][C]-29.0103806228374[/C][/ROW]
[ROW][C]t-stat[/C][C]-22.3835576378486[/C][/ROW]
[ROW][C]df[/C][C]288[/C][/ROW]
[ROW][C]p-value[/C][C]5.51037447453084e-65[/C][/ROW]
[ROW][C]H0 value[/C][C]10[/C][/ROW]
[ROW][C]Alternative[/C][C]two.sided[/C][/ROW]
[ROW][C]CI Level[/C][C]0.95[/C][/ROW]
[ROW][C]CI[/C][C][-32.4406487026594,-25.5801125430153][/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=159837&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=159837&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Welch Two Sample t-test (paired)
Difference: Mean1 - Mean2-29.0103806228374
t-stat-22.3835576378486
df288
p-value5.51037447453084e-65
H0 value10
Alternativetwo.sided
CI Level0.95
CI[-32.4406487026594,-25.5801125430153]







Wicoxon rank sum test with continuity correction (paired)
W231.5
p-value6.16982495570295e-48
H0 value10
Alternativetwo.sided
Kolmogorov-Smirnov Test to compare Distributions of two Samples
KS Statistic0.463667820069204
p-value0
Kolmogorov-Smirnov Test to compare Distributional Shape of two Samples
KS Statistic0.401384083044983
p-value0

\begin{tabular}{lllllllll}
\hline
Wicoxon rank sum test with continuity correction (paired) \tabularnewline
W & 231.5 \tabularnewline
p-value & 6.16982495570295e-48 \tabularnewline
H0 value & 10 \tabularnewline
Alternative & two.sided \tabularnewline
Kolmogorov-Smirnov Test to compare Distributions of two Samples \tabularnewline
KS Statistic & 0.463667820069204 \tabularnewline
p-value & 0 \tabularnewline
Kolmogorov-Smirnov Test to compare Distributional Shape of two Samples \tabularnewline
KS Statistic & 0.401384083044983 \tabularnewline
p-value & 0 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=159837&T=3

[TABLE]
[ROW][C]Wicoxon rank sum test with continuity correction (paired)[/C][/ROW]
[ROW][C]W[/C][C]231.5[/C][/ROW]
[ROW][C]p-value[/C][C]6.16982495570295e-48[/C][/ROW]
[ROW][C]H0 value[/C][C]10[/C][/ROW]
[ROW][C]Alternative[/C][C]two.sided[/C][/ROW]
[ROW][C]Kolmogorov-Smirnov Test to compare Distributions of two Samples[/C][/ROW]
[ROW][C]KS Statistic[/C][C]0.463667820069204[/C][/ROW]
[ROW][C]p-value[/C][C]0[/C][/ROW]
[ROW][C]Kolmogorov-Smirnov Test to compare Distributional Shape of two Samples[/C][/ROW]
[ROW][C]KS Statistic[/C][C]0.401384083044983[/C][/ROW]
[ROW][C]p-value[/C][C]0[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=159837&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=159837&T=3

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Wicoxon rank sum test with continuity correction (paired)
W231.5
p-value6.16982495570295e-48
H0 value10
Alternativetwo.sided
Kolmogorov-Smirnov Test to compare Distributions of two Samples
KS Statistic0.463667820069204
p-value0
Kolmogorov-Smirnov Test to compare Distributional Shape of two Samples
KS Statistic0.401384083044983
p-value0



Parameters (Session):
par1 = 1 ; par2 = 2 ; par3 = 0.95 ; par4 = two.sided ; par5 = paired ; par6 = 10 ;
Parameters (R input):
par1 = 1 ; par2 = 2 ; par3 = 0.95 ; par4 = two.sided ; par5 = paired ; par6 = 10 ;
R code (references can be found in the software module):
par1 <- as.numeric(par1) #column number of first sample
par2 <- as.numeric(par2) #column number of second sample
par3 <- as.numeric(par3) #confidence (= 1 - alpha)
if (par5 == 'unpaired') paired <- FALSE else paired <- TRUE
par6 <- as.numeric(par6) #H0
z <- t(y)
if (par1 == par2) stop('Please, select two different column numbers')
if (par1 < 1) stop('Please, select a column number greater than zero for the first sample')
if (par2 < 1) stop('Please, select a column number greater than zero for the second sample')
if (par1 > length(z[1,])) stop('The column number for the first sample should be smaller')
if (par2 > length(z[1,])) stop('The column number for the second sample should be smaller')
if (par3 <= 0) stop('The confidence level should be larger than zero')
if (par3 >= 1) stop('The confidence level should be smaller than zero')
(r.t <- t.test(z[,par1],z[,par2],var.equal=TRUE,alternative=par4,paired=paired,mu=par6,conf.level=par3))
(v.t <- var.test(z[,par1],z[,par2],conf.level=par3))
(r.w <- t.test(z[,par1],z[,par2],var.equal=FALSE,alternative=par4,paired=paired,mu=par6,conf.level=par3))
(w.t <- wilcox.test(z[,par1],z[,par2],alternative=par4,paired=paired,mu=par6,conf.level=par3))
(ks.t <- ks.test(z[,par1],z[,par2],alternative=par4))
m1 <- mean(z[,par1],na.rm=T)
m2 <- mean(z[,par2],na.rm=T)
mdiff <- m1 - m2
newsam1 <- z[!is.na(z[,par1]),par1]
newsam2 <- z[,par2]+mdiff
newsam2 <- newsam2[!is.na(newsam2)]
(ks1.t <- ks.test(newsam1,newsam2,alternative=par4))
mydf <- data.frame(cbind(z[,par1],z[,par2]))
colnames(mydf) <- c('Variable 1','Variable 2')
bitmap(file='test1.png')
boxplot(mydf, notch=TRUE, ylab='value',main=main)
dev.off()
bitmap(file='test2.png')
qqnorm(z[,par1],main='Normal QQplot - Variable 1')
qqline(z[,par1])
dev.off()
bitmap(file='test3.png')
qqnorm(z[,par2],main='Normal QQplot - Variable 2')
qqline(z[,par2])
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,paste('Two Sample t-test (',par5,')',sep=''),2,TRUE)
a<-table.row.end(a)
if(!paired){
a<-table.row.start(a)
a<-table.element(a,'Mean of Sample 1',header=TRUE)
a<-table.element(a,r.t$estimate[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Mean of Sample 2',header=TRUE)
a<-table.element(a,r.t$estimate[[2]])
a<-table.row.end(a)
} else {
a<-table.row.start(a)
a<-table.element(a,'Difference: Mean1 - Mean2',header=TRUE)
a<-table.element(a,r.t$estimate)
a<-table.row.end(a)
}
a<-table.row.start(a)
a<-table.element(a,'t-stat',header=TRUE)
a<-table.element(a,r.t$statistic[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'df',header=TRUE)
a<-table.element(a,r.t$parameter[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-value',header=TRUE)
a<-table.element(a,r.t$p.value)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'H0 value',header=TRUE)
a<-table.element(a,r.t$null.value[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Alternative',header=TRUE)
a<-table.element(a,r.t$alternative)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'CI Level',header=TRUE)
a<-table.element(a,attr(r.t$conf.int,'conf.level'))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'CI',header=TRUE)
a<-table.element(a,paste('[',r.t$conf.int[1],',',r.t$conf.int[2],']',sep=''))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'F-test to compare two variances',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'F-stat',header=TRUE)
a<-table.element(a,v.t$statistic[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'df',header=TRUE)
a<-table.element(a,v.t$parameter[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-value',header=TRUE)
a<-table.element(a,v.t$p.value)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'H0 value',header=TRUE)
a<-table.element(a,v.t$null.value[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Alternative',header=TRUE)
a<-table.element(a,v.t$alternative)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'CI Level',header=TRUE)
a<-table.element(a,attr(v.t$conf.int,'conf.level'))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'CI',header=TRUE)
a<-table.element(a,paste('[',v.t$conf.int[1],',',v.t$conf.int[2],']',sep=''))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,paste('Welch Two Sample t-test (',par5,')',sep=''),2,TRUE)
a<-table.row.end(a)
if(!paired){
a<-table.row.start(a)
a<-table.element(a,'Mean of Sample 1',header=TRUE)
a<-table.element(a,r.w$estimate[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Mean of Sample 2',header=TRUE)
a<-table.element(a,r.w$estimate[[2]])
a<-table.row.end(a)
} else {
a<-table.row.start(a)
a<-table.element(a,'Difference: Mean1 - Mean2',header=TRUE)
a<-table.element(a,r.w$estimate)
a<-table.row.end(a)
}
a<-table.row.start(a)
a<-table.element(a,'t-stat',header=TRUE)
a<-table.element(a,r.w$statistic[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'df',header=TRUE)
a<-table.element(a,r.w$parameter[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-value',header=TRUE)
a<-table.element(a,r.w$p.value)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'H0 value',header=TRUE)
a<-table.element(a,r.w$null.value[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Alternative',header=TRUE)
a<-table.element(a,r.w$alternative)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'CI Level',header=TRUE)
a<-table.element(a,attr(r.w$conf.int,'conf.level'))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'CI',header=TRUE)
a<-table.element(a,paste('[',r.w$conf.int[1],',',r.w$conf.int[2],']',sep=''))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,paste('Wicoxon rank sum test with continuity correction (',par5,')',sep=''),2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'W',header=TRUE)
a<-table.element(a,w.t$statistic[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-value',header=TRUE)
a<-table.element(a,w.t$p.value)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'H0 value',header=TRUE)
a<-table.element(a,w.t$null.value[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Alternative',header=TRUE)
a<-table.element(a,w.t$alternative)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Kolmogorov-Smirnov Test to compare Distributions of two Samples',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'KS Statistic',header=TRUE)
a<-table.element(a,ks.t$statistic[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-value',header=TRUE)
a<-table.element(a,ks.t$p.value)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Kolmogorov-Smirnov Test to compare Distributional Shape of two Samples',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'KS Statistic',header=TRUE)
a<-table.element(a,ks1.t$statistic[[1]])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-value',header=TRUE)
a<-table.element(a,ks1.t$p.value)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable2.tab')