FStat {HTSeedGLM}R Documentation

F-test between two fitted models

Description

This function considers two fitted models as inputs. Considering the first model as full model, it performs testing equality of uniformity parameters representing the model under null hypothesis and provides the p-value and degrees of freedom of the test statistic.

Usage

FStat(model1, model2)

Arguments

model1

First fitted model

model2

Second fitted model

Value

References

Examples

data1 <- data.frame(cbind(sg = c(rep(1, 95), rep(0, 5), rep(1, 87), rep(0, 13),
rep(1, 80), rep(0, 20), rep(1, 59), rep(0, 41),
rep(1, 50), rep(0, 50), rep(1, 79), rep(0, 21),
rep(1, 69), rep(0, 31), rep(1, 72), rep(0, 28),
rep(1, 44), rep(0, 56), rep(1, 14), rep(0, 86)),
v1 = c(rep(1, 500), rep(0, 500)),
v2 = c(rep(0, 500), rep(1, 500)),
wp1 = c(rep(0, 100), rep(-0.3, 100), rep(-0.6, 100),
       rep(-0.9, 100), rep(-1.2, 100), rep(0, 500)),
wp2 = c(rep(0, 600), rep(-0.3, 100), rep(-0.6, 100),
       rep(-0.9, 100), rep(-1.2, 100))))
data2 <- data.frame(cbind(sg = c(rep(1, 95), rep(0, 5), rep(1, 87), rep(0, 13),
rep(1, 80), rep(0, 20), rep(1, 59), rep(0, 41),
rep(1, 50), rep(0, 50), rep(1, 79), rep(0, 21),
rep(1, 69), rep(0, 31), rep(1, 72), rep(0, 28),
rep(1, 44), rep(0, 56), rep(1, 14), rep(0, 86)),
v1 = c(rep(1, 500), rep(0, 500)),
v2 = c(rep(0, 500), rep(1, 500)),
wp = c(rep(0, 100), rep(-0.3, 100), rep(-0.6, 100),
      rep(-0.9, 100), rep(-1.2, 100), rep(0, 100),
      rep(-0.3, 100), rep(-0.6, 100), rep(-0.9, 100),
      rep(-1.2, 100))))
myprobit1 <- glm(sg ~ v1 + v2 + wp1 + wp2 - 1, data = data1, family = binomial(link = probit))
myprobit2 <- glm(sg ~ v1 + v2 + wp - 1, data = data2,
family = binomial(link = probit))
my.f<- FStat(myprobit1, myprobit2)

[Package HTSeedGLM version 0.1.0 Index]