% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/diagnostics.R
\name{diagnose_local_f}
\alias{diagnose_local_f}
\title{Local F test diagnostic on a gwpr_fit object}
\usage{
diagnose_local_f(object, ...)
}
\arguments{
\item{object}{A `gwpr_fit` object.}

\item{...}{Currently ignored.}
}
\value{
A named list with elements:
\describe{
  \item{`local_f`}{Data frame with columns `unit_id`, `statistic`, `p_value`,
    `df1`, `df2`, `status`.}
  \item{`n_tested`}{Number of units tested.}
  \item{`n_failed`}{Number of units where the test could not be computed.}
}
}
\description{
Performs a local F test (fixed effects vs. pooling) using per-unit local
residuals stored in the fitted model object.
}
\details{
**Applicable models**: gaussian (linear).  Not applicable to logistic models;
returns a `status = "not_applicable"` result when `family = "binomial"`.

**Panel balance requirement**: No constraint; the test uses per-unit local
residuals already computed during fitting.

**Failure conditions**: If `local_results` is empty or missing, all units
are reported as failed.  If a unit's local result does not contain the
information needed (within and pooling residuals), that unit is reported as
failed with an informative `status`.

**Logistic interpretation limit**: Not applicable; see above.
}
\examples{
\donttest{
library(sf)
pts <- sf::st_as_sf(
  data.frame(id = 1:4, X = c(0,1,0,1), Y = c(0,0,1,1)),
  coords = c("X", "Y"), crs = NA_integer_
)
dat <- data.frame(
  id   = rep(1:4, each = 5),
  time = rep(1:5, 4),
  y    = rnorm(20),
  x1   = rnorm(20)
)
fit <- fit_gwpr(y ~ x1, data = dat, spatial = pts, id = "id",
                time = "time", bandwidth = 2, workers = 1)
diagnose_local_f(fit)
}

}
