likelihoodRatioTest: likelihoodRatioTest

Description Usage Arguments Examples

View source: R/likelihoodRatioTest.R

Description

Calculates the likelihood ratio test statistic and associated p-value under the chi squared approximation with degrees of freedom df.

Usage

1
likelihoodRatioTest(logLik_H0, logLik_H1, df)

Arguments

logLik_H0

log likelihood of the null model

logLik_H1

log likelihood of the alternative model

df

degrees of freedom for the chisquared random variable (usually the difference in degrees of freedom between the alternative and the null models)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
y1 = seq(0.1,1,0.1)
y2 = y1*y1+1

Y = cbind(y1,y2)

x1 = log(1:10)
x2 = x1^2-x1
X = cbind(x1,x2)

LL_H1 = logLikMVR(lm(Y~X)) # here degrees of freedom is 3*2 = 6
LL_H0 = logLikMVR(lm(Y~1)) # here degrees of freedom is 1*2 = 2
likelihoodRatioTest(LL_H0, LL_H1, df=6-2)

mrparker909/mvregress documentation built on Dec. 27, 2019, 3:40 p.m.