makeCompVar {comparison} | R Documentation |
Compute integrated means and covariances
Description
Takes a large sample from the background population and calculates the within
and between covariance matrices, a vector of means, a vector of the counts of
replicates for each item from the sample, and other bits needed to make up a
compcovar
object.
Usage
makeCompVar(x, ...)
## Default S3 method:
makeCompVar(x, item.column, ...)
## S3 method for class 'formula'
makeCompVar(x, data = NULL, ...)
Arguments
x |
a |
... |
other arguments. |
item.column |
an integer indicating which column gives the item. |
data |
if |
Details
Uses ML estimation at the moment - this will almost certainly change in the future and hopefully allow regularisation methods to get a more stable (and non-singular) estimate.
Value
an object of class compvar
Methods (by class)
-
makeCompVar(default)
: Create acompvar
object using a formula. -
makeCompVar(formula)
: Create acompvar
object using a formula.
Author(s)
David Lucy and James Curran
Examples
# load Greg Zadora's glass data
data(glass)
# calculate a compcovar object based upon glass
# using K, Ca and Fe - warning - could take time
# on slower machines
background = subset(glass, select = c(item, logKO, logCaO, logFeO))
Z1 = makeCompVar(background, 1)
# Use the formula interface
Z2 = makeCompVar(item ~ logKO + logCaO + logFeO, data = glass)