fit_model_q: Fit OLS model using lm.fit (Internal Helper)

View source: R/utils.R

fit_model_qR Documentation

Fit OLS model using lm.fit (Internal Helper)

Description

Lightweight and robust wrapper around lm.fit() for use in bootstrap procedures. Designed to handle possible rank-deficiency gracefully by returning NA-coefficients for linearly dependent terms. Primarily used internally within simultaneous_ci().

Usage

fit_model_q(X_full, y, q_indices)

Arguments

X_full

Numeric matrix. Full design matrix including intercept if present. Column names must be unique. Typically derived from X + intercept inside simultaneous_ci().

y

Numeric vector. Response variable, same length as nrow(X_full).

q_indices

Integer vector. Column indices (1-based) specifying the submodel to fit.

Value

Named numeric vector of estimated coefficients. If fitting fails or coefficients are dropped due to collinearity, NA values are returned with expected names.


PosiR documentation built on June 8, 2025, 12:24 p.m.