mdscore: Modified score test for generalized linear models

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/mdscore.r

Description

Computes the modified score test based for the coefficients of a generalized linear model.

Usage

1
mdscore(model = model, X1 = X1, phi = NULL)

Arguments

model

an object that stores the results of glm fit of the model under the null hypothesis.

X1

the matrix with the columns of the model matrix X that correspond to the coefficients being specified in the null hypothesis.

phi

the precision parameter.

Details

The object fit.model is obtained using the usual options passed to the glm function.

Value

The function mdscore() returns the following list of values:

Sr

the value of the score statistic.

Srcor

the value of the modified score statistic.

coef

a vector with the coefficients A1 , A2 and A3.

n

the total sample size.

df

the number of degrees of freedom of the chi–squared approximations for the tests.

phi

the precision parameter used in the computations

Author(s)

Antonio Hermes M. da Silva-Junior hermes@ccet.ufrn.br

Damiao N. da Silva damiao@ccet.ufrn.br

References

Cordeiro GM, Ferrari SLP (1991). A Modified Score Test Statistic Having chi-squared Distribution to Order n–1 . Biometrika, 78(3), 573–582.

Cordeiro GM, Ferrari SLP, Paula GA (1993). Improved Score Tests for Generalized Linear Models. Journal of the Royal Statistical Society B, 55(3), 661–674.

Cribari-Neto F, Ferrari SLP (1995). Second Order Asymptotics for Score Tests in Generalised Linear Models. Biometrika, 82(2), 426–432.

da Silva-Junior AHM, da Silva DN, Ferrari SLP (2014). mdscore: An R Package to Compute Improved Score Tests in Generalized Linear Models. Journal of Statistical Software, 61(2), 1-16., http://www.jstatsoft.org/v61/c02/

See Also

summary.mdscore

Examples

1
2
3
4
5
6
data(strength)
fitf <- glm(y ~ cut * lot, data = strength,family = inverse.gaussian("inverse"))
summary(fitf)
X <- model.matrix(fitf, data = strength)
fit0 <- glm(y ~ cut + lot, data = strength, family = inverse.gaussian("inverse"))
mdscore(fit0, X1=X[, 7:10])

Example output

Loading required package: MASS

Call:
glm(formula = y ~ cut * lot, family = inverse.gaussian("inverse"), 
    data = strength)

Deviance Residuals: 
      Min         1Q     Median         3Q        Max  
-0.236043  -0.101266   0.006794   0.091202   0.237815  

Coefficients:
                      Estimate Std. Error t value Pr(>|t|)    
(Intercept)            1.01695    0.08446  12.041 1.28e-10 ***
cut Crosswise          0.32834    0.12873   2.551   0.0190 *  
lot II                 0.03200    0.12038   0.266   0.7931    
lot III                0.35920    0.12956   2.772   0.0118 *  
lot IV                 0.14135    0.12353   1.144   0.2660    
lot V                  0.82354    0.14158   5.817 1.08e-05 ***
cut Crosswise:lot II  -0.40642    0.17532  -2.318   0.0312 *  
cut Crosswise:lot III -0.10874    0.19343  -0.562   0.5802    
cut Crosswise:lot IV  -0.35028    0.18074  -1.938   0.0669 .  
cut Crosswise:lot V   -0.19515    0.20815  -0.938   0.3597    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for inverse.gaussian family taken to be 0.02104379)

    Null deviance: 2.62972  on 29  degrees of freedom
Residual deviance: 0.42546  on 20  degrees of freedom
AIC: -45.157

Number of Fisher Scoring iterations: 2

$Sr
[1] 7.688879

$Sr_cor
[1] 6.417879

$coef
[1] -2.280698e-07 -1.764864e-02  3.010155e-01

$n
[1] 30

$df
[1] 4

$phi
[1] 52.32249

attr(,"class")
[1] "mdscore"

mdscore documentation built on May 2, 2019, 1:26 p.m.

Related to mdscore in mdscore...