Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

checkcalibration

Check calibration


Description

Checks the validity of the calibration. In some cases, the calibration estimators do not exist, and the g-weights do not allow calibration.

Usage

checkcalibration(Xs, d, total, g, EPS=1e-6)

Arguments

Xs

matrix of calibration variables.

d

vector of initial weights.

total

vector of population totals.

g

vector of g-weights.

EPS

the control value used to verify the calibration, by default equal to 1e-6.

Details

In the case where calibration is not possible, the 'value' indicates the difference in obtaining the calibration.

Value

The function returns the following three objects:

message

a message concerning the calibration,

result

TRUE if the calibration is possible and FALSE, otherwise.

value

value of max(abs(tr-total)/total, which is used as criterium to validate the calibration, where tr=crossprod(Xs, g*d). If the vector total contains zeros, the value is max(abs(tr-total)).

See Also

Examples

# matrix of auxiliary variables
Xs=cbind(c(1,1,1,1,1,0,0,0,0,0),c(0,0,0,0,0,1,1,1,1,1),c(1,2,3,4,5,6,7,8,9,10))
# inclusion probabilities
pik=rep(0.2,times=10)
# vector of totals
total=c(24,26,280)
# the g-weights
g=calib(Xs,d=1/pik,total,method="raking")
# the calibration is possible
checkcalibration(Xs,d=1/pik,total,g)

sampling

Survey Sampling

v2.9
GPL (>= 2)
Authors
Yves Till<e9> <yves.tille@unine.ch>, Alina Matei <alina.matei@unine.ch>
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.