Learn R Programming

statuser (version 0.1.9)

validate_lm2: Validate Inputs for lm2() Function

Description

Validates se_type and clusters arguments for lm2(). Also handles creating a data frame from vectors if data is not provided.

Usage

validate_lm2(
  formula,
  data = NULL,
  se_type = "HC3",
  se_type_missing = TRUE,
  dots = list(),
  calling_env = parent.frame()
)

Value

A list containing:

  • data: The data frame to use (either provided or constructed from vectors)

  • se_type: The validated/adjusted se_type

  • has_clusters: Logical indicating if clusters are being used

Arguments

formula

A formula specifying the model.

data

An optional data frame containing the variables.

se_type

The type of standard error to use.

se_type_missing

Logical. Whether se_type was not explicitly provided by user.

dots

Additional arguments passed to lm_robust (to check for clusters).

calling_env

The environment in which to look for variables if data is not provided.