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: gplm
See also: gplmbilo gplmbilobiased gplmbilotest glmbilo

Macro: gplmbilobootstraptest
Description: Bootstrap test (using as. normality) GLM (logit) vs. GPLM (logit) -- by default gplmnoidtest tests the generalized "truly" linear model E[y|x,t] = G(x*b + t*g + c) versus the genralized partially linear model E[y|x,t] = G(x*b + m(t)), where G is the logistic link function. Optional, an alternative design matrix can be specified for t or parametric estimates for b and m can be given directly.

Reference(s):

Link:
Usage: myfit = gplmbilobootstraptest(x,t,y,h,nboot{,opt})
Input:
x n x p matrix, the discrete predictor variables.
t n x q matrix, the continuous predictor variables.
y n x 1 vector, the response variables.
h q x 1 vector, the bandwidth.
nboot scalar, number of bootstrap replications !! be careful if you computer is slow !!
opt optional, a list with optional input. The macro "gplmopt" can be used to set up this parameter. The order of the list elements is not important. Parameters which are not given are replaced by defaults (see below).
opt.wt n x 1 vector, weights for t (trimming factors). If not given, all set to 1.
opt.tdesign n x r matrix, design for parametric fit for m(t). If not given a "truly" linear function will be tested by using the design matrix(n)~t.
opt.tg ng x 1 vector, a grid for continuous part. If tg is given, the nonparametric function will also be computed on this grid.
opt.shf integer, if exists and =1, some output is produced which indicates how the iteration is going on.
opt.nosort integer, if exists and =1, the continuous variables t and the grid tg are assumed to be sorted by the 1st column. Sorting is required by the algorithm, hence you should switch if off only when the data are already sorted.
opt.noinit integer, if exists and =1, the estimation of the partial linear model is not initialized by the parametric fit.
opt.miter integer, maximal number of iterations. The default is 10.
opt.cnv integer, convergence criterion. The default is 0.0001.
opt.wtc n x 1 vector, weights for convergence criterion, w.r.t. m(t) only. If not given, opt.wt is used.
Output:
myfit.b k x 1 vector, estimated coefficients
myfit.bv k x k matrix, estimated covariance matrix for b
myfit.m n x 1 vector, estimated nonparametric part
myfit.mg ngx 1 vector, estimated nonparametric part on grid
myfit.rr 3 x 1 vector, 3 test statistics, see Haerdle/Mammen/Mueller
myfit.alpha 3 x 1 vector, significance level for rejection of the parametric hypothesis (for each of the the three test statisctics).
myfit.stat list with the following statistics:
myfit.stat.deviance deviance,
myfit.stat.pearson generalized pearson's chi^2,
myfit.stat.loglik log-likelihood,
myfit.stat.r2 pseudo R^2,
myfit.stat.it 2 x 1 vector, number of iterations needed in semiparametric and biased parametric fit

Note:

Example:
library("gplm")
;=============================
;  simulate data 
;=============================
n=100
b=1|2
p=rows(b)
x=2.*uniform(n,p)-1
t=sort(2.*uniform(n)-1,1)
m=cos(pi.*t)
y=( 1./(1+exp(-x*b-m)).>uniform(n) )
;=============================
;  parametric (logit) fit 
;=============================
pf=glmbilo(x~t~matrix(n),y)
b0  =pf.b[1:p]
gamma0=pf.b[p+1:rows(pf.b)]
m0  =(t~matrix(n))*gamma0
;=============================
;  semiparametric fit & test
;=============================
h=0.6
opt=list(b0,m0)
sf=gplmbilobootstraptest(x,t,y,h,10,opt)
b~b0~sf.b
pic=createdisplay(1,1)
show(pic,1,1,t~m,t~m0,t~sf.m)
sf.alpha
Result:
A generalized partially linear logit fit for E[y|x,t] is 
computed and tested against the parametric logit. 
sf.b contains the coefficients for the linear 
part. sf.m contains the estimated nonparametric part 
evaluated at observations t. The example gives the true 
b together with the logit estimate b0 and the GPLM 
estimate sf.b. Also the estimated function sf.m is  
displayed together with the true and the linear fit. 
sf.del contains the test results for the 3 test statistics 
proposed in Haerdle/Mammen/Mueller (1996). 

Library: gplm
See also: gplmbilo gplmbilobiased gplmbilotest glmbilo

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: Marlene Mueller, 970915
(C) MD*TECH Method and Data Technologies, 28.6.1999