Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: metrics
See also: hhmult glmest sker

Macro: hhtest
Description: hhtest calculates the H-H statistic to test the specifi- cation of the link function of a generalized linear model (such as the logit or probit model), assuming the index is correctly specified.

Reference(s):

Usage: {t,p} = hhtest(vhat,y,yhat,h,{c,{m}})
Input:
vhat n x 1 matrix with the projected index
y n x 1 matrix
yhat n x 1 matrix with the parametric estimate of E(Y|X)
h scalar (positive) -- the bandwidth for kernel regression with Quartic kernel
c scalar 0 =< c < 1 (optional) -- proportion of the sample to be cut in each extreme. Default is 0.05.
m n x 1 or the scalar 1. m should be given only for binary responses. If the data is binomial m is the vector with the binomial coeficients. If the data is bernouli, m=1. m is necessary to calculate the vari- ance of y. If y is not binary the variance will be given by a nonparametric regression of (y-fhat)^2 on vhat.
Output:
t scalar -- the statistic value
p scalar -- the p-value of t

Example:
library("glm")                                              
x = read("kyphosis.dat")                                        
y = x[,4]                                                 
x = x[,1:3]                                               
x = matrix(rows(x))~x                                     
h = 2                                                     
{b,bv,mu,h,w,stat,it} = glmbilo(x,y)   
library("sim")                                           
library("smoother")                                         
{t,p} = hhtest(eta,y,mu,h,0.05,1)           
t~p
Result:
test statistic, t, and p-value, p.

Library: metrics
See also: hhmult glmest sker

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: Axel Werwatz,960326, based on code written by Isabel Proenca, 940724 proportion to cut off in each side of the sample cut off the extreme values conditional variance of Y H-H test statistic variance of t
(C) MD*TECH Method and Data Technologies, 28.6.1999