gldrmLRT: Likelihood ratio test for nested models In gldrm: Generalized Linear Density Ratio Models

Description

Performs a likelihood ratio F-test between nested gldrm models. The F-statistic is calculated as 2 \times (llik - llik_0) / r, where r is the difference is the number of parameters between the full and null models. The F-statistic has degrees of freedom r and n-p, where n is the number of observations and p is the number of parameters in the full model.

Usage

 1 gldrmLRT(gldrmFit, gldrmNull) 

Arguments

 gldrmFit The full model. Must be an object of S3 class 'gldrm' returned from the gldrm function. gldrmNull The sub-model being tested under the null hypotheses. Must be an object of S3 class 'gldrm' returned from the gldrm function.

Value

An S3 object of class 'gldrmLRT', containing numerator and denominator degrees of freedom, an F-statistic, and a p-value.

Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 data(iris, package="datasets") ### Fit gldrm with all variables fit <- gldrm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species, data=iris, link="log") ### Fit gldrm without the categorical variable "Species" fit0 <- gldrm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data=iris, link="log") ### Likelihood ratio test for the nested models lrt <- gldrmLRT(fit, fit0) lrt 

gldrm documentation built on May 2, 2019, 12:59 p.m.