check.cal: Calibration Convergence Check

check.calR Documentation

Calibration Convergence Check

Description

Checks whether Calibration Constraints are fulfilled; if not, assesses constraints violation degree.

Usage

check.cal(cal.design)

Arguments

cal.design

Object of class cal.analytic.

Details

The function verifies if all the imposed Calibration Constraints are actually fulfilled by object cal.design. If it is not the case, the function evaluates the degree of violation of the constraints and prints a summary of the mismatches between population totals and achieved estimates (see also Section 'Calibration process diagnostics' in the help page of e.calibrate).

Value

The main purpose of the function is to print on screen; anyway a list is invisibly returned, which summarizes the results of the check.

Author(s)

Diego Zardetto

See Also

e.calibrate for calibrating weights (in particular, Section 'Calibration process diagnostics').

Examples

# Load sbs data:
data(sbs)

# Build a design object:
sbsdes<-e.svydesign(data=sbs,ids=~id,strata=~strata,weights=~weight,fpc=~fpc)

## Example 1
 # Build template...
   pop<-pop.template(sbsdes,~emp.num:emp.cl+ent-1,~region)
 # Fill template...
   pop<-fill.template(sbs.frame,pop)
 # Calibrate...
   sbscal<-e.calibrate(sbsdes,pop,sigma2=~emp.num)
 # Check calibration... 
   check.cal(sbscal)

## Example 2
 # Build template...
   pop<-pop.template(sbsdes,~emp.num+ent-1,~area)
 # Fill template...
   pop<-fill.template(sbs.frame,pop)
 # Calibrate with tight bounds...
   sbscal<-e.calibrate(sbsdes,pop,sigma2=~emp.num,bounds=c(0.8,1.2))
 # Check calibration... 
   check.cal(sbscal)
 
 # Now try to calibrate with suggested bounds... 
   hint <- bounds.hint(sbsdes,pop)
   sbscal<-e.calibrate(sbsdes,pop,sigma2=~emp.num,bounds=hint)
 # Check calibration... 
   check.cal(sbscal)

DiegoZardetto/ReGenesees documentation built on Dec. 16, 2024, 2:03 p.m.