| enpar | R Documentation |
Estimate the mean, standard deviation, and standard error of the mean nonparametrically given a sample of data, and optionally construct a confidence interval for the mean.
enpar(x, ci = FALSE, ci.method = "bootstrap", ci.type = "two-sided",
conf.level = 0.95, pivot.statistic = "z", n.bootstraps = 1000, seed = NULL)
x |
numeric vector of observations.
Missing ( |
ci |
logical scalar indicating whether to compute a confidence interval for the
mean. The default value is |
ci.method |
character string indicating what method to use to construct the confidence interval
for the mean. The possible values are
|
ci.type |
character string indicating what kind of confidence interval to compute. The
possible values are |
conf.level |
a scalar between 0 and 1 indicating the confidence level of the confidence interval.
The default value is |
pivot.statistic |
character string indicating which statistic to use for the confidence interval
for the mean when |
n.bootstraps |
numeric scalar indicating how many bootstraps to use to construct the
confidence interval for the mean. This argument is ignored if
|
seed |
integer supplied to the function |
Extended methods and derivations are available in
Nonparametric estimation and two-sample tests: enpar.
Open the vignette locally with
vignette("nonparametric-methods", package = "EnvStats").
a list of class "estimate" containing the estimated parameters
and other information. See estimate.object for details.
The function enpar is related to the companion function
enparCensored for censored data. To estimate the median and
compute a confidence interval, use eqnpar.
The result of the call to enpar with ci.method="normal.approx"
and pivot.statistic="t" produces the same result as the call to
enorm with ci.param="mean".
Steven P. Millard (EnvStats@ProbStatInfo.com)
Efron, B. (1979). Bootstrap Methods: Another Look at the Jackknife. The Annals of Statistics 7, 1–26.
Efron, B., and R.J. Tibshirani. (1993). An Introduction to the Bootstrap. Chapman and Hall, New York, 436pp.
enparCensored, eqnpar, enorm,
mean, sd, estimate.object.
# The data frame ACE.13.TCE.df contains observations on
# Trichloroethylene (TCE) concentrations (mg/L) at
# 10 groundwater monitoring wells before and after remediation.
#
# Compute the mean concentration for each period along with
# a 95% bootstrap BCa confidence interval for the mean.
#
# NOTE: Use of the argument "seed" is necessary to reproduce this example.
#
# Before remediation: 21.6 [14.2, 30.1]
# After remediation: 3.6 [ 1.6, 5.7]
with(ACE.13.TCE.df,
enpar(TCE.mg.per.L[Period=="Before"], ci = TRUE, seed = 476))
#Results of Distribution Parameter Estimation
#--------------------------------------------
#
#Assumed Distribution: None
#
#Estimated Parameter(s): mean = 21.62400
# sd = 13.51134
# se.mean = 4.27266
#
#Estimation Method: Sample Mean
#
#Data: TCE.mg.per.L[Period == "Before"]
#
#Sample Size: 10
#
#Confidence Interval for: mean
#
#Confidence Interval Method: Bootstrap
#
#Number of Bootstraps: 1000
#
#Confidence Interval Type: two-sided
#
#Confidence Level: 95%
#
#Confidence Interval: Pct.LCL = 13.95560
# Pct.UCL = 29.79510
# BCa.LCL = 14.16080
# BCa.UCL = 30.06848
# t.LCL = 12.41945
# t.UCL = 32.47306
#----------
with(ACE.13.TCE.df,
enpar(TCE.mg.per.L[Period=="After"], ci = TRUE, seed = 543))
#Results of Distribution Parameter Estimation
#--------------------------------------------
#
#Assumed Distribution: None
#
#Estimated Parameter(s): mean = 3.632900
# sd = 3.554419
# se.mean = 1.124006
#
#Estimation Method: Sample Mean
#
#Data: TCE.mg.per.L[Period == "After"]
#
#Sample Size: 10
#
#Confidence Interval for: mean
#
#Confidence Interval Method: Bootstrap
#
#Number of Bootstraps: 1000
#
#Confidence Interval Type: two-sided
#
#Confidence Level: 95%
#
#Confidence Interval: Pct.LCL = 1.833843
# Pct.UCL = 5.830230
# BCa.LCL = 1.631655
# BCa.UCL = 5.677514
# t.LCL = 1.683791
# t.UCL = 8.101829
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.