% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/psych_scores.R
\name{spq_score}
\alias{spq_score}
\title{Schizotypal Personality Questionnaire (key-driven)}
\usage{
spq_score(
  data,
  col_map = list(),
  key,
  na_action = c("keep", "omit", "error"),
  missing_prop_max = 0.2,
  impute = c("none", "mean"),
  prefix = "SPQ",
  verbose = TRUE
)
}
\arguments{
\item{data}{Data frame containing questionnaire item columns.}

\item{col_map}{Named list mapping canonical item IDs to column names; defaults assume items are already named.}

\item{key}{List with \code{items}, \code{min_val}, \code{max_val}, optional \code{reverse} and \code{subscales}.}

\item{na_action}{How to handle rows with missing items: \code{keep}, \code{omit}, or \code{error}.}

\item{missing_prop_max}{Maximum allowed proportion of missing items per row before the score is set to \code{NA}.}

\item{impute}{Imputation strategy for missing items when under the threshold: \code{none} or \code{mean} (row-wise mean).}

\item{prefix}{Prefix for output column names.}

\item{verbose}{Logical; if \code{TRUE}, emits informational messages about column resolution and scoring progress via \code{hm_inform()}.}
}
\value{
A tibble of score columns only (total and optional subscales). Input columns are not included.
}
\description{
Schizotypal Personality Questionnaire (key-driven)
}
\examples{
spq_key <- list(items = sprintf("spq_\%02d", 1:5), min_val = 0, max_val = 1)
df <- data.frame(spq_01 = 0, spq_02 = 1, spq_03 = 0, spq_04 = 1, spq_05 = 0)
spq_score(df, key = spq_key)
}
\references{
\insertRef{raine1991spq}{HealthMarkers}
}
