z.test: Z test for 1 and 2 samples

Description Usage Arguments Value Examples

Description

Performs z test for samples and sample proportions on vector values

Usage

1
2
z.test(x, y = NULL, test_val = 0, tails = 2, conf.level = 0.95,
  prob = 0, ...)

Arguments

x

FLVector

y

FLVector

test_val

The mean value for which the z test has to be performed. The default value is 0.

prob

The values is 1 if the sample set is for proportions. Otherwise, by default it's 0.

Value

A list with class "htest" outputting the corresponding Z Stat and P Values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
flx<-as.FLVector(rnorm(100))
fly<-as.FLVector(rnorm(100))
z.test(flx)
    ## Two- sided one sample z-test.
    ## mean for 'x' is zero. The alternative hypothesis states 
    ## that it is either greater or less than zero.

z.test(flx,fly,2)
    ## Two- sided two sample z-test.
    ## The null hypothesis is that the population mean for 'x'
    ## less that for 'y' is 2. 
    ## The alternative hypothesis is that this difference is not 2.

## z- test for population proportion.
fla<-as.FLVector(sample(c(0,1),replace=T,size=100))
flb<-as.FLVector(sample(c(0,1),replace=T,size=100))
 ##test_val= 0.4 implies that null hypothesis is
 ##population proportion is 0.4
z.test(fla,prob=1, test_val= 0.4)
z.test(fla,flb,prob=1)

Fuzzy-Logix/AdapteR documentation built on May 6, 2019, 5:07 p.m.