Testing the mean with the Z test: normalt

### 8.5.2 Testing the mean with the Z test: normalt

The normalt command will use the Z test to test the mean of data. You need to provide the command with the following arguments:

1. The sample data information can be given as a list [ns,ne] consisting of the number of successes ns and the number of trials ne, or a list [m,t] consisting of the mean m and the sample size t, or a data list of the sample.
2. The mean of the population to or a data list from a control sample.
3. The standard deviation of the population. If the data list from a control sample is provided, then this item is unnecessary.
4. The type of test; "!=","<" or ">".
5. The confidence level. This is optional; the default value is 0.05.

The normalt command will return the result of a Z test. It will return 0 if the test fails, 1 if the test succeeds, and it will display a summary of the test.

If you enter

normalt([10,30], 0.5, 0.02, ’!=’, 0.1)

you will get

       *** TEST RESULT 0 ***
       Summary Z-Test null hypothesis H0 mu1=mu2, alt. hyp. H1 mu1!=mu2.
       Test returns 0 if probability to observe data is less than 0.1
       (null hyp. mu1=mu2 rejected with less than alpha probability error)
       Test returns 1 otherwise (can not reject null hypothesis)
       Data mean mu1=10, population mean mu2=0.5
       alpha level 0.1, multiplier*stddev/sqrt(sample size)= 1.64485*0.02/5.47723
       0

If you enter

normalt([0.48,50],0.5,0.1,’<’)

you will get

       *** TEST RESULT 1 ***
       Summary Z-Test null hypothesis H0 mu1=mu2, alt. hyp. H1 mu1<mu2.
       Test returns 0 if probability to observe data is less than 0.05
       (null hyp. mu1=mu2 rejected with less than alpha probability error)
       Test returns 1 otherwise (can not reject null hypothesis)
       Data mean mu1=0.48, population mean mu2=0.5
       alpha level 0.05, multiplier*stddev/sqrt(sample size)= 1.64485*0.1/7.07107
       1