% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_logistic.R
\name{fit_logistic_local_model}
\alias{fit_logistic_local_model}
\title{Fit a single local binary logistic panel model}
\usage{
fit_logistic_local_model(
  local_data,
  formula,
  model,
  effect,
  weights,
  index,
  threshold = 0.5,
  family = "binomial"
)
}
\arguments{
\item{local_data}{A \code{data.frame} with all formula variables and panel
index columns.}

\item{formula}{A formula object.}

\item{model}{Character scalar: \code{"pooling"}, \code{"fixed"}, or
\code{"random"}.}

\item{effect}{Character scalar: \code{"individual"}, \code{"time"},
\code{"two-way"}, or \code{"nested"}.}

\item{weights}{Numeric vector of kernel weights aligned with
\code{nrow(local_data)}.}

\item{index}{Character vector of length 2: \code{c(id_col, time_col)}.}

\item{threshold}{Numeric scalar; classification threshold (default 0.5).}

\item{family}{Character scalar reserved for future extension (currently
only \code{"binomial"} is implemented).}
}
\value{
A list with elements:
\describe{
  \item{\code{fit}}{The fitted model object, or \code{NULL} on failure.}
  \item{\code{status}}{\code{"ok"} or \code{"failed"}.}
  \item{\code{error}}{\code{NULL} or character error message.}
  \item{\code{metadata}}{Named list with additional fitting metadata.}
}
}
\description{
Dispatches to the correct backend (\code{pooling}, \code{fixed}, or
\code{random}) based on \code{model}, wrapping execution in a
\code{tryCatch} so that convergence failures or complete-separation errors
are captured rather than propagated.
}
\keyword{internal}
