LRT: Performs likelihood-ratio test for lexpit and BLM models of...

View source: R/lexpit.lrt.R View source: R/blm.cohort.R

LRTR Documentation

Performs likelihood-ratio test for lexpit and BLM models of cohort data

Description

Computes the likelihood ratio test for the significance of the specified variable in a lexpit or BLM model fit to cohort data. This method is only valid for study designs that use simple random sampling.

Usage

LRT(object, var)

Arguments

object

a model of the lexpit or blm class.

var

character name of term.label to be tested

Value

A matrix with the LRT statistic and p-value for the test of the significance of the specified variable given all other variables in the model.

Author(s)

S. Kovalchik s.a.kovalchik@gmail.com

See Also

constrOptim

Examples



cohort <- data.frame(
	x1 = runif(500),
	x2 = runif(500)
)

cohort$event <- rbinom(n=nrow(cohort),size=1,
			prob=0.25+0.1*cohort$x1+.1*cohort$x2)

fit <- blm(event~x1+x2, data=cohort)

summary(fit)

LRT(fit, "x1")
LRT(fit, "x2")


blm documentation built on Sept. 12, 2022, 9:05 a.m.