| make.calfun {survey} | R Documentation |
make.calfun() creates objects representing distance functions for
calibration of weights. Three such functions are pre-defined.
make.calfun(Fm1, dF, name) cal.linear(u, bounds) cal.raking(u, bounds) cal.logit(u, bounds)
Fm1 |
Link function minus 1 for calibration factors, function of two
arguments: u and bounds |
dF |
Derivative of Fm1 with respect to u |
name |
Character string giving a name for the object |
u |
Linear predictor |
bounds |
c(lower,upper) bounds for calibration factors |
For make.calfun, an object of class calfun.
The link function F is the same as F in Table 1 of Deville and Sarndal (1992)
Deville J-C, Sarndal C-E. (1992) Calibration Estimators in Survey Sampling. JASA 87:376-382
hellinger<-make.calfun(function(u, bounds) ((1-u/2)^-2)-1,
function(u, bounds) (1-u/2)^{-3},
"hellinger distance")
hellinger
data(api)
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
svymean(~api00,calibrate(dclus1, ~api99, pop=c(6194, 3914069),calfun=hellinger))
svymean(~api00,calibrate(dclus1, ~api99, pop=c(6194, 3914069),calfun=cal.linear))
svymean(~api00,calibrate(dclus1, ~api99, pop=c(6194, 3914069),calfun=cal.raking))