View source: R/UBStats_Main_Visible_ALL_202406.R
TEST.diffvar | R Documentation |
TEST.diffvar()
tests the hypothesis of equality between the
variances of two independent populations.
TEST.diffvar(
x,
y,
by,
digits = 2,
force.digits = FALSE,
use.scientific = FALSE,
data,
...
)
x , y |
Unquoted strings identifying the numeric
variables with the same length whose variances have to be compared.
|
by |
Optional unquoted string identifying a variable
(of any type), defined same way as |
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 difference between the variances of two independent populations.
Raffaella Piccarreta raffaella.piccarreta@unibocconi.it
CI.diffmean()
to build confidence intervals for
the difference between two populations' means.
TEST.diffmean()
to test hypotheses on the difference
between two populations' means.
data(MktDATA, package = "UBStats")
# Using x,y: build vectors with data on the two groups
AOV_M <- MktDATA$AOV[MktDATA$Gender == "M"]
AOV_F <- MktDATA$AOV[MktDATA$Gender == "F"]
TEST.diffvar(x = AOV_M, y = AOV_F)
TEST.diffvar(x = AOV_F, y = AOV_M) # same
# Using x,by: groups identified by ordered levels of by
TEST.diffvar(x = AOV, by = Gender, data=MktDATA)
# Output results
out_test.diffV<-TEST.diffvar(x = AOV_M, y = AOV_F)
# Arguments force.digits and use.scientific
# An input variable taking very low values
SmallX<-MktDATA$AOV/50000
SmallX_M <- SmallX[MktDATA$Gender == "M"]
SmallX_F <- SmallX[MktDATA$Gender == "F"]
# - Default output
TEST.diffvar(x = SmallX_M, y = SmallX_F)
# - Request to use the exact number of digits (default, 2)
TEST.diffvar(x = SmallX_M, y = SmallX_F,
force.digits = TRUE)
# - Request to allow scientific notation
TEST.diffvar(x = SmallX_M, y = SmallX_F,
use.scientific = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.