lincom: Analyzing subgroup effects with a continuous modifier

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Inputs a linear model from the lm function and set of indices and multipliers for a set of coefficients. Return the estimate, CI and p-value. In other words, from the STATA docs, computes point estimates... p-values, and confidence intervals for linear combinations of coefficients. NOTE: For the indices in par, beta0 = 1, beta1 = 2, and so on.

Usage

1
lincom(par, mults, model, alpha = 0.05)

Arguments

par

A vector specifying the indices of coefficients

mults

A vector of multipliers

model

An lm object

alpha

The alpha level for the CIs and p-values

Value

A vector containing the estimate, CI, and p-value

Examples

1
2
3
4
# Testing beta1 + 7.5*beta3
# lincom(par = c(2,4),
#        mults = c(1,7.5),
#        model=my_linear_model)

maxdrohde/bios6312 documentation built on March 13, 2021, 1:50 p.m.