Learn R Programming

fifer (version 1.1)

z.test: Perform a z test

Description

This function does the standard z-test, which tests a particular dataset against a specified value

Usage

z.test(data, mean = 0, sd = 1, direction = "both")

Arguments

data
a vector of values which will be used to compute a mean
mean
the value the z-test is tested against
sd
the standard deviation of the null distribution
direction
either "positive", "negative", or "both" (for a two-tailed test)

Value

a list containing the computed mean, the z-statistic, and the p-value

Details

Perform a z-test in R z.test will take a vector and determine whether it differs from a chosen value specified by mean

Examples

Run this code
k = rnorm(15, 10, 3)
z.test(k, mean=5, sd=3)

Run the code above in your browser using DataLab