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: gam
See also: intest intest2d interact intertest1

Quantlet: intertest2
Description: intertest2 is testing for interaction of x_1 and x_2 in an additive regression model. It is looking at the estimate of the mixed derivative of the joint influence and using wild bootstrap. For details see Sperlich, Tjostheim, Yang (1997)

Usage: testt = intertest2(t,y,h,g{,opt{,file}})
Input:
t n x p matrix , the observed explanatory variable where the directions of interest have to be the first and second column
y n x 1 vector , the observed response variables
h 2 x 1 or 1 x 1 matrix , chosen bandwidth for the directions of interest in the estimation step
g p x 1 or 1 x 1 matrix , chosen bandwidth for the directions not of interest in the estimation step
opt.hyp pp x 2 matrix, in the rows have to be all pairs of indices for interactions which shall be included in the hypothesis model. Thus (1,2) must not be a row of hyp.
opt.boot integer, number of bootstrap replications, default=249.
opt.hb scalar, bandwidth multiplicator for the bootstrap step. When the test statistics are calculated with estimating the derivative we take bandwidths h*hb and g*hb instead of h, g. Default is 1.
opt.weight n x 1 vector, weights for the test statistics. Default is weight 1 for all.
opt.loc integer from {1,2}, degree for the local polynomial smoother, default is linear (loc=1)
file string, file name of output, if an output of the function estimates is wished
Output:
testt string object, a table of results

Example:
library("gam")
randomize(12345)
n     = 50
t     = uniform(n,3)*2-1
g1    = 2*t[,1]
g2    = t[,2]^2 - mean(t[,2]^2)
g3    = sin(3*t[,3])
g12   = t[,1].*t[,2]
y     = g1+g2+g3+g12+normal(n)*sqrt(0.5)
h     = #(1.1,1.0,0.9)
g     = #(1.2,1.2,1.1)
boot  = 99
hb    = 1.5
weight= matrix(n)-prod((abs(t[,1:2]).>0.85),2)
opt   = list(boot,hb,weight)
intertest2(t,y,h,g,opt)

Result:
table of test results



Author: S. Sperlich, 19970724
(C) MD*TECH Method and Data Technologies, 05.02.2006