calculate_lr_test {mfp2} | R Documentation |
Function to calculate p-values for likelihood-ratio test
Description
Function to calculate p-values for likelihood-ratio test
Usage
calculate_lr_test(logl, dfs)
Arguments
logl |
a numeric vector of length 2 with log-likelihoods. Typically
ordered in increasing order (i.e. null model first, then full model) and
used to test the ratio |
dfs |
a numeric vector with degrees of freedom. |
Details
Uses Wilk's theorem that -2log(LR) (LR = likelihood ratio) asymptotically approaches a Chi-square distribution under the null hypothesis that both likelihoods are equal.
Model likelihoods can then be compared by computing D = -2 log(likelihood reduced model / likelihood full model), and then use a Chi-square distribution with df_full - df_reduced degrees of freedom to derive a p-value.
This is basically the same way as stats::anova()
implements the
likelihood ratio test.
Value
A list with two entries for the likelihood ratio test for the ratio
logl[1] / logl[2]
.
-
statistic
: test statistic. -
pvalue
: p-value