% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/moments.R
\name{predictMoments}
\alias{predictMoments}
\alias{predictMoments.default}
\alias{predictMoments.cnorm}
\alias{predictMoments.cnormBetaBinomial}
\alias{predictMoments.cnormBetaBinomial2}
\alias{predictMoments.cnormShash}
\title{Model-Implied Distributional Moments at Specific Ages}
\usage{
predictMoments(model, age, ...)

\method{predictMoments}{default}(model, age, ...)

\method{predictMoments}{cnorm}(model, age, nNodes = 100, ...)

\method{predictMoments}{cnormBetaBinomial}(model, age, ...)

\method{predictMoments}{cnormBetaBinomial2}(model, age, ...)

\method{predictMoments}{cnormShash}(model, age, nNodes = 100, ...)
}
\arguments{
\item{model}{A model object of class \code{cnorm},
\code{cnormBetaBinomial}, \code{cnormBetaBinomial2} or
\code{cnormShash}.}

\item{age}{A numeric vector of ages (values of the explanatory variable)
at which to compute the moments.}

\item{...}{Additional parameters passed to the methods, e.g.
\code{nNodes}.}

\item{nNodes}{Number of Gauss-Hermite quadrature nodes (default 100).
Only relevant for the Taylor and SHASH methods; ignored for
beta-binomial models, which are computed exactly by summation.}
}
\value{
A \code{data.frame} with one row per age and the columns
  \code{age}, \code{mean}, \code{sd}, \code{variance}, \code{skewness}
  and \code{kurtosis} (excess). The computation method is stored in the
  attribute \code{"method"}.
}
\description{
Computes the mean, standard deviation, variance, skewness and (excess)
kurtosis of the raw score distribution implied by a fitted cNORM model
at one or more ages (or, more generally, values of the explanatory
variable). The moments are model-implied population moments of the
conditional raw score distribution, censored at the bounds of the raw
score range \code{[minRaw, maxRaw]} for consistency across model families.
}
\details{
The computation strategy depends on the model family:
\describe{
  \item{Taylor polynomial (\code{cnorm})}{The bivariate regression function
    is collapsed at the specified age into a univariate polynomial in the
    norm score (location) variable. Moments are then obtained by
    Gauss-Hermite quadrature, which is mathematically exact for
    polynomial quantile functions (up to the censoring at
    \code{minRaw}/\code{maxRaw}).}
  \item{Beta-binomial (\code{cnormBetaBinomial},
    \code{cnormBetaBinomial2})}{Moments are computed exactly by summation
    over the discrete probability mass function on the support
    \code{0:n}, using the age-specific predicted \eqn{\alpha} and
    \eqn{\beta} parameters. This respects the discreteness of the
    distribution; no continuity approximation is involved.}
  \item{SHASH (\code{cnormShash})}{Moments are obtained by Gauss-Hermite
    quadrature of the quantile function \code{qshash} evaluated at the
    age-specific distribution parameters, censored at
    \code{minRaw}/\code{maxRaw}.}
}

Kurtosis is reported as \emph{excess} kurtosis (0 for the normal
distribution).

Note that the skewness and kurtosis of the \emph{censored} distribution
are reported. For well-fitting models whose raw score range covers the
probability mass of the conditional distribution, censoring effects are
negligible; for distributions with substantial floor or ceiling effects,
the censored moments are the substantively meaningful ones.
}
\examples{
\dontrun{
# Taylor polynomial model
model <- cnorm(raw = elfe$raw, group = elfe$group)
predictMoments(model, age = c(2.25, 2.75, 3.25, 3.75, 4.25))

# Beta-binomial model
bb <- cnorm.betabinomial(age = ppvt$age, score = ppvt$raw, n = 228)
predictMoments(bb, age = seq(4, 16, by = 2))
}

}
\references{
Isserlis, L. (1918). On a formula for the product-moment coefficient of
any order of a normal frequency distribution in any number of variables.
Biometrika, 12(1/2), 134-139.

Jones, M. C. & Pewsey, A. (2009). Sinh-arcsinh distributions.
Biometrika, 96(4), 761-780.
}
\seealso{
\code{\link{normTable}}, \code{\link{predictNorm}},
  \code{\link{predictRaw}}
}
