Computes the variance estimation for measures of annual net change for single and multistage stage cluster sampling designs.

1 2 3 4 5 6 7 8 9 10 11 | ```
vardchangannual(Y, H, PSU, w_final,
ID_level1, ID_level2,
Dom = NULL, Z = NULL,
country = NULL, years,
subperiods, dataset = NULL,
year1, year2, X = NULL,
countryX = NULL, yearsX = NULL,
subperiodsX = NULL, X_ID_level1 = NULL,
ind_gr = NULL, g = NULL, q = NULL,
datasetX = NULL, percentratio = 1,
use.estVar = FALSE, confidence = 0.95)
``` |

`Y` |
Variables of interest. Object convertible to |

`H` |
The unit stratum variable. One dimensional object convertible to one-column |

`PSU` |
Primary sampling unit variable. One dimensional object convertible to one-column |

`w_final` |
Weight variable. One dimensional object convertible to one-column |

`ID_level1` |
Variable for level1 ID codes. One dimensional object convertible to one-column |

`ID_level2` |
Optional variable for unit ID codes. One dimensional object convertible to one-column |

`Dom` |
Optional variables used to define population domains. If supplied, variables are calculated for each domain. An object convertible to |

`Z` |
Optional variables of denominator for ratio estimation. If supplied, the ratio estimation is computed. Object convertible to |

`country` |
Variable for the survey countries. The values for each country are computed independently. Object convertible to |

`years` |
Variable for the all survey years. The values for each year are computed independently. Object convertible to |

`subperiods` |
Variable for the all survey subperiods. The values for each subperiod are computed independently. Object convertible to |

`dataset` |
Optional survey data object convertible to |

`year1` |
The vector of years from variable |

`year2` |
The vector of years from variable |

`X` |
Optional matrix of the auxiliary variables for the calibration estimator. Object convertible to |

`countryX` |
Optional variable for the survey countries. The values for each country are computed independently. Object convertible to |

`yearsX` |
Variable of the all survey years. If supplied, residual estimation of calibration is done independently for each time period. Object convertible to |

`subperiodsX` |
Variable for the all survey subperiods. If supplied, residual estimation of calibration is done independently for each time period. Object convertible to |

`X_ID_level1` |
Variable for level1 ID codes. One dimensional object convertible to one-column |

`ind_gr` |
Optional variable by which divided independently X matrix of the auxiliary variables for the calibration. One dimensional object convertible to one-column |

`g` |
Optional variable of the g weights. One dimensional object convertible to one-column |

`q` |
Variable of the positive values accounting for heteroscedasticity. One dimensional object convertible to one-column |

`datasetX` |
Optional survey data object in household level convertible to |

`percentratio` |
Positive numeric value. All linearized variables are multiplied with |

`use.estVar` |
Logical value. If value is |

`confidence` |
optional; either a positive value for confidence interval. This variable by default is 0.95 . |

A list with objects are returned by the function:

`crossectional_results` |
A |

`crossectional_var_grad` |
A |

`vardchanges_grad_var` |
A |

`vardchanges_rho` |
A |

`vardchanges_var_tau` |
A |

`vardchanges_results` |
A |

`X_annual` |
A |

`A_matrix` |
A |

`annual_sum` |
A |

`annual_changes` |
A |

Guillaume OSIER, Virginie RAYMOND, (2015), Development of methodology for the estimate of variance of annual net changes for LFS-based indicators. Deliverable 1 - Short document with derivation of the methodology.

Guillaume Osier, Yves Berger, Tim Goedeme, (2013), Standard error estimation for the EU-SILC indicators of poverty and social exclusion, Eurostat Methodologies and Working papers, URL http://ec.europa.eu/eurostat/documents/3888793/5855973/KS-RA-13-024-EN.PDF.

Eurostat Methodologies and Working papers, Handbook on precision requirements and variance estimation for ESS household surveys, 2013, URL http://ec.europa.eu/eurostat/documents/3859598/5927001/KS-RA-13-029-EN.PDF.

Yves G. Berger, Tim Goedeme, Guillame Osier (2013). Handbook on standard error estimation and other related sampling issues in EU-SILC,
URL https://ec.europa.eu/eurostat/cros/content/handbook-standard-error-estimation-and-other-related-sampling-issues-ver-29072013_en

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ```
### Example
data("eusilc")
set.seed(1)
eusilc1 <- eusilc[1 : 100,]
set.seed(1)
data <- data.table(rbind(eusilc1, eusilc1),
year = c(rep(2010, nrow(eusilc1)),
rep(2011, nrow(eusilc1))))
data[, country := "AT"]
data[, quarter:= .I - 4 * trunc((.I - 1) / 4)]
data[age < 0, age:= 0]
PSU <- data[, .N, keyby = "db030"][, N:= NULL]
PSU[, PSU:= trunc(runif(nrow(PSU), 0, 5))]
data <- merge(data, PSU, all = TRUE, by = "db030")
PSU <- eusilc <- NULL
data[, strata := c("XXXX")]
data[, employed := trunc(runif(nrow(data), 0, 2))]
data[, unemployed := trunc(runif(nrow(data), 0, 2))]
data[, labour_force := employed + unemployed]
data[, id_lv2 := .I]
result <- vardchangannual(Y = "employed", H = "strata",
PSU = "PSU", w_final = "rb050",
ID_level1 = "db030", ID_level2 = "id_lv2",
Dom = NULL, Z = NULL, country = "country",
years = "year", subperiods = "quarter",
dataset = data, year1 = 2010, year2 = 2011,
percentratio = 100, confidence = 0.95)
## Not run:
result <- vardchangannual(Y = "unemployed", H = "strata",
PSU = "PSU", w_final = "rb050",
ID_level1 = "db030", ID_level1 = "id_lv2",
Dom = NULL, Z = "labour_force",
country = "country", years = "year",
subperiods = "quarter", dataset = data,
year1 = 2010, year2 = 2011,
percentratio = 100, confidence = 0.95)
## End(Not run)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.