Skip to content

vardpoor

Variance Estimation for Sample Surveys by the Ultimate Cluster Method

v0.21.0 · Jan 29, 2026 · EUPL

Description

Generation of domain variables, linearization of several non-linear population statistics (the ratio of two totals, weighted income percentile, relative median income ratio, at-risk-of-poverty rate, at-risk-of-poverty threshold, Gini coefficient, gender pay gap, the aggregate replacement ratio, the relative median income ratio, median income below at-risk-of-poverty gap, income quintile share ratio, relative median at-risk-of-poverty gap), computation of regression residuals in case of weight calibration, variance estimation of sample surveys by the ultimate cluster method (Hansen, Hurwitz and Madow, Sample Survey Methods And Theory, vol. I: Methods and Applications; vol. II: Theory. 1953, New York: John Wiley and Sons), variance estimation for longitudinal, cross-sectional measures and measures of change for single and multistage stage cluster sampling designs (Berger, Y. G., 2015, <doi:10.1111/rssa.12116>). Several other precision measures are derived - standard error, the coefficient of variation, the margin of error, confidence interval, design effect.

Downloads

828

Last 30 days

4263rd

828

Last 90 days

828

Last year

CRAN Check Status

1 ERROR
2 NOTE
11 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 NOTE
r-oldrel-macos-x86_64 NOTE
r-oldrel-windows-x86_64 ERROR
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (21 non-OK)
OK r-devel-linux-x86_64-debian-clang

*


            
OK r-devel-linux-x86_64-debian-gcc

*


            
OK r-devel-linux-x86_64-fedora-clang

*


            
OK r-devel-linux-x86_64-fedora-gcc

*


            
OK r-devel-macos-arm64

*


            
OK r-devel-windows-x86_64

*


            
NOTE r-oldrel-macos-arm64

LazyData

  'LazyData' is specified without a 'data' directory
NOTE r-oldrel-macos-arm64

Rd files

checkRd: (-1) vardannual.Rd:97: Lost braces
    97 | \item{ID_level2}{Optional}{variable for unit ID codes. One dimensional object convertible to one-column \code{data.table} or variable name as character, column number.}
       |                           ^
checkRd: (-1) vardannual.Rd:99: Lost braces
    99 | \item{dataset}{Optional}{survey data object convertible to \code{data.table}.}
       |                         ^
checkRd: (-1) vardcrospoor.Rd:122: Lost braces
   122 | \item{ind_gr}{Optional}{variable by which divided independently X matrix of the auxiliary variables for the calibration. One dimensional object convertible to one-column \code{data.table} or variable name as character, column number.}
       |                        ^
checkRd: (-1) vardcrospoor.Rd:124: Lost braces
   124 | \item{use.estVar}{Logical}{value. If value is \code{TRUE}, then \code{R} function \code{estVar} is used for the  estimation of covariance matrix of the residuals. If value is \code{FALSE}, then \code{R} function \code{estVar} is not used for the estimation of covariance matrix of the residuals.}
       |                           ^
checkRd: (-1) vardom_othstr.Rd:69: Lost braces
    69 | \item{percentratio}{Positive}{numeric value. All linearized variables are multiplied with \code{percentratio} value, by default - 1.}
       |                              ^
checkRd: (-1) varpoord.Rd:121: Lost braces
   121 | \item{month_at_work}{Variable}{for total number of month at work (sum of the number of months spent at full-time work as employee, number of months spent at part-time work as employee, number of months spent at full-time work as self-employed (including family worker), number of months spent at part-time work as self-employed (including family worker)).  One dimensional object convertible to one-column \code{data.table} or variable name as character, column number.}
       |                               ^
NOTE r-oldrel-macos-arm64

package subdirectories

Problems with news in ‘NEWS.md’:
No news entries found.
NOTE r-oldrel-macos-x86_64

LazyData

  'LazyData' is specified without a 'data' directory
NOTE r-oldrel-macos-x86_64

Rd files

checkRd: (-1) vardannual.Rd:97: Lost braces
    97 | \item{ID_level2}{Optional}{variable for unit ID codes. One dimensional object convertible to one-column \code{data.table} or variable name as character, column number.}
       |                           ^
checkRd: (-1) vardannual.Rd:99: Lost braces
    99 | \item{dataset}{Optional}{survey data object convertible to \code{data.table}.}
       |                         ^
checkRd: (-1) vardcrospoor.Rd:122: Lost braces
   122 | \item{ind_gr}{Optional}{variable by which divided independently X matrix of the auxiliary variables for the calibration. One dimensional object convertible to one-column \code{data.table} or variable name as character, column number.}
       |                        ^
checkRd: (-1) vardcrospoor.Rd:124: Lost braces
   124 | \item{use.estVar}{Logical}{value. If value is \code{TRUE}, then \code{R} function \code{estVar} is used for the  estimation of covariance matrix of the residuals. If value is \code{FALSE}, then \code{R} function \code{estVar} is not used for the estimation of covariance matrix of the residuals.}
       |                           ^
checkRd: (-1) vardom_othstr.Rd:69: Lost braces
    69 | \item{percentratio}{Positive}{numeric value. All linearized variables are multiplied with \code{percentratio} value, by default - 1.}
       |                              ^
checkRd: (-1) varpoord.Rd:121: Lost braces
   121 | \item{month_at_work}{Variable}{for total number of month at work (sum of the number of months spent at full-time work as employee, number of months spent at part-time work as employee, number of months spent at full-time work as self-employed (including family worker), number of months spent at part-time work as self-employed (including family worker)).  One dimensional object convertible to one-column \code{data.table} or variable name as character, column number.}
       |                               ^
NOTE r-oldrel-macos-x86_64

package subdirectories

Problems with news in ‘NEWS.md’:
No news entries found.
NOTE r-oldrel-windows-x86_64

LazyData

  'LazyData' is specified without a 'data' directory
NOTE r-oldrel-windows-x86_64

Rd files

checkRd: (-1) vardannual.Rd:97: Lost braces
    97 | \item{ID_level2}{Optional}{variable for unit ID codes. One dimensional object convertible to one-column \code{data.table} or variable name as character, column number.}
       |                           ^
checkRd: (-1) vardannual.Rd:99: Lost braces
    99 | \item{dataset}{Optional}{survey data object convertible to \code{data.table}.}
       |                         ^
checkRd: (-1) vardcrospoor.Rd:122: Lost braces
   122 | \item{ind_gr}{Optional}{variable by which divided independently X matrix of the auxiliary variables for the calibration. One dimensional object convertible to one-column \code{data.table} or variable name as character, column number.}
       |                        ^
checkRd: (-1) vardcrospoor.Rd:124: Lost braces
   124 | \item{use.estVar}{Logical}{value. If value is \code{TRUE}, then \code{R} function \code{estVar} is used for the  estimation of covariance matrix of the residuals. If value is \code{FALSE}, then \code{R} function \code{estVar} is not used for the estimation of covariance matrix of the residuals.}
       |                           ^
checkRd: (-1) vardom_othstr.Rd:69: Lost braces
    69 | \item{percentratio}{Positive}{numeric value. All linearized variables are multiplied with \code{percentratio} value, by default - 1.}
       |                              ^
checkRd: (-1) varpoord.Rd:121: Lost braces
   121 | \item{month_at_work}{Variable}{for total number of month at work (sum of the number of months spent at full-time work as employee, number of months spent at part-time work as employee, number of months spent at full-time work as self-employed (including family worker), number of months spent at part-time work as self-employed (including family worker)).  One dimensional object convertible to one-column \code{data.table} or variable name as character, column number.}
       |                               ^
ERROR r-oldrel-windows-x86_64

examples

Running examples in 'vardpoor-Ex.R' failed
The error most likely occurred in:

> ### Name: vardannual
> ### Title: Variance estimation for measures of annual net change or annual
> ###   for single and multistage stage cluster sampling designs
> ### Aliases: vardannual
> ### Keywords: vardannual
> 
> ### ** Examples
> 
>  
> ### Example
> library("data.table")
> 
> set.seed(1)
> 
> data("eusilc", package = "laeken")
> eusilc1 <- eusilc[1:20, ]
> rm(eusilc)
> 
> dataset1 <- data.table(rbind(eusilc1, eusilc1),
+                        year = c(rep(2010, nrow(eusilc1)),
+                                 rep(2011, nrow(eusilc1))))
> rm(eusilc1)
> 
> dataset1[, country := "AT"]
> dataset1[, half := .I - 2 * trunc((.I - 1) / 2)]
> dataset1[, quarter := .I - 4 * trunc((.I - 1) / 4)]
> dataset1[age < 0, age := 0]
> 
> PSU <- dataset1[, .N, keyby = "db030"][, N := NULL][]
> PSU[, PSU := trunc(runif(.N, 0, 5))]
> 
> dataset1 <- merge(dataset1, PSU, all = TRUE, by = "db030")
> rm(PSU)
> 
> dataset1[, strata := "XXXX"]
> dataset1[, employed := trunc(runif(.N, 0, 2))]
> dataset1[, unemployed := trunc(runif(.N, 0, 2))]
> dataset1[, labour_force := employed + unemployed]
> dataset1[, id_lv2 := paste0("V", .I)]
> 
> vardannual(Y = "employed", H = "strata",
+            PSU = "PSU", w_final = "rb050",
+            ID_level1 = "db030", ID_level2 = "id_lv2",
+            Dom = NULL, Z = NULL, years = "year",
+            subperiods = "half", dataset = dataset1,
+            percentratio = 100, confidence = 0.95,
+            method = "cros")
Error in t(X) %*% A_matrix : non-conformable arguments
Calls: vardannual -> lapply -> FUN -> data.table
Execution halted
NOTE r-oldrel-windows-x86_64

package subdirectories

Problems with news in 'NEWS.md':
No news entries found.
OK r-patched-linux-x86_64

*


            
OK r-release-linux-x86_64

*


            
OK r-release-macos-arm64

*


            
OK r-release-macos-x86_64

*


            
OK r-release-windows-x86_64

*


            

Check History

ERROR 11 OK · 2 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 9, 2026
NOTE r-oldrel-macos-arm64

package subdirectories

Problems with news in ‘NEWS.md’:
No news entries found.
NOTE r-oldrel-macos-x86_64

package subdirectories

Problems with news in ‘NEWS.md’:
No news entries found.
ERROR r-oldrel-windows-x86_64

package subdirectories

Problems with news in 'NEWS.md':
No news entries found.

Reverse Dependencies (2)

imports

MRG

suggests

Dependency Network

Dependencies Reverse dependencies foreach data.table MASS stringr surveyplanning laeken MRG convey vardpoor

Version History

new 0.21.0 Mar 9, 2026