# Use a Dataset as a hypothetical test?

Posted 1 month ago
236 Views
|
|
0 Total Likes
|
 Consider the following code: A0 = {23.6, 64, 17.3, 36.9, 68.8, 107.6, 55.4, 22.1, 65.1, 47.9, 79, 38.9, 48.9, 52.6, 19.6, 43.7, 10.1, 24, 10.5, 26.8, 20, 70, 17.5, 25.9, 14.8, 20.9, 40, 16.9, 44.5, 59, 49.2, 41, 74.7, 23.5}; B0 = {12.9, 58, 0.1, 7.2, 46.9, 66.7, 7.6, 23.7, 53.2, 36.6, 67.8, 35.4, 41.4, 21, 2.4, 3.1, 4.4, 7, 8.4, 8.8, 15, 22.1, 23.5, 32, 10.9, 11.7, 32.4, 14.1, 8.1, 71.5, 29.5, 13.4, 51.5, 17.7}; rawdata = Dataset@Table[ AssociationThread[{"Baseline", "Followup"} -> {A0[[i]], B0[[i]]}], {i, 1, 34}]; A = rawdata[All, "Baseline"]; B = rawdata[All, "Followup"]; TTest[{A, B}] I get a message: TTest::rctndm1: The argument {Dataset [<<34>>],Dataset [<<34>>]} at position 1 should be a rectangular array of real numbers with length greater than the dimension of the array or two such arrays of equal dimensionality.How should this problem be handled?
 I was making a mistake and didn't convert the Dataset to Normal format. A0 = {23.6, 64, 17.3, 36.9, 68.8, 107.6, 55.4, 22.1, 65.1, 47.9, 79, 38.9, 48.9, 52.6, 19.6, 43.7, 10.1, 24, 10.5, 26.8, 20, 70, 17.5, 25.9, 14.8, 20.9, 40, 16.9, 44.5, 59, 49.2, 41, 74.7, 23.5}; B0 = {12.9, 58, 0.1, 7.2, 46.9, 66.7, 7.6, 23.7, 53.2, 36.6, 67.8, 35.4, 41.4, 21, 2.4, 3.1, 4.4, 7, 8.4, 8.8, 15, 22.1, 23.5, 32, 10.9, 11.7, 32.4, 14.1, 8.1, 71.5, 29.5, 13.4, 51.5, 17.7}; rawdata = Dataset@Table[ AssociationThread[{"Baseline", "Followup"} -> {A0[[i]], B0[[i]]}], {i, 1, 34}]; A = rawdata[All, "Baseline"] // Normal; B = rawdata[All, "Followup"] // Normal; TTest[{A, B}, 0, {"TestDataTable", "TestConclusion"}, VerifyTestAssumptions -> "EqualVariance"] it is great !