Learn R Programming

estimatr (version 0.6.0)

lm_robust_fit: Internal method that creates linear fits

Description

Internal method that creates linear fits

Usage

lm_robust_fit(y, X, weights, cluster, ci, se_type, has_int, alpha = 0.05,
  return_vcov = TRUE, return_fit = FALSE, return_unweighted_fit = FALSE,
  try_cholesky = FALSE, X_first_stage = NULL)

Arguments

y

numeric outcome vector

X

numeric design matrix

weights

numeric weights vector

cluster

numeric cluster vector

ci

boolean that when T returns confidence intervals and p-values

se_type

character denoting which kind of SEs to return

has_int

logical, whether the model has an intercept, used for \(R^2\)

alpha

numeric denoting the test size for confidence intervals

return_vcov

logical, whether to return the vcov matrix for later usage

return_fit

logical, whether to return fitted values

return_unweighted_fit

logical, whether to return unweighted fitted values in place of weighted fitted values if regression is weighted

try_cholesky

logical, whether to try using a cholesky decomposition to solve LS instead of a QR decomposition

X_first_stage

numeric matrix of the first stage design matrix, only use for second stage of 2SLS IV regression, otherwise leave as NULL