n_t1samp_interval: Sample Size for One Sample T Confidence Intervals

Description Usage Arguments Details Value Author(s)

View source: R/n_t1samp_interval.R

Description

The $t$-based confidence interval is commonly used in estimating population mean using sample data. It is based on Student's $t$ distribution, an adaptation of the standard normal distribution. n_t1samp_interval provides tools for calculating and illustrating the sample size requirement and other design factors associated with these intervals.

Usage

1
2
n_t1samp_interval(E = NULL, n = NULL, s = NULL, alpha = 0.05,
  optim.max = 1e+09)

Arguments

E

Margin of error

n

Sample size

s

Sample standard deviation

alpha

Significance level (or 1-confidence)

optim.max

Maximum value for optimze when solving for n. The default setting is 1,000,000,000, which is probably higher than anyone will ever need. I may change this in the future for the sake of improving speed.

Details

Exactly one of the parameters n, E, s and alpha must be passed as NULL, and that parameter will be calculated from the others. Notice that alpha has a non-NULL default, so NULL must be explicitly passed if you want it computed.

Value

Returns an object of class HazPwr with subclasses t1samp and est (actual appearance: t1samp_est_HazPwr. The object contains a data frame of the parameters passed to the function (expanded using expand.grid) and the corresponding sample size estimates.

  1. n_est: Exact sample size. When n is not NULL, this will be identical to n.

  2. n: Estimated sample size; the next largest integer after n_est.

  3. E: Margin of error

  4. s: Sample Standard Deviation

  5. alpha: Desired significance level.

Author(s)

Benjamin Nutter


nutterb/junkyard documentation built on May 24, 2019, 10:51 a.m.