% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scores_mh.R
\name{compute_mh_y_pps__dist__pers_score}
\alias{compute_mh_y_pps__dist__pers_score}
\title{Compute "Prodromal Psychosis Scale [Youth] (Persistent Distress Score)"}
\usage{
compute_mh_y_pps__dist__pers_score(
  data,
  name = "mh_y_pps__dist__pers_score",
  combine = TRUE
)
}
\arguments{
\item{data}{tbl. Data frame containing the columns to be summarized.}

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

\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{
Computes the summary score \code{mh_y_pps__dist__pers_score}
Prodromal Psychosis Scale [Youth] (Persistent Distress Score)

For the last 3 consecutive waves (this wave, prior annual wave, and the wave
before that), if 2 or more waves have a \code{mh_y_pps__dist__curr_score} of "1",
then score is "1", else "0";
if more than 1 \code{NA} values in the last 3 waves, then score is \code{NA}.

The persistent flag is derived from a padded annual timeline per participant.
Missing annual visits between observed sessions are treated as \code{NA},
so each observed session evaluates the current wave plus the two
immediately preceding annual slots, even if data were not collected for
one of those visits.
The special case where both \verb{ses-00A} and \verb{ses-01A} meet the threshold (\code{1})
is also treated as persistent at \verb{ses-01A}.
\itemize{
\item \emph{Summarized variables:}
\itemize{
\item mh_y_pps__dist__curr_score (intermediate score)
}
\item \emph{Excluded values:} none
\item \emph{Validation criterion:}  none
}
}
\seealso{
\code{\link[=compute_mh_y_pps__dist__curr_score]{compute_mh_y_pps__dist__curr_score()}}
}
