estimate: Estimate linear combinations from a regression model

View source: R/estimate.r

estimateR Documentation

Estimate linear combinations from a regression model

Description

Estimate linear combinations from a regression model

Usage

estimate(fit, lambda, alpha = 0.05, t.test = inherits(fit, "lm"), trans)

Arguments

fit

A model with coef() and vcov() methods

lambda

Linear combination weights (numeric vector with length equal to number of coefficients in fit)

alpha

Error rate for confidence interval (default: 0.05)

t.test

Use t distribution for inference? (default: TRUE only if model is linear)

trans

Apply a transformation function to the results? (function)

Examples

# Linear regression
fit <- lm(Ozone ~ Wind + Temp + Solar.R, airquality)
estimate(fit, c(0, 1, -1, 5))

# Logistic regression
DF <- as.data.frame(Titanic)
DF <- DF[rep(1:nrow(DF), DF$Freq),]
fit <- glm(Survived ~ Class + Sex + Age, DF, family=binomial)
estimate(fit, c(0, 1, -1, 0, 0, 0), trans=exp)

pbreheny/breheny documentation built on April 26, 2024, 10:40 a.m.