% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/analyze.R
\name{analyze}
\alias{analyze}
\title{Master Analysis Function - Auto-detects and runs the right test}
\usage{
analyze(
  x = NULL,
  y = NULL,
  data = NULL,
  formula = NULL,
  mu = 0,
  paired = FALSE,
  nonparam = FALSE,
  conf.level = 0.95,
  var_name = "Variable",
  var1_name = "Variable 1",
  var2_name = "Variable 2",
  method = "pearson",
  test_type = NULL,
  effect_size = NULL,
  power = 0.8,
  n_groups = 2,
  n_predictors = 1,
  check = FALSE
)
}
\arguments{
\item{x}{A numeric vector (required always)}

\item{y}{A numeric vector, factor, or character group variable (optional)}

\item{data}{A data frame (required if using a formula)}

\item{formula}{A formula of the form outcome ~ predictor or
outcome ~ group1 * group2 or cbind(y1, y2) ~ group (optional)}

\item{mu}{Hypothesised mean for one-sample t-test. Default 0.}

\item{paired}{Logical. TRUE for paired t-test. Default FALSE.}

\item{nonparam}{Logical. TRUE to use non-parametric tests. Default FALSE.}

\item{conf.level}{Confidence level. Default 0.95.}

\item{var_name}{Optional label for the report.}

\item{var1_name}{Optional name for first variable in correlation.}

\item{var2_name}{Optional name for second variable in correlation.}

\item{method}{Correlation method: "pearson", "spearman", or "kendall".
Default "pearson".}

\item{test_type}{For power analysis: one of "ttest.one", "ttest.two",
"ttest.paired", "anova", "correlation", "chisq", "regression".}

\item{effect_size}{For power analysis: the expected effect size.}

\item{power}{For power analysis: desired power level. Default 0.80.}

\item{n_groups}{For power analysis ANOVA: number of groups. Default 2.}

\item{n_predictors}{For power analysis regression: number of predictors.
Default 1.}

\item{check}{Logical. TRUE to run assumption checks before analysis.
Default FALSE.}
}
\value{
A printed analysis report from the appropriate test
}
\description{
Master Analysis Function - Auto-detects and runs the right test
}
\examples{
# Descriptive only
analyze(x = c(23, 45, 12, 67, 34))

# Auto t-test
analyze(x = c(23,45,12,67,34), y = c(19,38,22,51,29))

# Auto ANOVA
df <- data.frame(
  score = c(23,45,12,67,34,89,56,43,78,90,11,34),
  group = rep(c("A","B","C"), each = 4)
)
analyze(formula = score ~ group, data = df)

# Power analysis
analyze(test_type = "ttest.two", effect_size = 0.5)

# Check assumptions
analyze(x = c(23,45,12,67,34), y = c(19,38,22,51,29),
        check = TRUE)
}
