terminal SciMax Toolbox test_means_difference

SciMax Toolbox >> test_mean

test_mean

Maxima Function

Calling Sequence

test_mean (x)
test_mean(x,option_1,option_2,...)

Description

This is the mean t-test. Argument x is a list or a column matrix containing a one dimensional sample. It also performs an asymptotic test based on the Central Limit Theorem if option 'asymptotic is true.

Options:

The output of function test_mean is an inference_result Maxima object showing the following results:

  1. 'mean_estimate: the sample mean.

  2. 'conf_level: confidence level selected by the user.

  3. 'conf_interval: confidence interval for the population mean.

  4. 'method: inference procedure.

  5. 'hypotheses: null and alternative hypotheses to be tested.

  6. 'statistic: value of the sample statistic used for testing the null hypothesis.

  7. 'distribution: distribution of the sample statistic, together with its parameter(s).

  8. 'p_value: p-value of the test.

Examples:

Performs an exact t-test with unknown variance. The null hypothesis is H_0: mean=50 against the one sided alternative H_1: mean<50; according to the results, the p-value is too great, there are no evidence for rejecting H_0.

(%i1) load("stats")$
(%i2) data: [78,64,35,45,45,75,43,74,42,42]$
(%i3) test_mean(data,'conflevel=0.9,'alternative='less,'mean=50);
          |                 MEAN TEST
          |
          |            mean_estimate = 54.3
          |
          |              conf_level = 0.9
          |
          | conf_interval = [minf, 61.51314273502712]
          |
(%o3)     |  method = Exact t-test. Unknown variance.
          |
          | hypotheses = H0: mean = 50 , H1: mean < 50
          |
          |       statistic = .8244705235071678
          |
          |       distribution = [student_t, 9]
          |
          |        p_value = .7845100411786889

This time Maxima performs an asymptotic test, based on the Central Limit Theorem. The null hypothesis is H_0: equal(mean, 50) against the two sided alternative H_1: not equal(mean, 50); according to the results, the p-value is very small, H_0 should be rejected in favor of the alternative H_1. Note that, as indicated by the Method component, this procedure should be applied to large samples.

(%i1) load("stats")$
(%i2) test_mean([36,118,52,87,35,256,56,178,57,57,89,34,25,98,35,
              98,41,45,198,54,79,63,35,45,44,75,42,75,45,45,
              45,51,123,54,151],
              'asymptotic=true,'mean=50);
          |                       MEAN TEST
          |
          |           mean_estimate = 74.88571428571429
          |
          |                   conf_level = 0.95
          |
          | conf_interval = [57.72848600856194, 92.04294256286663]
          |
(%o2)     |    method = Large sample z-test. Unknown variance.
          |
          |       hypotheses = H0: mean = 50 , H1: mean # 50
          |
          |             statistic = 2.842831192874313
          |
          |             distribution = [normal, 0, 1]
          |
          |             p_value = .004471474652002261
terminal SciMax Toolbox test_means_difference