| ci.mu.z | R Documentation |
These functions calculate t and z confidence intervals for \mu. Z confidence intervals require specification (and thus knowledge) of \sigma. Both methods assume underlying normal distributions although this assumption becomes irrelevant for large sample sizes. Finite population corrections are provided if requested.
ci.mu.z(data, conf = 0.95, sigma = 1, summarized = FALSE, xbar = NULL,
fpc = FALSE, N = NULL, n = NULL, na.rm = FALSE)
ci.mu.t(data, conf = 0.95, summarized = FALSE, xbar = NULL, sd = NULL,
fpc = FALSE, N = NULL, n = NULL, na.rm = FALSE)
data |
A vector of quantitative data. Required if |
conf |
Confidence level; 1 - P(type I error). |
sigma |
The population standard deviation. |
summarized |
A logical statement specifying whether statistical summaries are to be used. If |
xbar |
The sample mean. Required if |
fpc |
A logical statement specifying whether a finite population correction should be made. If |
N |
The population size. Required if |
sd |
The sample standard deviation. Required if |
n |
The sample size. Required if |
na.rm |
Logical, indicate whether |
ci.mu.z and ci.mu.t calculate confidence intervals for either summarized data or a
dataset provided in data. Finite population corrections are made if a user specifies fpc=TRUE and
provides some value for N.
Returns a list of class = "ci". Default printed results are the parameter estimate and confidence bounds. Other invisible objects include:
Margin |
the confidence margin. |
Ken Aho
Lohr, S. L. (1999) Sampling: Design and Analysis. Duxbury Press. Pacific Grove, USA.
pnorm, pt
#With summarized=FALSE
x<-c(5,10,5,20,30,15,20,25,0,5,10,5,7,10,20,40,30,40,10,5,0,0,3,20,30)
ci.mu.z(x,conf=.95,sigma=4,summarized=FALSE)
ci.mu.t(x,conf=.95,summarized=FALSE)
#With summarized = TRUE
ci.mu.z(x,conf=.95,sigma=4,xbar=14.6,n=25,summarized=TRUE)
ci.mu.t(x,conf=.95,sd=4,xbar=14.6,n=25,summarized=TRUE)
#with finite population correction and summarized = TRUE
ci.mu.z(x,conf=.95,sigma=4,xbar=14.6,n=25,summarized=TRUE,fpc=TRUE,N=100)
ci.mu.t(x,conf=.95,sd=4,xbar=14.6,n=25,summarized=TRUE,fpc=TRUE,N=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.