robin_lm: Covariate adjusted lm model

View source: R/robin_lm.R

robin_lmR Documentation

Covariate adjusted lm model

Description

Covariate adjusted lm model

Usage

robin_lm(
  formula,
  data,
  treatment,
  vcov = "vcovG",
  vcov_args = list(),
  pair,
  ...
)

Arguments

formula

(formula) A formula of analysis.

data

(data.frame) Input data frame.

treatment

(formula or character(1)) A formula of treatment assignment or assignment by stratification, or a string name of treatment assignment.

vcov

(function) A function to calculate the variance-covariance matrix of the treatment effect, including vcovHC and vcovG. The default is 'vcovG'.

vcov_args

(list) Additional arguments passed to vcov.

pair

Pairwise treatment comparison.

...

Additional arguments passed to lm.

Value

A treatment_effect object.

Examples

robin_lm(
  y ~ treatment * s1,
  data = dummy_data,
  treatment = treatment ~ s1
)

RobinCar2 documentation built on April 3, 2025, 9:34 p.m.