We will require R packages `PASWR`

and `PairedData`

here. The R functions such as `t.test`

, `z.test`

, and `var.test`

will be useful for testing one-sample hypotheses problems related to a random sample from normal distributions.

- Load the library
`library(PASWR)`

. - Enter the data for
`pH`

in R:pH_Data <-c(8.30,8.42,8.44,8.32,8.43,8.41,8.42,8.46,8.37,8.42)

- Specify the known variance of
`pH`

in`pH_sigma <- 0.05`

. - Use
`z.test`

from the`PASWR`

library to test the hypotheses described in the first example with:z.test(x=pH_Data,alternative="less",sigma.x=pH_sigma,mu=8.4)

The data is specified in the

`x`

option, the type of the hypotheses problem is specified by stating the form of the`alternative`

hypothesis, the known variance is ...

Start Free Trial

No credit card required