utility {simPop} | R Documentation |
Utility measures
Description
Various utility measues that basically compares two data sets
Usage
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 |
y |
a data.frame, typically the corresponding synthetic data set. For |
type |
which measure
|
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
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)