View source: R/levenetestClust.R
levenetestClust | R Documentation |
Performs a reweighted test for homogeneity of marginal variances across intra-cluster groups in clustered data. Appropriate for clustered data with cluster- or group size informativeness.
levenetestClust(y, ...) ## Default S3 method: levenetestClust(y, group, id, center = c("median", "mean"), trim = NA, ...) ## S3 method for class 'formula' levenetestClust(formula, id, data, subset, na.action, ...)
y |
vector of numeric responses. |
... |
further arguments to be passed to or from methods. |
group |
vector or factor object defining groups. |
id |
vector or factor object denoting cluster membership for |
center |
The name of a function to compute the center of each group. If |
trim |
optional numeric argument taking values [0, 0.5] to specify the percentage trimmed mean.
Ignored if |
formula |
a formula of the form |
data |
an optional matrix or data frame containing variables in the formula |
subset |
an optional vector specifying a subset of observations to be used. |
na.action |
a function which indicates what should happen when data contain |
The null hypothesis is that all levels of group
have equal marginal variances.
A list with class "htest
" containing the following components:
statistic |
the value of the test statistic. |
p.value |
the p-value of the test. |
parameter |
the degrees of freedom of the chi square distribution. |
method |
a character string indicating the test performed. |
data.name |
a character string giving the name of the data and the total number of clusters. |
M |
the number of clusters. |
Gregg, M., Marginal methods and software for clustered data with cluster- and group-size informativeness. PhD dissertation, University of Louisville, 2020.
data(screen8) ## Do boys and girls have the same variability in math scores? ## Test using vectors levenetestClust(y=screen8$math, group=screen8$gender, id=screen8$sch.id) ## Test using formula method levenetestClust(math~gender, id=sch.id, data=screen8) ## Using 10% trimmed mean levenetestClust(math~gender, id=sch.id, data=screen8, center="mean", trim=.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.