Computes the Unequal Weighting Effect for the current and initial weights of a design object.

UWE(design, by = NULL)

Arguments

design

Object of class analytic (or inheriting from it).

by

Formula specifying variables that define "estimation domains". If NULL (the default option) the UWE refer to the whole sample.

Details

Function UWE computes the Unequal Weighting Effect for the current (w) and initial (w0) weights of a design object, plus the corresponding variance inflation (or deflation) factor (UWE(w) / UWE(w0)) induced by changing the weights from w0 to w (w0 -> w).

Following Kish's definition [Kish 92], the UWE is calculated as 1 plus the relative sample variance of the weights: UWE(w) = 1 + RelVar(w).

The current weights, w, of design are the weights that would be returned by weights(design) and would be used for estimation purposes by functions svystatTM, svystatR, etc.

The initial weights, w0, of design depend on the nature of object design:

  • If design is the outcome of a ‘weight-changing pipeline’, w0 -> w1 -> ... -> w, i.e. it was obtained by the application of an arbitrary chain of ReGenesees functions that modify the weights (e.g. smooth.strat.jump, e.calibrate, ext.calibrated, trimcal, ...), then the initial weights, w0, are the weights of the starting design object in the pipeline.

  • If design is an initial design object generated by function e.svydesign, then the initial weights, w0, are taken as equal to current weights, w0 = w.

Note that, when design is the outcome of a ‘weight-changing pipeline’, function UWE provides a measure of the overall, cumulative impact of all the adjustments the weights underwent throughout the pipeline.

To assess the effect, in terms of UWE and variance inflation, of just a single processing step of the pipeline, you can call function UWE on the input and output designs of that step and compare the results (basically, by taking suitable ratios).

Value

A data.frame, with one single row (if by = NULL) or one row for each domain (if by is passed), and the following columns:

  Column        Meaning
  UWE.curr......Current Unequal Weighting Effect
  UWE.ini.......Initial Unequal Weighting Effect
  VAR.infl......Variance Inflation Factor ( UWE.curr / UWE.ini )

Methodological Remark

Kish's UWE is a model-based tool that can be useful for diagnostic purposes. However, its values must be interpreted with some caution, exactly as it is necessary to do for model-based estimates of Kish's Deff.

In particular, UWE is - by construction - only sensitive to variations of the sample variance of the weights. Therefore, it is unable to discriminate weight adjustments which, despite adding variability to the weights at sample level, might result in reductions of the sampling variance for some estimators. This is often the case of calibration, which may well make survey weights more unequal, but nonetheless cause their reciprocals to become more correlated to some interest variables. Similar considerations hold for stratified sampling, to the extent that, with respect to the interest variables, units tend to be more similar within strata than between strata.

In any case, the UWE can turn out handy when comparing the potential outcomes of performing the same kind of weight adjustment under slightly different settings (e.g. calibration with different bounds or distance functions, trimming with different thresholds, etc.).

References

Kish, L. (1992). Weighting for unequal Pi. Journal of Official Statistics, 8, 183-200.

See also

ReGenesees functions which define survey weights (e.svydesign), or modify survey weights (e.g. smooth.strat.jump, e.calibrate, ext.calibrated, trimcal, ...).

Examples

############################################### # Compute the UWE along the following example # # of weight-changing pipeline: # # 1) Smooth for stratum jumpers # # 2) Adjust for nonresponse # # 3) Calibrate to known population totals # # 4) Consistently trim calibration weights # # # # NOTE: To perform 1) and 2) I will first # # A) simulate some stratum jumpers. # # B) simulate some nonresponse. # ############################################### ## Load sbs data: data(sbs) ## -- A) Simulate stratum jumpers # Create the strata variable observed at survey time by cloning the # strata variable at sampling time sbs$curr.strata <- sbs$strata # Now inject some (say ~250) random stratum jumpers set.seed(12345) # (fix the RNG seed for reproducibility) sbs$curr.strata[sample(1:nrow(sbs), 250)] <- sbs$curr.strata[sample(1:nrow(sbs), 250)] # Resulting number of stratum jumpers: tt <- table(sbs$strata, sbs$curr.strata) sum(tt[row(tt) != col(tt)])
#> [1] 248
## -- B) Simulate nonresponse # Assume a response propensity that increases with enterprise size (as # measured by number of employees) levels(sbs$emp.cl)
#> [1] "[6,9]" "(9,19]" "(19,49]" "(49,99]" "(99,Inf]"
p.resp <- c(.4, .6, .8, .95, .99) # Tie response probabilities to sample observations: pr <- p.resp[unclass(sbs$emp.cl)] # Now, randomly select a subsample of responding units from sbs: set.seed(12345) # (fix the RNG seed for reproducibility) rand <- runif(1:nrow(sbs)) sbs.r <- sbs[rand < pr, ] # This implies an overall response rate of about 73%: nrow(sbs.r) / nrow(sbs)
#> [1] 0.7261543
## -- 0) Create the respondent design object # NOTE: I'll keep using the original fpc column for the sake of the examples, # but they should be recomputed in real applications... sbsdes<-e.svydesign(data=sbs.r,ids=~id,strata=~strata,weights=~weight,fpc=~fpc)
#> #> # Empty levels found in factors: nace5, dom1, strata, curr.strata #> # Empty levels have been dropped! #>
## -- 1) Smooth for stratum jumpers # Use method 'MinChange' sbssmooth <- smooth.strat.jump(sbsdes, ~curr.strata)
#> Warning: Design strata and current strata factors have different levels. Please double-check! #> #> # Unmatched design strata found (4): Center.64.(99,Inf].1, North.27.(19,49].0, North.90.[6,9].0, South.80.(9,19].0 #> #> # Unmatched current strata found (4): Center.35.[6,9].0, Center.71.[6,9].0, South.29.(9,19].0, South.71.[6,9].0
#> #> # Found 189 stratum jumpers (out of 5017 units), see strat.jump.status #>
# Have a look sbssmooth
#> Stratified Independent Unit Sampling Design #> - [606] strata #> - [5017] units #> #> Call: #> smooth.strat.jump(sbsdes, ~curr.strata)
## -- 2) Adjust for nonresponse # Use a simple Response Homogeneity Model approach, with size classes # as RHGs. Perform the RHG weight adjustment via calibration # Compute enterprise counts by size classes from the frame N.RHG <- pop.template(sbssmooth, calmodel= ~emp.cl - 1) N.RHG <- fill.template(sbs.frame, N.RHG)
#> #> # Coherence check between 'universe' and 'template': OK #>
# Calibrate to achieve the RHG adjustment sbsRHG <- e.calibrate(sbssmooth, N.RHG) # Have a look sbsRHG
#> Calibrated, Stratified Independent Unit Sampling Design #> - [606] strata #> - [5017] units #> #> Call: #> 2: e.calibrate(sbssmooth, N.RHG) #> 1: smooth.strat.jump(sbsdes, ~curr.strata)
# -- 3) Calibrate to known population totals # Now calibrate again in order to reduce estimators variance, by using further # available auxiliary information, e.g. the total number of employees (emp.num) # and enterprises (ent) inside the domains obtained by crossing nace.macro # and region: pop <- pop.template(sbsRHG, calmodel = ~emp.num + ent-1, partition = ~nace.macro:region) pop <- fill.template(sbs.frame, pop)
#> #> # Coherence check between 'universe' and 'template': OK #>
# Calibrate to improve estimation efficiency sbscal <- e.calibrate(sbsRHG, pop) # Have a look sbscal
#> Calibrated, Stratified Independent Unit Sampling Design #> - [606] strata #> - [5017] units #> #> Call: #> 3: e.calibrate(sbsRHG, pop) #> 2: e.calibrate(sbssmooth, N.RHG) #> 1: smooth.strat.jump(sbsdes, ~curr.strata)
# -- 4) Consistently trim calibration weights # Say one wants to avoid weights that are less then 1 and above 50: sbstrim <- trimcal(sbscal, c(1, 50)) # Have a look sbstrim
#> Calibrated, Stratified Independent Unit Sampling Design #> - [606] strata #> - [5017] units #> #> Call: #> 4: trimcal(sbscal, c(1, 50)) #> 3: e.calibrate(sbsRHG, pop) #> 2: e.calibrate(sbssmooth, N.RHG) #> 1: smooth.strat.jump(sbsdes, ~curr.strata)
## -- UWE calculation along the weights-changing pipeline # Object sbstrim is the output of the weights-changing pipeline, as # one easily recognizes when printing it: sbstrim
#> Calibrated, Stratified Independent Unit Sampling Design #> - [606] strata #> - [5017] units #> #> Call: #> 4: trimcal(sbscal, c(1, 50)) #> 3: e.calibrate(sbsRHG, pop) #> 2: e.calibrate(sbssmooth, N.RHG) #> 1: smooth.strat.jump(sbsdes, ~curr.strata)
# UWE of initial object UWE(sbsdes)
#> UWE.curr UWE.ini VAR.infl #> ALL 2.016643 2.016643 1
# UWE at step 1), i.e. smoothing for stratum jumpers UWE(sbssmooth)
#> UWE.curr UWE.ini VAR.infl #> ALL 2.002557 2.016643 0.9930147
# UWE of step 2), i.e. nonresponse RHG adjustment UWE(sbsRHG)
#> UWE.curr UWE.ini VAR.infl #> ALL 2.752344 2.016643 1.364814
# UWE at step 3), i.e. calibration for efficiency improvement UWE(sbscal)
#> UWE.curr UWE.ini VAR.infl #> ALL 2.769764 2.016643 1.373452
# UWE at step 4), i.e. consistent trimming of calibration weights UWE(sbstrim)
#> UWE.curr UWE.ini VAR.infl #> ALL 2.765735 2.016643 1.371455
# End