% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_logistic.R
\name{extract_logistic_local_result}
\alias{extract_logistic_local_result}
\title{Extract coefficients and diagnostics from a local logistic model}
\usage{
extract_logistic_local_result(
  local_result,
  local_data,
  formula,
  threshold = 0.5,
  eps = 1e-15
)
}
\arguments{
\item{local_result}{A list as returned by \code{fit_logistic_local_model()}.}

\item{local_data}{The \code{data.frame} used to fit the model (needed to
extract \code{y} and to predict).}

\item{formula}{The model formula (used to extract the response name).}

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

\item{eps}{Numeric scalar; clipping bound for probability (default
\code{1e-15}).}
}
\value{
A named list with elements:
\describe{
  \item{\code{coefficients}}{Named numeric vector of local coefficient
    estimates, or \code{NA_real_} on failure.}
  \item{\code{prob}}{Numeric vector of predicted probabilities for the local
    data rows, or \code{NA_real_} on failure.}
  \item{\code{class_pred}}{Integer vector (0/1) of predicted classes, or
    \code{NA_real_} on failure.}
  \item{\code{pearson_resid}}{Numeric vector of Pearson residuals, or
    \code{NA_real_} on failure.}
  \item{\code{status}}{\code{"ok"} or \code{"failed"}.}
  \item{\code{error}}{\code{NULL} or character error message.}
}
}
\description{
Computes predicted probabilities, predicted classes, Pearson residuals,
and extracts coefficient estimates.  Pearson residuals are defined as
\code{(y - p) / sqrt(p * (1 - p))} with \code{p} clipped to
\code{[eps, 1 - eps]} to avoid division by zero.
}
\keyword{internal}
