getcis: Get Confidence Intervals

Description Usage Arguments Details Value References Examples

Description

Calculates t confidence intervals for m samples each of size n contained in the R matrix mat which is a m x n matrix. Each row is a sample of size n. The function is discussed in Exercise 4.2.11 on page 245 of HMC (2018).

Usage

1
getcis(mat, cc = 0.9)

Arguments

mat

an m x n matrix

cc

confidence coefficient, or the confidence level of the intervals

Details

This function is used to calculate t confidence intervals for m samples each of size n contained in the R matrix mat, which is a m x n matrix. Each row is a sample of size n.

Value

(1 - alpha)100% confidence intervals in a m x 2 matrix

References

Hogg, R., McKean, J., Craig, A. (2018) Introduction to Mathematical Statistics, 8th Ed. Boston: Pearson.

Examples

1
2
3
4
5
n <- 10
m <- 50
mat <- matrix(rnorm(m * n), ncol = n)
getcis(mat = mat, cc = 0.95)
getcis(mat = mat, cc = 0.90)

joemckean/mathstat documentation built on May 30, 2019, 2:01 p.m.