makeCompVar | R Documentation |
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.
makeCompVar(x, ...)
## Default S3 method:
makeCompVar(x, item.column, ...)
## S3 method for class 'formula'
makeCompVar(x, data = NULL, ...)
x |
a |
... |
other arguments. |
item.column |
an integer indicating which column gives the item. |
data |
if |
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.
an object of class compvar
makeCompVar(default)
: Create a compvar
object using a formula.
makeCompVar(formula)
: Create a compvar
object using a formula.
David Lucy and James Curran
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.