maxLR: implements the maximum likelihood ratio test

Description Usage Arguments Details Value See Also Examples

View source: R/likelihood.R

Description

The maximum likelihood ratio test is a classical goodness-of-fit test for linear models. Mathematically speaking, the average residual sum of squares for an ordinary least squares (OLS) is approximated as a chi-square distribution to generate a p-value.

Usage

1
maxLR(X, Y)

Arguments

X

covariate matrix

Y

response vector

Details

The test is valid when the number of samples is larger than the number of covariates.

Value

p-value of the test

See Also

Other LR test: anovaLR()

Examples

1
2
3
4
5
n <- 50
p <- 20
X <- matrix(rnorm(n*p), nrow = n, ncol = p)
Y <- rnorm(n)
stat.likelihood <- maxLR(X, Y)

kernelPSI documentation built on Dec. 8, 2019, 1:07 a.m.