% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ild_model_tidiers.R
\name{tidy_ild_model}
\alias{tidy_ild_model}
\title{Tidy fixed effects from an ILD model fit}
\usage{
tidy_ild_model(
  fit,
  conf_level = 0.95,
  object = FALSE,
  se = c("model", "robust"),
  robust_type = c("CR2", "CR3", "CR0"),
  ...
)
}
\arguments{
\item{fit}{A fitted model from [ild_lme()] (lmerMod or lme).}

\item{conf_level}{Numeric. Confidence level for intervals (default 0.95).}

\item{object}{Logical. If \code{TRUE}, return a list with \code{meta} and \code{table}
and class \code{tidyild_model} for polished printing (default \code{FALSE}).}

\item{se}{Character. \code{"model"} (default) uses the model's standard errors;
\code{"robust"} uses cluster-robust SEs from [ild_robust_se()] (requires
\pkg{clubSandwich}).}

\item{robust_type}{Character. When \code{se = "robust"}, the correction type:
\code{"CR2"} (recommended), \code{"CR3"}, or \code{"CR0"}.}

\item{...}{Passed to [ild_robust_se()] when \code{se = "robust"} (e.g. \code{cluster}, \code{cluster_vec}).}
}
\value{
A tibble, or when \code{object = TRUE} a list of class \code{tidyild_model}.
}
\description{
Returns a tibble conforming to \code{\link{ild_tidy_schema}}: required columns include
\code{term}, \code{component}, \code{effect_level}, \code{estimate}, \code{std_error},
\code{conf_low}, \code{conf_high}, \code{statistic}, \code{p_value}, \code{interval_type},
\code{engine}, \code{model_class}; optional Bayesian columns are \code{NA} for these engines.
\code{component} is \code{"fixed"} for coefficient rows; \code{effect_level} is inferred
conservatively from term names (e.g. \verb{_wp}/\verb{_bp} suffixes) or \code{"population"}
for the intercept, \code{"unknown"} when ambiguous.
}
\details{
With \code{object = TRUE}, returns an object of class \code{tidyild_model} (meta + table) for use with
\code{print.tidyild_model}.
}
\section{Model-based vs robust SE}{

With \code{se = "model"} (default), standard errors and CIs come from the fitted
model. With \code{se = "robust"}, cluster-robust (sandwich) SEs are used;
CIs and p-values are based on a Wald normal approximation. Install the
\pkg{clubSandwich} package to use robust SEs. For **IPW / MSM** weighted \code{lmer}
fits ([ild_ipw_refit()]), robust SEs do not account for estimated weights; use
[ild_msm_bootstrap()] and [tidy_ild_msm_bootstrap()] when you need bootstrap CIs;
see [ild_msm_inference].
}

