Utility measures

Share:

Description

Various utility measues that basically compares two data sets

Usage

1
2
3
4
5
6
utility(x, y, type = c("all", "compareColumns", "compareRows",
  "compareRowsHH", "compareNA"), hhid = NULL)

utilityModal(x, y, varx, vary = NULL)

utilityIndicator(x, y)

Arguments

x

a data.frame, typically the original data set. For utilityIndicator this should be a vector of length 1.

y

a data.frame, typically the corresponding synthetic data set. For utilityIndicator this should be a vector of length 1.

type

which measure

  • compareColumnscompares the intersection of variables

  • compareRowscompares the number of rows

  • compareRowsHHcompares the number of housholds

  • compareNAcompares the number of missings

hhid

index or name of variable containing the houshold ID

varx

name or index of a variable in data.frame x

vary

NULL or name or index of a variable in data.frame y corresponding to variable varx in data.frame x. If NULL, the names of the selected variable should be the same in both x and y.

Value

the measure(s) of interest

Functions

  • utility: comparisons of two data sets

  • utilityModal: comparison of number of categories

  • utilityIndicator: difference between two values

Author(s)

Matthias Templ, Maxime Bergeaut

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(eusilcS)
data(eusilcP)
## for fast caluclations, took a subsample
eusilcP <- eusilcP[1:15000, ]
utility(eusilcS, eusilcP)
data(eusilcS)
data(eusilcP)
utilityModal(eusilcS, eusilcP, "age")
utilityModal(eusilcS, eusilcP, "pl030", "ecoStat")
data(eusilcS)
data(eusilcP)
m1 <- meanWt(eusilcS$age, eusilcS$rb050) 
m2 <- mean(eusilcP$age)
utilityIndicator(m1, m2)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.