ndvtest: Shi test for non-nested models

View source: R/ndvtest.R

ndvtestR Documentation

Shi test for non-nested models

Description

The Shi test correct the bias of the Vuong test

Usage

ndvtest(
  x,
  y,
  size = 0.05,
  pval = TRUE,
  nested = FALSE,
  vartest = FALSE,
  ndraws = 10000,
  diffnorm = 0.1,
  seed = 1,
  numbers = NULL,
  nd = TRUE,
  print.level = 0
)

## S3 method for class 'maxLik2'
llcont(x, ...)

## S3 method for class 'maxLik2'
bread(x, ...)

## S3 method for class 'maxLik2'
estfun(x, ...)

## S3 method for class 'maxLik2'
logLik(object, ...)

Arguments

x

a first fitted model,

y

a second fitted model,

size

the size of the test,

pval

should the p-value be computed ?

nested

a boolean, TRUE for nested models,

vartest

a boolean, if TRUE, the variance test is computed,

ndraws

the number of draws for the simulations,

diffnorm

a creuser,

seed

the seed,

numbers

a user provided matrix of random numbers

nd

a boolean, if TRUE (the default) the non-degenarate Vuong test is computed,

print.level

the level of details to be printed,

...

further arguments,

object

an object of class maxLik2.

Value

an object of class "htest"

References

\insertRef

VUON:89ndvtest

\insertRef

SHI:15ndvtest

See Also

the classical Vuong test is implemented in pscl::vuong and nonnest2::vuongtest.

Examples


# A poisson model example from the nonnest2 man page
data("housing", package = "MASS")
house1 <- glm(Freq ~ Infl + Type + Cont, family = poisson, data = housing)
house2 <- glm(Freq ~ Infl + Sat,         family = poisson, data = housing)
nonnest2::vuongtest(house1, house2)
ndvtest(house1, house2)
data("bioChemists", package = "pscl")
bio1 <- glm(art ~ fem + mar + phd + ment, family=poisson, data=bioChemists)
bio2 <- pscl::hurdle(art ~ fem + mar + phd + ment, data=bioChemists)
bio3 <- pscl::zeroinfl(art ~ fem + mar + phd + ment, data=bioChemists)
nonnest2::vuongtest(bio3, bio2)
ndvtest(bio3, bio2)

ndvtest documentation built on March 18, 2022, 7:17 p.m.