O'Reilly logo

R Statistical Application Development by Example Beginner's Guide by Prabhanjan Narayanachar Tattar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – testing one-sample hypotheses

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.

  1. Load the library library(PASWR).
  2. 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)
  3. Specify the known variance of pH in pH_sigma <- 0.05.
  4. 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required