raw.moments {sem} | R Documentation |
Computes the ``uncorrected'' sum-of-squares-and-products matrix divided by the number of observations.
raw.moments(object, ...) ## S3 method for class 'formula': raw.moments(formula, data, subset, na.action, contrasts = NULL, ...) ## Default S3 method: raw.moments(object, ...) ## S3 method for class 'rawmoments': print(x, ...)
object |
a one-sided model formula or an object coercible to a numeric matrix. |
formula |
a one-sided model formula specifying the model matrix for
which raw moments are to be computed; note that a constant is included
if it is not explicitly suppressed by putting -1 in the formula. |
data |
an optional data frame containing the variables in the formula.
By default the variables are taken from the environment from which
raw.moments is called. |
subset |
an optional vector specifying a subset of observations to be used in computing moments. |
na.action |
a function that indicates what should happen when the data
contain NA s. The default is set by the na.action option. |
contrasts |
an optional list. See the contrasts.arg of
model.matrix.default |
x |
an object of class rawmoments to print. |
... |
arguments passed down. |
Returns an object of class rawmoments
, which is simply a matrix
with an attribute "N"
that contains the number of observations on
which the moments are based.
John Fox jfox@mcmaster.ca
data(Kmenta) raw.moments(cbind(1, Kmenta)) raw.moments(~ Q + P + D + F + A, data=Kmenta)