% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scores_mh.R
\name{ss_mean_ksads}
\alias{ss_mean_ksads}
\title{Internal function for all ksads summary score functions.}
\usage{
ss_mean_ksads(data, name, vars, max_na, exclude, combine)
}
\arguments{
\item{data}{tbl. Data frame containing the columns to be summarized.}

\item{name}{character. Name of the summary score column.}

\item{vars}{character vector. Names of the columns to be summarized.}

\item{max_na}{numeric, positive whole number. Number of missing items
allowed. \code{NULL} means no limit.}

\item{exclude}{character vector. Values to be excluded from the summary
score calculation.}

\item{combine}{logical. If \code{TRUE} (default), the summary score is
is appended as a new column to the input data frame. If \code{FALSE}, the
summary score is returned as a separate one-column data frame.}
}
\value{
tbl. see \code{combine}.
}
\description{
Internal function for all ksads summary score functions.
}
\details{
KSADS summary scores are mostly calculating the means over variables,
but there are two special codes to handle:
\itemize{
\item \code{"888"}: item skipped by branching. When at least one input value is
observed, any \code{888} value is converted to "0" prior to averaging.
\item \code{"555"}: module not administered. If any input variable is "555"
leave the score as \code{NA}.
\item \code{NA}: missing value. If at least one input value is observed,
any \code{NA} values are converted to "0" prior to averaging.
If all inputs are \code{NA}, the summary score remains \code{NA}.
}
}
\keyword{internal}
