Distributional comparison of synthesised and observed data
Distributional comparison of synthesised data set with the original (observed) data set using propensity scores.
utility.gen(object, data, method = "logit", maxorder = 1, tree.method = "rpart", resamp.method = NULL, nperms = 50, cp = 1e-3, minbucket = 5, mincriterion = 0, vars = NULL, aggregate = FALSE, maxit = 200, ngroups = NULL, print.every = 10, digits = 2, print.zscores = FALSE, zthresh = 1.6, print.ind.results = TRUE, print.variable.importance = FALSE, ...) ## S3 method for class 'utility.gen' print(x, digits = x$digits, print.zscores = x$print.zscores, zthresh = x$zthresh, print.ind.results = x$print.ind.results, print.variable.importance = x$print.variable.importance, ...)
object |
an object of class |
data |
the original (observed) data set. |
method |
a single string specifying the method for modeling the propensity
scores. Method can be selected from |
maxorder |
maximum order of interactions to be considered in
|
tree.method |
implementation of |
resamp.method |
method used for resampling estimate of the null |
nperms |
number of permutations for the permutation test to obtain the
null distribution of the utility measure when |
cp |
complexity parameter for classification with tree.method
|
minbucket |
minimum number of observations allowed in a leaf for
classification when |
mincriterion |
criterion between 0 and 1 to use to control
|
vars |
variables to be included in the utility comparison. If none are specified all the variables in the synthesised data will be included. |
aggregate |
logical flag as to whether the data should be aggregated by
collapsing identical rows before computation. This can lead to much faster
computation when all the variables are categorical. Only works for
|
maxit |
maximum iterations to use when |
ngroups |
target number of groups for categorisation of each numeric
variable: final number may differ if there are many repeated values. If
|
print.every |
controls the printing of progress of resampling when
|
... |
|
x |
an object of class |
digits |
number of digits to print in the default output, excluding
|
print.zscores |
logical value as to whether z-scores for coefficients of the logit model should be printed. |
zthresh |
threshold value to use to suppress the printing of z-scores
under |
print.ind.results |
logical value as to whether utility score results from individual syntheses should be printed. |
print.variable.importance |
logical value as to whether the variable
importance measure should be printed when |
This function follows the method for evaluating the utility of masked data
as given in Snoke et al. (forthcoming) and originally proposed by Woo et al.
(2009). The original and synthetic data are combined into one dataset and
propensity scores, as detailed in Rosenbaum and Rubin (1983), are calculated
to estimate the probability of membership in the synthetic data set.
The utility measure is based on the mean squared difference between these
probabilities and the probability expected if the data did not distinguish
the synthetic data from the original. The expected probability is just the
proportion of synthetic data in the combined data set, 0.5
when the
original and synthetic data have the same number of records.
Propensity scores can be modeled by logistic regression method = "logit"
or by two different implementations of classification and regression trees as
method "cart"
. For logistic regression the predictors are all variables
in the data and their interactions up to order maxorder
. The default of
1
gives all main effects and first order interactions. For logistic
regression the null distribution of the propensity score is derived and is
used to calculate ratios and standardised values.
For method = "cart"
the expectation and variance of the null
distribution is calculated from a permutation test.
If missing values exist, indicator variables are added and included in the
model as recommended by Rosenbaum and Rubin (1984). For categorical variables,
NA
is treated as a new category.
An object of class utility.gen
which is a list including the utility
measures their expected null values for each synthetic set with the following
components:
call |
the call that produced the result. |
m |
number of synthetic data sets in object. |
method |
method used to fit propensity score. |
tree.method |
cart function used to fit propensity score when
|
pMSE |
Propensity score mean square error from the utility model or a
vector of these values if |
utilVal |
utility value(s). Calculated from the |
utilExp |
expected value(s) of the utility score if the synthesis method is correct. |
utilR |
ratio(s) of |
utilStd |
utility value standardised by expressing it as z-scores, difference(s) from the expected value divided by the expected standard deviation. |
pval |
p-value(s) for the chi-square test(s) for |
fit |
the fitted model for the propensity score or a list of fitted
models of length |
Woo, M-J., Reiter, J.P., Oganian, A. and Karr, A.F. (2009). Global measures of data utility for microdata masked for disclosure limitation. Journal of Privacy and Confidentiality, 1(1), 111-124.
Rosenbaum, P.R. and Rubin, D.B. (1984). Reducing bias in observational studies using subclassification on the propensity score. Journal of the American Statistical Association, 79(387), 516-524.
Snoke, J., Raab, G.M., Nowok, B., Dibben, C. and Slavkovic, A. (2018). General and specific utility measures for synthetic data. Journal of the Royal Statistical Society: Series A, 181, Part 3, 663-688.
## Not run: ods <- SD2011[1:1000, c("age", "bmi", "depress", "alcabuse", "englang")] s1 <- syn(ods, m = 5) utility.gen(s1, ods) u1 <- utility.gen(s1, ods) print(u1, print.zscores = TRUE, usethresh = TRUE) u2 <- utility.gen(s1, ods, groups = TRUE) print(u2, print.zscores = TRUE) u3 <- utility.gen(s1, ods, method = "cart", nperms = 20) print(u3, print.variable.importance = TRUE) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.