% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extract_model_components.R
\name{extract_model_components}
\alias{extract_model_components}
\title{Extract model components from formulas}
\usage{
extract_model_components(
  selection,
  outcome,
  data,
  outcomeS = NULL,
  outcomeC = NULL,
  drop.levels = TRUE
)
}
\arguments{
\item{selection}{A formula representing the selection equation.}

\item{outcome}{A formula representing the outcome equation.}

\item{data}{A data frame containing all variables used in the formulas.}

\item{outcomeS}{Optional matrix, vector, one-sided formula, or 1 for the
log-scale model in the generalized Heckman model.}

\item{outcomeC}{Optional matrix, vector, one-sided formula, or 1 for the
correlation model in the generalized Heckman model.}

\item{drop.levels}{Logical; if TRUE, unused factor levels are dropped.}
}
\value{
A list with selection, outcome, dispersion and correlation matrices.
}
\description{
This function extracts model matrices and response vectors used by the
sample-selection model fitting functions. It standardizes the selection
response to a numeric indicator, where 1 denotes selected/observed and
0 denotes not selected/not observed.
}
