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: gplmopt gplmbilo gplmbilotest gplmbilobootstraptest glmbilo

Macro: gplmbilobiased
Description: biased GLM (logit) -- gplmbilobiased computes the biased generalized linear model for the test of a GLM (logit) versus a GPLM (logit).

Reference(s):

Link:
Usage: myfit = gplmbilobiased(x,t,y,h,b,m0{,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. y[i] may have (integer) values between 0 and opt.wx[i] or opt.wx (if opt.wx is scalar).
h q x 1 vector, the bandwith.
b p x 1 vector, coefficients b from parametric fit.
m0 n x 1 vector, parametric estimate for m, to which to add the bias.
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.wx scalar or n x 1 vector, prior weights, usually the binomial index vector. If not given, set to 1.
opt.wt n x 1 vector, weights for t (trimming factors). If not given, all set to 1.
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.m0g ng x 1 vector, parametric estimate for m on grid tg. If not given, this will aproxiammated from m0.
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 this option should be given only when data are sorted.
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.m n x 1 vector, biased version of m0
myfit.mg ng x 1 vector, biased version of m0g
myfit.it number of iterations needed

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 
;==========================
h=0.6
ind0=x*b0+m0
yb=1/(1+exp(-ind0))
bf=gplmbilobiased(x,t,yb,h,b0,m0)
pic=createdisplay(1,1)
show(pic,1,1,t~m,t~m0,t~bf.m)
Result:
A biased logit fit for E[y|x,t] is computed. bf.m contains  
the biased linear fit evaluated at observations t. This is 
needed for the test of a GLM logit vs. a GPLM logit. 
bf.m is displayed together with the true and the linear fit.

Library: gplm
See also: gplmopt gplmbilo gplmbilotest gplmbilobootstraptest 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, 970523
(C) MD*TECH Method and Data Technologies, 28.6.1999