Download presentation
Presentation is loading. Please wait.
Published byFay Clarke Modified over 8 years ago
1
Øyvind Langsrud New Challenges for Statistical Software - The Use of R in Official Statistics, Bucharest, Romania, 7-8 April 1 A variance estimation R package for repeated surveys - useful for estimates of changes in quarterly and annual averages
2
A variance estimation R package for repeated surveys 2 Weights by calibration Estimate covariance matrix for totals Find variances of ratios and linear combinations 1 2 3 4
3
A variance estimation R package for repeated surveys 3 Weights by calibration Estimate covariance matrix for totals Find variances of ratios and linear combinations 1 2 3 4
4
4 Variances on diagonal Covariances elsewhere 2011q1 2011q2 2011q3 2011q4 2012q1 2012q2 2012q3 2012q4 2011q1 16016683 4434728 2153165 1743220 1151412 895422 348257 142263 2011q2 4434728 17743477 3813178 1903999 1665130 1083657 547785 477735 2011q3 2153165 3813178 17085230 3179624 1590989 1285424 864862 538400 2011q4 1743220 1903999 3179624 17219558 3768971 2343794 1198002 1105104 2012q1 1151412 1665130 1590989 3768971 18006351 3684143 2054219 2129302 2012q2 895422 1083657 1285424 2343794 3684143 18404190 2986331 2485754 2012q3 348257 547785 864862 1198002 2054219 2986331 18223209 4230313 2012q4 142263 477735 538400 1105104 2129302 2485754 4230313 19948113 2011q1 83610 2011q2 93175 2011q3 85678 2011q4 80530 2012q1 85482 2012q2 87805 2012q3 84341 2012q4 85340 Estimates with covariance matrix - Number of unemployed in Norway
5
Linear combinations and ratios Means, differences, differences between means, ratios, means of ratios … 5 Step 1: Establish a covariance matrix for all the original variables Total number of variables = Number of waves × Number of variables within each wave Step 2: Calculate variances of linear combinations and ratios by the general rule Ratios handled by linearization
6
Linear combinations - Yearly averages of number of unemployed 6 0.25 0.25 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.25 0.25 2011 85748 2012 85742 2011 2012 2011 6407548 1187950 2012 1187950 6857624
7
Quarter to quarter change 7 -1 1 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 -1 1 …..
8
Change from same quarter last year 8 -1 0 0 0 1 0 0 0 0 -1 0 0 0 1 0 0 0 0 -1 0 0 0 1 0 0 0 0 -1 0 0 0 1 …..
9
Difference between yearly averages 9 -0.25 -0.25 -0.25 -0.25 0.25 0.25 0.25 0.25 …..
10
Means instead of totals – diagonal matrix 10 2.734e-07 0 0 0 0 0 0 0 0 2.726e-07 0 0 0 0 0 0 0 0 2.716e-07 0 0 0 0 0 0 0 0 2.704e-07 0 0 0 0 0 0 0 0 2.695e-07 0 0 0 0 0 0 0 0 2.685e-07 0 0 0 0 0 0 0 0 2.675e-07 0 0 0 0 0 0 0 0 2.663e-07 …..
11
Ratios 11 Handled by linearization Taylor/Delta Similar to linear combination An “M-matrix” solves the problem
12
A variance estimation R package for repeated surveys 12 Weights by calibration Estimate covariance matrix for totals Find variances of ratios and linear combinations 1 2 3 4
13
Same weights for all Y-variables Classical covariance matrix estimation 13 Vector of estimated totals Covariance matrix estimate Matrix of several y variables Vector of weights Matrix of residuals from regression modelling Vector of ones
14
Different weights (rotating panel data) Robust/empirical/sandwich covariance 14 Vector of estimated totals Covariance matrix estimate Element-wise multiplication Matrix with of several y variables, but some elements are missing (set to zero) Matrix of weights. Some is set to zero. Matrix of residuals. Some is set to zero. (Negligible) component so that the expression generalizes “w(w-1)” instead of “(w-1) 2 ” Matrix of ones
15
Adjusted residuals 15 Unbiased under model Robust to model misspecification
16
Cluster-robust estimation 16 Two independent residuals When independence cannot be assumed Cluster-robust alternative to Matrix with fewer rows Rows summed within clusters
17
A design based covariance matrix 17 Element- wise division Matrix of ones Row vector of mean weighted residuals Matrix with ordinary sample sizes on the diagonal and otherwise sample sizes of overlaps Hamre and Heldal (2013) Hagesæther and Zhang (2007)
18
A variance estimation R package for repeated surveys 18 Weights by calibration Estimate covariance matrix for totals Find variances of ratios and linear combinations 1 2 3 4
19
Weights by calibration within each wave - all population totals known 19 Calibration as a model based regression technique Can be generalized to weighted regression w = Ordinary linearly calibrated weights Residuals calculated from this model
20
Weights by calibration within each wave - some population totals unknown 20 Can be generalized to weighted regression Estimated population totals used Similar to Särndal and Lundström (2005) Two types of residuals Model using all x-variables Model using only x-variables with available population totals
21
Covariance matrix when unknown population totals 21 Step 1: Calculate as usual by using residuals from modeling using only x-variables with available population totals Step 2: Adjust by utilizing some of the methodology in Särndal and Lundström (2005) Then both types of residuals are used
22
A variance estimation R package for repeated surveys 22 Weights by calibration Estimate covariance matrix for totals Find variances of ratios and linear combinations 1 2 3 4
23
R-Package ‘CalibrateSSB’ 23
24
R-Package ‘CalibrateSSB’ Three main functions 24 1. CalibrateSSB Computes weights, residuals and leverages “ReGenesees” or “survey” can be used 2. WideFromCalibrate Reorganize all data into matrices with waves as columns Split into sub datasets (estimation domains) 3. PanelEstimation Covariance matrix is calculated as specified Estimates of linear combinations and ratios with variances
25
25
26
26
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.