0
+ − 1 <tool id="t_test_two_samples" name="T Test for Two Samples" version="1.0.0">
+ − 2 <description></description>
+ − 3
+ − 4 <command interpreter="perl">
+ − 5 t_test_two_samples.pl $inputFile1 $inputFile2 $inputTestSidedness3 $inputStandardDeviationEquality4 $outputFile1
+ − 6 </command>
+ − 7
+ − 8 <inputs>
+ − 9 <param format="tabular" name="inputFile1" type="data" label="Select the first sample tabular file"/>
+ − 10 <param format="tabular" name="inputFile2" type="data" label="Select the second sample tabular file"/>
+ − 11
+ − 12 <param name="inputTestSidedness3" type="select" label="Choose the test sidedness:">
+ − 13 <option value="two-sided">Two-sided</option>
+ − 14 <option value="one-sided:_m1_less_than_m2">One-sided: m1 less than m2</option>
+ − 15 <option value="one-sided:_m1_greater_than_m2">One-sided: m1 greater than m2</option>
+ − 16 </param>
+ − 17
+ − 18 <param name="inputStandardDeviationEquality4" type="select" label="Choose the standard deviation equality status of the two populations:">
+ − 19 <option value="equal">Equal</option>
+ − 20 <option value="unequal">Unequal</option>
+ − 21 </param>
+ − 22 </inputs>
+ − 23
+ − 24 <outputs>
+ − 25 <data format="text" name="outputFile1"/>
+ − 26 </outputs>
+ − 27
+ − 28 <tests>
+ − 29 <test>
+ − 30 <param name="inputFile1" value="sample1.tabular" ftype="tabular" />
+ − 31 <param name="inputFile2" value="sample2.tabular" ftype="tabular" />
+ − 32 <param name="inputTestSidedness3" value="Two-sided" />
+ − 33 <param name="inputStandardDeviationEquality4" value="Equal" />
+ − 34 <output name="outputFile1" file="t_test_result1.text" />
+ − 35 </test>
+ − 36
+ − 37 <test>
+ − 38 <param name="inputFile1" value="sample1.tabular" ftype="tabular" />
+ − 39 <param name="inputFile2" value="sample2.tabular" ftype="tabular" />
+ − 40 <param name="inputTestSidedness3" value="Two-sided" />
+ − 41 <param name="inputStandardDeviationEquality4" value="Unequal" />
+ − 42 <output name="outputFile1" file="t_test_result2.text" />
+ − 43 </test>
+ − 44
+ − 45 <test>
+ − 46 <param name="inputFile1" value="sample1.tabular" ftype="tabular" />
+ − 47 <param name="inputFile2" value="sample2.tabular" ftype="tabular" />
+ − 48 <param name="inputTestSidedness3" value="One-sided: m1 less than m2" />
+ − 49 <param name="inputStandardDeviationEquality4" value="Equal" />
+ − 50 <output name="outputFile1" file="t_test_result3.text" />
+ − 51 </test>
+ − 52
+ − 53 <test>
+ − 54 <param name="inputFile1" value="sample1.tabular" ftype="tabular" />
+ − 55 <param name="inputFile2" value="sample2.tabular" ftype="tabular" />
+ − 56 <param name="inputTestSidedness3" value="One-sided: m1 less than m2" />
+ − 57 <param name="inputStandardDeviationEquality4" value="Unequal" />
+ − 58 <output name="outputFile1" file="t_test_result4.text" />
+ − 59 </test>
+ − 60
+ − 61 <test>
+ − 62 <param name="inputFile1" value="sample1.tabular" ftype="tabular" />
+ − 63 <param name="inputFile2" value="sample2.tabular" ftype="tabular"/>
+ − 64 <param name="inputTestSidedness3" value="One-sided: m1 greater than m2" />
+ − 65 <param name="inputStandardDeviationEquality4" value="Equal" />
+ − 66 <output name="outputFile1" file="t_test_result5.text" />
+ − 67 </test>
+ − 68
+ − 69 <test>
+ − 70 <param name="inputFile1" value="sample1.tabular" ftype="tabular" />
+ − 71 <param name="inputFile2" value="sample2.tabular" ftype="tabular" />
+ − 72 <param name="inputTestSidedness3" value="One-sided: m1 greater than m2" />
+ − 73 <param name="inputStandardDeviationEquality4" value="Unequal" />
+ − 74 <output name="outputFile1" file="t_test_result6.text" />
+ − 75 </test>
+ − 76 </tests>
+ − 77
+ − 78
+ − 79 <help>
+ − 80
+ − 81 .. class:: infomark
+ − 82
+ − 83 **What it does**
+ − 84
+ − 85 This program implements the non-pooled t-test for two samples where the alternative hypothesis is two-sided or one-sided. The program takes four inputs:
+ − 86
+ − 87 - The first input file is a TABULAR format file representing the first sample and consisting of one column only.
+ − 88 - The second input file is a TABULAR format file representing the first sample and consisting of one column only.
+ − 89 - The third input is the sidedness of the t-test: either two-sided or, one-sided with m1 less than m2 or, one-sided with m1 greater than m2.
+ − 90 - The fourth input is the equality status of the standard deviations of both populations.
+ − 91 - The output file is a TXT file representing the result of the two-sample t-test.
+ − 92
+ − 93
+ − 94 **Example**
+ − 95
+ − 96 Let us have the first input file representing the first sample as follows::
+ − 97
+ − 98 5
+ − 99 4
+ − 100 8
+ − 101 6
+ − 102 7
+ − 103 2
+ − 104 1
+ − 105 1
+ − 106 0
+ − 107 6
+ − 108 4
+ − 109 5
+ − 110 7
+ − 111 5
+ − 112 3
+ − 113 2
+ − 114 5
+ − 115 8
+ − 116 7
+ − 117 6
+ − 118 4
+ − 119
+ − 120 And the second input file representing the second sample as follows::
+ − 121
+ − 122 2
+ − 123 3
+ − 124 5
+ − 125 1
+ − 126 2
+ − 127 7
+ − 128 5
+ − 129 4
+ − 130 3
+ − 131 2
+ − 132 7
+ − 133 6
+ − 134 0
+ − 135 8
+ − 136 4
+ − 137 6
+ − 138 9
+ − 139 2
+ − 140 4
+ − 141 5
+ − 142 6
+ − 143
+ − 144 Runnig the program and choosing "Two-sided" and "Equal" as parameters will give the following output::
+ − 145
+ − 146 Two Sample t-test
+ − 147
+ − 148 data: sample1 and sample2
+ − 149 t = -0.3247, df = 40, p-value = 0.7471
+ − 150 alternative hypothesis: true difference in means is not equal to 0
+ − 151 95 percent confidence interval:
+ − 152 -1.720030 1.243839
+ − 153 sample estimates:
+ − 154 mean of x mean of y
+ − 155 4.333333 4.571429
+ − 156
+ − 157
+ − 158 </help>
+ − 159
+ − 160 </tool>