## `stats::meanTest` -- test an estimate of an expected mean

#### Introduction

`stats::meanTest``(data, m)` returns the probability that the expected mean of the data is larger than `m`.

#### Call(s)

`stats::meanTest([x1, x2, ..], m <, distribution>)`

#### Parameters

`x1, x2, ..` | - | the statistical data: arithmetical expressions.
`m` | - | the estimate for the expected mean of the data: an arithmetical expression.
`distribution` | - | either `stats::normal` or `stats::Tdist`. The default is the T-distribution `stats::Tdist`.

#### Returns

an arithmetical expression. `FAIL` is returned, if the variance of the data vanishes.

#### Related Functions

`stats::mean`, `stats::normal`, `stats::stdev`, `stats::Tdist`

#### Details

- `stats::meanTest` computes y = (X-m)*sqrt(n/v), where X = (x[1] + .. + x[n])/n is the mean of the data and v = ((x[n]-X)^2 + .. + (x[n]-X)^2)/(n-1) is the statistical variance.

  `stats::meanTest` returns `stats::Tdist`(y, n-1) or `stats::normal`(y, 0, 1), depending on the chosen distribution.

- If the data obey a normal distribution with expectation value mu, then the variable (X-mu)*sqrt(n/v) obeys a T-distribution with n-1 degrees of freedom. In this case the value returned by `stats::meanTest`(data, m) is the probability that mu >= m.

#### Example 1

10 experiments produced the values 1, -2, 3, -4, 5, -6, 7, -8, 9, 10. There is only a small probability that the expected mean value of the underlying distribution is larger than 5:

    >> data := [1, -2, 3, -4, 5, -6, 7, -8, 9, 10]:
       float(stats::meanTest(data, 5))

                                   0.05756660092

We test the hypothesis ``expected mean >= 5'' again, this time using the normal distribution:

    >> float(stats::meanTest(data, 5, stats::normal))

                                   0.04058346176

    >> delete data:

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000