CImu_data | R Documentation |
Computes confidence intervals for a population mean (mu
) using either
supplied data or data generated from a normal distribution with specified
parameters. The function calculates key statistics such as the sample mean,
standard deviation, and confidence intervals at user-defined confidence levels.
Results are returned as a structured list containing observed and/or theoretical
values, interval endpoints, and related measures.
CImu_data(
x = NULL,
n = length(x),
xbar = NULL,
sd = NULL,
conf.level = c(0.9, 0.95, 0.99),
mu = NULL,
sigma = NULL
)
dcimu(
x = NULL,
n = length(x),
xbar = NULL,
sd = NULL,
conf.level = c(0.9, 0.95, 0.99),
mu = NULL,
sigma = NULL
)
x |
numeric vector of observed data. If |
n |
integer: sample size (if |
xbar |
numeric: sample mean (computed from |
sd |
numeric: sample standard deviation (computed from |
conf.level |
numeric vector of confidence levels (default: |
mu |
numeric: true population mean (used for simulation if |
sigma |
numeric: population standard deviation(s) (used for simulation if |
A list containing:
a |
upper-tail probability |
n |
sample size |
xbar |
sample mean |
mu |
theoretical mean (if provided) |
sd |
sample standard deviation |
sigma |
theoretical standard deviation (if provided) |
df |
degrees of freedom (if using a t distribution) |
q |
critical value(s) from the normal or t distribution |
ss |
standard deviation used in calculations ( |
e |
margin of error (half-width of the interval) |
l |
interval length |
v |
confidence interval endpoints |
# Using observed data
x <- rnorm(100)
CImu_data(x, conf.level = 0.95)
# Simulating data internally
CImu_data(n = 100, conf.level = 0.95, mu = 0, sigma = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.