lincom: Tests of Linear Combinations of Regression Coefficients

Description Usage Arguments Value Author(s) Examples

View source: R/lincom.R

Description

Produces point estimates, interval estimates, and p values for linear combinations of regression coefficients using a uRegress object.

Usage

1
lincom(reg, comb, hyp=0, conf.level=.95, robustSE = TRUE, eform=reg$fnctl!="mean")

Arguments

reg

an object of class uRegress.

comb

a vector or matrix containing the values of the constants which create the linear combination of the form

c_0 + c_1β_1 + …

.

hyp

the null hypothesis to compare the linear combination of coefficients against. The default value is 0. An error will be thrown if the number of columns of this matrix are not equal to the number of coefficients in the model.

conf.level

a number between 0 and 1, indicating the desired confidence level for intervals.

robustSE

a logical value indicating whether or not to use robust standard errors in calculation. If TRUE, then robustSE must have been TRUE when reg was created.

eform

a logical value indicating whether or not to exponentiate the estimated coefficient. By default this is performed based on the type of regression used.

Value

Prints a matrix with the point estimate of the linear combination of coefficients, a p-value, and confidence interval.

Author(s)

Scott S. Emerson, M.D., Ph.D., Andrew J. Spieker, Brian D. Williamson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Loading required libraries
library(survival)
library(sandwich)

# Reading in a dataset
mri <- read.table("http://www.emersonstatistics.com/datasets/mri.txt",header=TRUE)
attach(mri)

# Linear regression of LDL on age (with robust SE by default)
testReg <- regress ("mean", ldl~age+stroke)

# Testing coefficient created by .5*age - stroke (the first 1 comes from including the intercept)
testC <- c(1, .5, -1)
lincom(testReg, testC)

uwIntroStats documentation built on May 2, 2019, 4:34 a.m.