View source: R/UBStats_Main_Visible_ALL_202406.R
TEST.mean | R Documentation |
TEST.mean()
tests hypotheses on the mean of a population.
TEST.mean(
x,
sigma = NULL,
mu0 = 0,
alternative = "two.sided",
digits = 2,
force.digits = FALSE,
use.scientific = FALSE,
data,
...
)
x |
An unquoted string identifying the numeric
variable whose mean is of interest. |
sigma |
An optional numeric value specifying the
population standard deviation. If |
mu0 |
Numeric value that specifies the null hypothesis to test for (default is 0). |
alternative |
A length-one character vector specifying the direction
of the alternative hypothesis. Allowed values are |
digits |
Integer value specifying the number of
decimals used to round statistics; default to 2. If the chosen rounding formats some
non-zero values as zero, the number of decimals is increased
so that all values have at least one significant digit, unless the argument
|
force.digits |
Logical value indicating whether reported values
should be forcedly rounded to the number of decimals specified in
|
use.scientific |
Logical value indicating whether numbers
in tables should be displayed using
scientific notation ( |
data |
An optional data frame containing |
... |
Additional arguments to be passed to low level functions. |
A table reporting the results of the test on the population mean. If the variance is unknown, the test is run using percentiles from both the normal and the Student's t distribution.
Raffaella Piccarreta raffaella.piccarreta@unibocconi.it
CI.mean()
to build confidence intervals for the
population mean.
data(MktDATA, package = "UBStats")
# Test on the mean; KNOWN variance
# - Bilateral test
TEST.mean(NStore_Purch, sigma = 9, mu0 = 5,
alternative = "two.sided", data = MktDATA)
# - Unilateral test
TEST.mean(NStore_Purch, sigma = 9,mu0 = 5,
alternative = "greater", data = MktDATA)
# Test on the mean; UNKNOWN variance;
# - Unilateral test
TEST.mean(TotVal, mu0 = 600, alternative = "less",
data = MktDATA)
# Arguments force.digits and use.scientific
# An input variable taking very low values
SmallX<-MktDATA$AOV/500
# Default output
TEST.mean(SmallX, mu0 = 0.1)
# Request to use the exact number of digits (default, 2)
TEST.mean(SmallX, mu0 = 0.1,force.digits=TRUE)
# Request to allow scientific notation
TEST.mean(SmallX, mu0 = 0.1,use.scientific=TRUE)
# Output results
out.test_mean<-TEST.mean(TotVal, mu0 = 600, alternative = "less",
data = MktDATA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.