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 computationMon, 15 Dec 2014 09:13:34 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2014/Dec/15/t1418634836ob6kotenotgfm6h.htm/, Retrieved Thu, 16 May 2024 03:37:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=267967, Retrieved Thu, 16 May 2024 03:37:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact92
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] [Paper statistiek ] [2014-12-15 09:13:34] [e4bec374a19c70fe4499af2adad38eb7] [Current]
Feedback Forum

Post a new message
Dataseries X:
18 68
31 39
39 32
46 62
31 33
67 52
35 62
52 77
77 76
37 41
32 48
36 63
38 30
69 78
21 19
26 31
54 66
36 35
42 42
23 45
34 21
112 25
35 44
47 69
47 54
37 74
109 80
24 42
20 61
22 41
23 46
32 39
30 34
92 51
43 42
55 31
16 39
49 20
71 49
43 53
29 31
56 39
46 54
19 49
23 34
59 46
30 55
61 42
7 50
38 13
32 37
16 25
19 30
22 28
48 45
23 35
26 28
33 41
9 6
24 45
34 73
48 17
18 40
43 64
33 37
28 25
71 65
26 100
67 28
34 35
80 56
29 29
16 43
59 59
32 50
43 59
38 27
29 61
36 28
32 51
35 35
21 29
29 48
12 25
37 44
37 64
47 32
51 20
32 28
21 34
13 31
14 26
-2 58
20 23
24 21
11 21
23 33
24 16
14 20
52 37
15 35
23 33
19 27
35 41
24 40
39 35
29 28
13 32
8 22
18 44
24 27
19 17
23 12
16 45
33 37
32 37
37 108
14 10
52 68
75 72
72 143
15 9
29 55
13 17
40 37
19 27
24 37
121 58
93 66
36 21
23 19
85 78
41 35
46 48
18 27
35 43
17 30
4 25
28 69
44 72
10 23
38 13
57 61
23 43
36 51
22 67
40 36
31 44
11 45
38 34
24 36
37 72
37 39
22 43
15 25
2 56
43 80
31 40
29 73
45 34
25 72
4 42
31 61
-4 23
66 74
61 16
32 66
31 9
39 41
19 57
31 48
36 51
42 53
21 29
21 29
25 55
32 54
26 43
28 51
32 20
41 79
29 39
33 61
17 55
13 30
32 55
30 22
34 37
59 2
13 38
23 27
10 56
5 25
31 39
19 33
32 43
30 57
25 43
48 23
35 44
67 54
15 28
22 36
18 39
33 16
46 23
24 40
14 24
12 78
38 57
12 37
28 27
41 61
12 27
31 69
33 34
34 44
21 34
20 39
44 51
52 34
7 31
29 13
11 12
26 51
24 24
7 19
60 30
13 81
20 42
52 22
28 85
25 27
39 25
9 22
19 19
13 14
60 45
19 45
34 28
14 51
17 41
45 31
66 74
48 19
29 51
-2 73
51 24
2 61
24 23
40 14
20 54
19 51
16 62
20 36
40 59
27 24
25 26
49 54
39 39
61 16
19 36
67 31
45 31
30 42
8 39
19 25
52 31
22 38
17 31
33 17
34 22
22 55
30 62
25 51
38 30
26 49
13 16




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ jenkins.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 & 2 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=267967&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=267967&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=267967&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 time2 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net







Two Sample t-test (paired)
Difference: Mean1 - Mean2-8.90287769784173
t-stat-6.50913726401011
df277
p-value3.53356490168227e-10
H0 value0
Alternativetwo.sided
CI Level0.95
CI[-11.5953841142349,-6.21037128144855]
F-test to compare two variances
F-stat0.977191755603343
df277
p-value0.847879205702065
H0 value1
Alternativetwo.sided
CI Level0.95
CI[0.771758608607125,1.23730881206827]

\begin{tabular}{lllllllll}
\hline
Two Sample t-test (paired) \tabularnewline
Difference: Mean1 - Mean2 & -8.90287769784173 \tabularnewline
t-stat & -6.50913726401011 \tabularnewline
df & 277 \tabularnewline
p-value & 3.53356490168227e-10 \tabularnewline
H0 value & 0 \tabularnewline
Alternative & two.sided \tabularnewline
CI Level & 0.95 \tabularnewline
CI & [-11.5953841142349,-6.21037128144855] \tabularnewline
F-test to compare two variances \tabularnewline
F-stat & 0.977191755603343 \tabularnewline
df & 277 \tabularnewline
p-value & 0.847879205702065 \tabularnewline
H0 value & 1 \tabularnewline
Alternative & two.sided \tabularnewline
CI Level & 0.95 \tabularnewline
CI & [0.771758608607125,1.23730881206827] \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=267967&T=1

[TABLE]
[ROW][C]Two Sample t-test (paired)[/C][/ROW]
[ROW][C]Difference: Mean1 - Mean2[/C][C]-8.90287769784173[/C][/ROW]
[ROW][C]t-stat[/C][C]-6.50913726401011[/C][/ROW]
[ROW][C]df[/C][C]277[/C][/ROW]
[ROW][C]p-value[/C][C]3.53356490168227e-10[/C][/ROW]
[ROW][C]H0 value[/C][C]0[/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][-11.5953841142349,-6.21037128144855][/C][/ROW]
[ROW][C]F-test to compare two variances[/C][/ROW]
[ROW][C]F-stat[/C][C]0.977191755603343[/C][/ROW]
[ROW][C]df[/C][C]277[/C][/ROW]
[ROW][C]p-value[/C][C]0.847879205702065[/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.771758608607125,1.23730881206827][/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=267967&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=267967&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-8.90287769784173
t-stat-6.50913726401011
df277
p-value3.53356490168227e-10
H0 value0
Alternativetwo.sided
CI Level0.95
CI[-11.5953841142349,-6.21037128144855]
F-test to compare two variances
F-stat0.977191755603343
df277
p-value0.847879205702065
H0 value1
Alternativetwo.sided
CI Level0.95
CI[0.771758608607125,1.23730881206827]







Welch Two Sample t-test (paired)
Difference: Mean1 - Mean2-8.90287769784173
t-stat-6.50913726401011
df277
p-value3.53356490168227e-10
H0 value0
Alternativetwo.sided
CI Level0.95
CI[-11.5953841142349,-6.21037128144855]

\begin{tabular}{lllllllll}
\hline
Welch Two Sample t-test (paired) \tabularnewline
Difference: Mean1 - Mean2 & -8.90287769784173 \tabularnewline
t-stat & -6.50913726401011 \tabularnewline
df & 277 \tabularnewline
p-value & 3.53356490168227e-10 \tabularnewline
H0 value & 0 \tabularnewline
Alternative & two.sided \tabularnewline
CI Level & 0.95 \tabularnewline
CI & [-11.5953841142349,-6.21037128144855] \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=267967&T=2

[TABLE]
[ROW][C]Welch Two Sample t-test (paired)[/C][/ROW]
[ROW][C]Difference: Mean1 - Mean2[/C][C]-8.90287769784173[/C][/ROW]
[ROW][C]t-stat[/C][C]-6.50913726401011[/C][/ROW]
[ROW][C]df[/C][C]277[/C][/ROW]
[ROW][C]p-value[/C][C]3.53356490168227e-10[/C][/ROW]
[ROW][C]H0 value[/C][C]0[/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][-11.5953841142349,-6.21037128144855][/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=267967&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=267967&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-8.90287769784173
t-stat-6.50913726401011
df277
p-value3.53356490168227e-10
H0 value0
Alternativetwo.sided
CI Level0.95
CI[-11.5953841142349,-6.21037128144855]







Wicoxon rank sum test with continuity correction (paired)
W9813.5
p-value2.53953606276196e-11
H0 value0
Alternativetwo.sided
Kolmogorov-Smirnov Test to compare Distributions of two Samples
KS Statistic0.241007194244604
p-value1.94208243486926e-07
Kolmogorov-Smirnov Test to compare Distributional Shape of two Samples
KS Statistic0.079136690647482
p-value0.348804923407553

\begin{tabular}{lllllllll}
\hline
Wicoxon rank sum test with continuity correction (paired) \tabularnewline
W & 9813.5 \tabularnewline
p-value & 2.53953606276196e-11 \tabularnewline
H0 value & 0 \tabularnewline
Alternative & two.sided \tabularnewline
Kolmogorov-Smirnov Test to compare Distributions of two Samples \tabularnewline
KS Statistic & 0.241007194244604 \tabularnewline
p-value & 1.94208243486926e-07 \tabularnewline
Kolmogorov-Smirnov Test to compare Distributional Shape of two Samples \tabularnewline
KS Statistic & 0.079136690647482 \tabularnewline
p-value & 0.348804923407553 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=267967&T=3

[TABLE]
[ROW][C]Wicoxon rank sum test with continuity correction (paired)[/C][/ROW]
[ROW][C]W[/C][C]9813.5[/C][/ROW]
[ROW][C]p-value[/C][C]2.53953606276196e-11[/C][/ROW]
[ROW][C]H0 value[/C][C]0[/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.241007194244604[/C][/ROW]
[ROW][C]p-value[/C][C]1.94208243486926e-07[/C][/ROW]
[ROW][C]Kolmogorov-Smirnov Test to compare Distributional Shape of two Samples[/C][/ROW]
[ROW][C]KS Statistic[/C][C]0.079136690647482[/C][/ROW]
[ROW][C]p-value[/C][C]0.348804923407553[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=267967&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=267967&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)
W9813.5
p-value2.53953606276196e-11
H0 value0
Alternativetwo.sided
Kolmogorov-Smirnov Test to compare Distributions of two Samples
KS Statistic0.241007194244604
p-value1.94208243486926e-07
Kolmogorov-Smirnov Test to compare Distributional Shape of two Samples
KS Statistic0.079136690647482
p-value0.348804923407553



Parameters (Session):
par1 = 1 ; par2 = 2 ; par3 = 0.95 ; par4 = two.sided ; par5 = paired ; par6 = 0.0 ;
Parameters (R input):
par1 = 1 ; par2 = 2 ; par3 = 0.95 ; par4 = two.sided ; par5 = paired ; par6 = 0.0 ;
R code (references can be found in the software module):
par6 <- '0.0'
par5 <- 'paired'
par4 <- 'two.sided'
par3 <- '0.95'
par2 <- ''
par1 <- ''
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')