% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/analysis_plan.R
\name{run_analysis_plan}
\alias{run_analysis_plan}
\title{Run a pre-planned analysis from an instrument's analysis plan}
\usage{
run_analysis_plan(data, instrument, scored = TRUE)
}
\arguments{
\item{data}{A \code{tibble} or \code{data.frame} of responses, typically produced by
\code{\link[=read_responses]{read_responses()}} or \code{\link[=read_sheet_responses]{read_sheet_responses()}}.}

\item{instrument}{An \code{sframe} object containing an \code{analysis_plan}.}

\item{scored}{Logical. Whether to automatically score scales before running
the analysis. Defaults to \code{TRUE}.}
}
\value{
An object of class \code{sframe_analysis_results}, a list with one
element per analysis block. Each element contains the test result,
APA string, interpretation prompt, and reporting-reference metadata. Pass
to \code{\link[=render_results]{render_results()}} to generate a formatted report.
}
\description{
Executes every analysis block defined in the instrument's \code{analysis_plan}
slot against the supplied response data. Each block corresponds to one
research question defined during instrument design in the SurveyBuilder.
Results include APA-formatted statistics, effect sizes, interpretation
prompts, and reporting references.
}
\examples{
instr <- read_sframe(
  system.file("extdata", "tourism_services_demo.sframe",
              package = "surveyframe")
)
responses <- read_responses(
  system.file("extdata", "tourism_services_responses.csv",
              package = "surveyframe"),
  instr,
  respondent_id = "respondent_id",
  submitted_at = "submitted_at",
  meta_cols = "started_at"
)
results <- run_analysis_plan(responses, instr)
print(results)
}
\seealso{
\code{\link[=render_results]{render_results()}}, \code{\link[=read_sheet_responses]{read_sheet_responses()}}
}
