Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compare the means of two observational samples using the Welch test
| ResourceFunction["WelchTest"][data1,data2] tests whether the two lists of observations data1 and data2 have equal means. | 
| "PValue" | p-values | 
| "TestStatistic" | value of the t-statistic | 
| “DegreesOfFreedom" | approximate (non-integer) degrees of freedom | 
| AlternativeHypothesis | "Unequal" | the inequality for the alternative hypothesis | 
Two samples with unequal length:
| In[1]:= |  | 
Perform the two-sided Welch test on the two samples:
| In[2]:= | ![ResourceFunction["WelchTest"][x1, x2]](https://www.wolframcloud.com/obj/resourcesystem/images/cb9/cb9d8c7c-4051-4dc4-901c-7b398cf2b485/2316c40dac2757c3.png) | 
| Out[2]= |  | 
Two samples with unequal length:
| In[3]:= |  | 
Test H0:μ1-μ2≥0 versus Ha:μ1-μ2<0:
| In[4]:= | ![ResourceFunction["WelchTest"][x1, x2, AlternativeHypothesis -> "Less"]](https://www.wolframcloud.com/obj/resourcesystem/images/cb9/cb9d8c7c-4051-4dc4-901c-7b398cf2b485/7ecd22a23449fc9f.png) | 
| Out[4]= |  | 
Test H0:μ1-μ2<0 versus Ha:μ1-μ2≥0:
| In[5]:= | ![ResourceFunction["WelchTest"][x1, x2, AlternativeHypothesis -> "Greater"]](https://www.wolframcloud.com/obj/resourcesystem/images/cb9/cb9d8c7c-4051-4dc4-901c-7b398cf2b485/21a5eddfcb7db0ed.png) | 
| Out[5]= |  | 
This work is licensed under a Creative Commons Attribution 4.0 International License