Synthpop: Bespoke Creation of Synthetic Data in R: Beata Nowok Gillian M Raab Chris Dibben
Synthpop: Bespoke Creation of Synthetic Data in R: Beata Nowok Gillian M Raab Chris Dibben
Synthpop: Bespoke Creation of Synthetic Data in R: Beata Nowok Gillian M Raab Chris Dibben
Abstract
In many contexts, confidentiality constraints severely restrict access to unique and
valuable microdata. Synthetic data which mimic the original observed data and preserve
the relationships between variables but do not contain any disclosive records are one
possible solution to this problem. The synthpop package for R, introduced in this paper,
provides routines to generate synthetic versions of original data sets. We describe the
methodology and its consequences for the data characteristics. We illustrate the package
features using a survey data example.
This introduction to the R package synthpop is a slightly amended version of Nowok B, Raab
GM, Dibben C (2016). synthpop: Bespoke Creation of Synthetic Data in R. Journal of
Statistical Software, 74(11), 1-26. doi:10.18637/jss.v074.i11. URL https://www.jstatsoft.
org/article/view/v074i11.
methods although synthesis is not the same as imputation. Imputation replaces data which
are missing with modelled values and adjusts the inference for the additional uncertainty
due to this process. For synthesis, in the circumstances when some data are missing two
approaches are possible, one being to impute missing values prior to synthesis and the other
to synthesise the observed patterns of missing data without estimating the missing values.
In both cases all data to be synthesised are treated as known and they are used to create
the synthetic data which are then used for inference. The data collection agency generates
multiple synthetic data sets and inferences are obtained by combining the results of models
fitted to each of them. The formulae for the variance of estimates from synthetic data are
different from those used for imputed data.
The synthetic data methods were first proposed by Rubin (1993) and Little (1993) and have
been developed by Raghunathan, Reiter, and Rubin (2003), Reiter (2003) and Reiter and
Raghunathan (2007). They have been discussed and exemplified in a further series of papers
(Abowd and Lane 2004; Abowd and Woodcock 2004; Reiter 2002, 2005a; Drechsler and Re-
iter 2010; Kinney, Reiter, and Berger 2010; Kinney, Reiter, Reznek, Miranda, Jarmin, and
Abowd 2011). Non-parametric synthesising methods were introduced by Reiter (2005b) who
first suggested to use classification and regression trees (CART; Breiman, Friedman, Olshen,
and Stone 1984) to generate synthetic data. CART was then compared with more powerful
machine learning procedures such as random forests, bagging and support vector machines
(Caiola and Reiter 2010; Drechsler and Reiter 2011). The monograph by Drechsler (2011)
summarises some of the theoretical, practical and policy developments and provides an excel-
lent introduction to synthetic data for those new to the field.
The original aim of producing synthetic data has been to provide publicly available datasets
that can be used for inference in place of the actual data. However, such inferences will only be
valid if the model used to construct the synthetic data is the true mechanism that has gener-
ated the observed data, which is very difficult, if at all possible, to achieve. Our aim in writing
the synthpop package (Nowok, Raab, Snoke, and Dibben 2016) for R (R Core Team 2016) is a
more modest one of providing test data for users of confidential datasets. Note that currently
all values of variables chosen for synthesis are replaced but this will be relaxed in future ver-
sions of the package. These test data should resemble the actual data as closely as possible, but
would never be used in any final analyses. The users carry out exploratory analyses and test
models on the synthetic data, but they, or perhaps staff of the data collection agencies, would
use the code developed on the synthetic data to run their final analyses on the original data.
This approach recognises the limitations of synthetic data produced by these methods. It is
interesting to note that a similar approach is currently being used for both of the synthetic
products made available by the U.S. Census Bureau (see https://www.census.gov/ces/
dataproducts/synlbd/ and http://www.census.gov/programs-surveys/sipp/guidance/
sipp-synthetic-beta-data-product.html), where results obtained from the synthetic data
are validated on the original data (“gold standard files”).
each country to administrative data (births, deaths, marriages, cancer registrations and other
sources) for individuals and their immediate families across several decades. Whilst unique
and valuable resources, the sensitive nature of the information they contain means that access
to the microdata is restricted to approved researchers and longitudinal study (LS) support
staff, who can only view and work with the data in safe settings controlled by the national
statistical agencies. Consequently, compared to other census data products such as the ag-
gregate statistics or samples of anonymised records, the three longitudinal studies (LSs) are
used by a small number of researchers, a situation which limits their potential impact. Given
that confidentiality constraints and legal restrictions mean that open access is not possible
with the original microdata, alternative options are needed to allow academics and other
users to carry out their research more freely. To address this the SYLLS (Synthetic Data
Estimation for UK Longitudinal Studies) project (see http://www.lscs.ac.uk/projects/
synthetic-data-estimation-for-uk-longitudinal-studies/) has been funded by the
Economic and Social Research Council to develop techniques to produce synthetic data which
mimics the observed data and preserves the relationships between variables and transitions
of individuals over time, but can be made available to accredited researchers to analyse on
their own computers. The synthpop package for R has been written as part of the SYLLS
project to allow LS support staff to produce synthetic data for users of the LSs, that are
tailored to the needs of each individual user. Hereinafter, we will use the term “synthesiser”
for someone like an LS support officer who is producing the synthetic data from the observed
data and hence has access to both. The term “analyst” will refer to someone like an LS user
who has no access to the observed data and will be using the synthetic data for exploratory
analyses. After the exploratory analysis the analyst will develop confirmatory models and
can send the code to a synthesiser to run the gold standard analyses. As well as providing
routines to generate the synthetic data the synthpop package contains routines that can be
used by the analyst to summarise synthetic data and fitted models from synthetic data and
those that can be used by the synthesiser to compare gold standard analyses with those from
the synthetic data.
Although primarily targeted to the data from the LSs, the synthpop package is written in a
form that makes it applicable to other confidential data where the resource of synthetic data
would be valuable. By providing a comprehensive and flexible framework with parametric and
non-parametric methods it fills a gap in tools for generating synthetic versions of original data
sets. The R package simPop (Meindl, Templ, Alfons, and Kowarik 2016) which is a successor
to the simPopulation package (Alfons, Kraft, Templ, and Filzmoser 2011; Alfons and Kraft
2013) implements model-based methods to simulate synthetic populations based on household
survey data and auxiliary information. The approach used concentrates on simulation of close-
to-reality population and is similar to microsimulation rather than multiple imputation. The
software IVEware for SAS (SAS Institute Inc. 2013) and its stand-alone version SRCware
(Raghunathan, Solenberger, and Van Hoewyk 2002; Survey Methodology Program 2011),
originally developed for multiple imputation, include the SYNTHESIZE module that allows to
produce synthetic data. IVEware uses conditionally specified parametric models with proper
imputation and these can be adjusted for clustered, weighted or stratified samples. All item
missing values are imputed when generating synthetic data sets. No analysis methods are
available in this software because only the formulae for imputation are available which are
not appropriate for synthetic data.
4 synthpop: Synthetic Populations in R
The structure of this paper is as follows. The next section introduces the notation, terminology
and the main theoretical results needed for the simplest and, we expect, the most common
use of the package. More details of the theoretical results for the general case can be found in
Raab, Nowok, and Dibben (2016). Readers not interested in the theoretical details can now
proceed directly to Section 3 which presents the package and its basic functionality. Section 4
that follows provides some illustrative examples. The concluding Section 5 indicates directions
for future developments.
2. Overview of method
Observed data from a survey or a sample from a census or population register are available
to the synthesiser. They consist of a sample of n units consisting of (xobs , yobs ) where xobs ,
which may be null, is a matrix of data that can be released unchanged to the analyst and
yobs is an n × p matrix of p variables that require to be synthesised. We consider here the
simple case when the synthetic data sets (syntheses) will each have the same number of
records as the original data and the method of generating the synthetic sample (e.g., simple
random sampling or a complex sample design) matches that of the observed data. This
condition allows to make inferences from synthetic data generated from distributions with
parameters fitted to the observed data without sampling the parameters from their posterior
distributions. We refer to such synthesis as “simple synthesis”. When synthetic data are
generated from distributions with parameters sampled from their posterior distributions we
refer to this as “proper synthesis”.
The observed data are assumed to be a sample from a population with parameters that can
be estimated by the synthesiser, specifically yobs is assumed to be a sample from f (Y |xobs , θ)
where θ is a vector of parameters. This could be a hypothetical infinite super-population or
a finite population which is large enough for finite population corrections to be ignored. The
synthesiser fits the data to the assumed distribution and obtains estimates of its parameters.
In most implementations of synthetic data generation, including synthpop, the joint distribu-
tion is defined in terms of a series of conditional distributions. A column of yobs is selected
and the distribution of this variable, conditional on xobs is estimated. Then the next column
is selected and its distribution is estimated conditional on xobs and the column of yobs already
selected. The distribution of subsequent columns of yobs are estimated conditional on xobs
and all previous columns of yobs .
The generation of the synthetic data sets proceeds in parallel to the fitting of each conditional
distribution. Each column of the synthetic data is generated from the assumed distribution,
conditional on xobs , the fitted parameters of the conditional distribution (simple synthesis)
and the synthesised values of all the previous columns of yobs . Alternatively the synthetic
values can be generated from the posterior distribution of the parameters (proper synthesis).
In both cases, a total of m synthetic data sets are generated.
Beata Nowok, Gillian M Raab, Chris Dibben 5
synthesised prior to the variable they refer to. In the synthesis process the restricted values
are assigned first and then only the records with unrestricted values are synthesised.
Disclosure control
Completely synthesised data such as those generated by the syn() function with default
settings do not by definition include real units, so disclosure of a real person is acknowledged
to be unlikely. It has been confirmed by Elliot (2015) in his report on the disclosure risk
associated with the synthetic data produced using synthpop package. Nonetheless, there are
some options that are designed to further protect data and limit the perceived disclosure.
For the CART model ("ctree" or "cart" method), the final leaves to be sampled from may
include only a very small number of individuals, which elevates risk of replicating real persons.
To avoid this, a user can specify, for instance, a minimum size of a final node that a CART
model can produce. It can be done using the cart.minbucket and the ctree.minbucket
parameter for the "cart" and "ctree" methods respectively. However, the right balance
needs to be found between disclosure risk and synthetic data quality. For the "ctree", "cart",
"normrank" and "sample" methods there is also the risk of releasing real unusual values
for continuous variables and therefore use of a smoothing option is essential for protecting
confidentiality. If the smoothing parameter is set to "density" a Gaussian kernel density
smoothing is applied to the synthesised values.
There are also additional precautionary options built into the package, which can be applied
using sdc() function (sdc stands for statistical disclosure control). The function allows top
and bottom coding, adding labels to the synthetic data sets to make it clear that the data are
fake so no one mistakenly believes them to be real and removing from the synthetic data set
any unique cases with variable sequences that are identical to unique individuals in the real
dataset. The last tool reduces the chances of a person who is in the real data believing that
their actual data is in the synthetic data.
4. Illustrative examples
4.1. Data
The synthpop package includes a data frame SD2011 with individual microdata that will
be used for illustration. The data set is a subset of survey data collected in 2011 within
the Social Diagnosis project (Council for Social Monitoring 2011) which aims to investigate
objective and subjective quality of life in Poland. The complete data set is freely available
at http://www.diagnoza.com/index-en.html along with a detailed documentation. The
SD2011 subset contains 35 selected variables of various type for a sample of 5,000 individuals
aged 16 and over.
R> library("synthpop")
For our illustrative examples of the syn() function we use seven variables of various data
types which are listed in Table 2.
Although function syn() allows synthesis of a subset of variables (see Section 4.3), for ease of
presentation here we extract variables of interest from the SD2011 data set and store them in
a data frame called ods which stands for “observed data set”. The structure of the ods data
can be investigated using the head() function which prints the first rows of a data frame.
R> vars <- c("sex", "age", "edu", "marital", "income", "ls", "wkabint")
R> ods <- SD2011[, vars]
R> head(ods)
To run a default synthesis only the data to be synthesised have to be provided as a function
argument. Here, an additional parameter seed is used to fix the pseudo random number
generator seed and make the results reproducible. To monitor the progress of the synthesising
process the function syn() prints to the console the current synthesis number and the name
of a variable that is being synthesised. This output can be suppressed by setting an argument
print.flag to FALSE.
Synthesis
-----------
sex age edu marital income ls wkabint
10 synthpop: Synthetic Populations in R
The resulting object of class ‘synds’ called here sds.default, where sds stands for “synthe-
sised data set”, is a list. The print method displays its selected components (see below).
An element syn contains a synthesised data set which can be accessed using a standard list
referencing (sds.default$syn).
R> sds.default
Call:
($call) syn(data = ods, seed = my.seed)
Synthesising methods:
($method)
sex age edu marital income ls wkabint
"sample" "cart" "cart" "cart" "cart" "cart" "cart"
Order of synthesis:
($visit.sequence)
sex age edu marital income ls wkabint
1 2 3 4 5 6 7
Matrix of predictors:
($predictor.matrix)
sex age edu marital income ls wkabint
sex 0 0 0 0 0 0 0
age 1 0 0 0 0 0 0
edu 1 1 0 0 0 0 0
marital 1 1 1 0 0 0 0
income 1 1 1 1 0 0 0
ls 1 1 1 1 1 0 0
wkabint 1 1 1 1 1 1 0
The remaining (undisplayed) list elements include other syn() function parameters used in
the synthesis. Their names can be listed via the names() function. For a complete description
see the syn() function help page (?syn).
Beata Nowok, Gillian M Raab, Chris Dibben 11
R> names(sds.default)
By default, all variables except for the first one in the visit sequence (visit.sequence) are
synthesised using the "cart" method. The first variable to be synthesised cannot have pre-
dictors that are to be synthesised later on and therefore a random sample (with replacement)
is drawn from its observed values. The default visit sequence reflects the order of variables in
the original data set - columns are synthesised from left to right.
The default predictor selection matrix (predictor.matrix) is defined by the visit sequence.
All variables that are earlier in the visit sequence are used as predictors. A value of 1 in a
predictor selection matrix means that the column variable is used as a predictor for the target
variable in the row. Since the order of variables is exactly the same as in the original data, for
the default visit sequence the default predictor selection matrix has values of 1 in the lower
triangle.
Synthesising data with default parametric methods is run with the methods listed below.
Values of the other syn() arguments remain the same as for the default synthesis.
R> sds.parametric$method
default those variables are not used to predict other variables but they are saved in the
synthesised data. In order to remove their original values from the resulting synthetic data
sets an argument drop.not.used has to be set to TRUE. To synthesize variables sex, age, ls,
marital and edu in this order we run the syn() function with the following specification
Synthesis
-----------
sex age ls marital edu
An appropriate prediction matrix is created automatically. To avoid having to alter other pa-
rameters when the visit sequence is changed and to ensure the synthetic data have the same
structure as the original ones, the variables in sds.selection$predictor.matrix are ar-
ranged in the same order as in the original data. The same applies to sds.selection$method
and synthesised data set sds.selection$syn. As noted above, if the parameter drop.not.used
is set to TRUE and there are variables that are not used in synthesis, they are not included
in the output. In this case the column indices in visit sequence, which align to the synthetic
data columns, may not be the same as in the original data.
R> sds.selection
Call:
($call) syn(data = ods, visit.sequence = c(1, 2, 6, 4, 3), drop.not.used = TRUE,
seed = my.seed)
Synthesising methods:
($method)
Beata Nowok, Gillian M Raab, Chris Dibben 13
Order of synthesis:
($visit.sequence)
sex age ls marital edu
1 2 5 4 3
Matrix of predictors:
($predictor.matrix)
sex age edu marital ls
sex 0 0 0 0 0
age 1 0 0 0 0
edu 1 1 0 1 1
marital 1 1 0 0 1
ls 1 1 0 0 0
Note that a user-defined method vector (setting method for each variable separately) and a
specified predictor.matrix both have to include information for all variables present in the
original observed data set regardless of whether they are in visit.sequence or not. This
allows changes in visit.sequence without adjustments to other arguments. For variables
not to be synthesised but still to be used as predictors, which needs to be reflected in a
predictor.matrix, an empty method ("") should be set. By default the original observed
values of those variables are included in the synthesised data sets but it can be changed using
an argument drop.pred.only.
Selection of predictors
The most important rule when selecting predictors is that independent variables in a predic-
tion model have to be already synthesised. The only exception is when a variable is used only
as a predictor and is not going to be synthesised at all. Assume we want to synthesise all
variables except wkabint and:
• exclude life satisfaction (ls) from the predictors of marital status (marital);
• use monthly income (income) as a predictor of life satisfaction (ls), education (edu)
and marital status (marital) but do not synthesise income variable itself;
• use polytomous logistic regression (polyreg) to generate marital status (marital) in-
stead of a default ctree method.
In order to build an adequate predictor selection matrix, instead of doing it from scratch we
can define an initial visit.sequence and corresponding method vector and run syn() func-
tion with parameter drop.not.used set to FALSE (otherwise method and predictor.matrix
will miss information on wkabint), parameter m indicating number of synthesis set to zero
and other arguments left as defaults. Then we can adjust the predictor selection matrix used
in this synthesis and rerun the function with new parameters. The R code for this is given
below.
14 synthpop: Synthetic Populations in R
R> sds.ini$predictor.matrix
Application of a rule, as specified below using named lists, leads to the correct results
Before running the models let us compare some descriptive statistics of the observed and
synthetic data sets. A very useful function in R for this purpose is summary(). When a
data frame is provided as an argument, here our original data set ods, it produces summary
statistics of each variable.
R> summary(ods)
marital income ls
SINGLE :1253 Min. : 100 PLEASED :1947
MARRIED :2979 1st Qu.: 970 MOSTLY SATISFIED :1692
Beata Nowok, Gillian M Raab, Chris Dibben 17
The summary() function with the synds object as an argument gives summary statistics of the
variables in the synthesised data set. If more than one synthetic data set has been generated,
as default summaries are calculated by averaging summary values for all synthetic data copies.
R> summary(sds)
marital income ls
SINGLE :1246.0 Min. : 100 PLEASED :1964.8
MARRIED :2988.6 1st Qu.: 972 MOSTLY SATISFIED :1670.4
WIDOWED : 527.4 Median : 1334 MIXED : 832.0
DIVORCED : 196.8 Mean : 1644 MOSTLY DISSATISFIED: 283.4
LEGALLY SEPARATED : 8.0 3rd Qu.: 2000 DELIGHTED : 182.8
DE FACTO SEPARATED: 23.6 Max. :15800 (Other) : 57.8
NA's : 9.6 NA's : 1271 NA's : 8.8
wkabint
NO :4652
YES : 311
NA's: 37
Summary of individual data sets can be displayed by supplying the msel parameter, which
can be a single number or a vector with selected synthesis numbers. An example code is
presented below but the corresponding output is suppressed for space reasons.
To compare the synthesised variables with the original ones more easily, the synthesiser can use
a compare() function. It is a generic function for comparison of various aspects of synthesised
and observed data. The function invokes particular methods depending on the class of the
first argument. If a synthetic data object and a data frame with original data are provided it
compares relative frequency distributions of each variable in tabular and graphic form. The
number of plots per page can be specified via nrow and ncol arguments. Alternatively, the
function can be used for a subset of variables specified by a vars argument. Output for income
is presented below and in Figure 1. For quantitative variables, such as income, missing data
categories are plotted on the same plot as non-missing values and they are indicated by miss.
suffix. If a synthetic data object contains multiple data sets by default pooled synthetic data
are used for comparison.
$income
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000
observed 24.58 34.98 9.44 2.660 1.36 0.48 0.26 0.200 0.08 0.100 0.04 0.020
synthetic 24.72 35.04 9.46 2.604 1.44 0.50 0.28 0.196 0.08 0.112 0.06 0.016
12000 13000 14000 15000 miss.NA
observed 0 0 0.060 0.020 25.72
synthetic 0 0 0.056 0.016 25.41
An argument msel can be used to compare the observed data with a single or multiple
individual synthetic data sets, which is illustrated below and in Figure 2 for a life satisfaction
factor variable (ls).
$ls
DELIGHTED PLEASED MOSTLY SATISFIED MIXED MOSTLY DISSATISFIED
observed 3.82 38.94 33.84 16.54 5.48
syn=1 3.50 38.86 33.26 17.30 5.84
syn=2 3.68 39.30 33.46 16.32 5.90
syn=3 3.94 39.00 33.80 16.66 5.32
UNHAPPY TERRIBLE <NA>
observed 0.82 0.40 0.16
syn=1 0.66 0.44 0.14
syn=2 0.80 0.20 0.34
syn=3 0.72 0.46 0.10
Returning to the logistic regression model for wkabint, we estimate the original data model us-
ing generalised linear models implemented in R glm() function. A synthpop package function
Beata Nowok, Gillian M Raab, Chris Dibben 19
observed synthetic
income
30
Percent
20
10
0 10 20 30 40 50 60 70 8 9 1 1 1 1 1 1 m
00 0 0 00 00 00 00 00 000 000 000 100 200 300 400 500 iss.
0 0 0 0 0 0 NA
Value
Figure 1: Relative frequency distribution of non-missing values and missing data categories
for income variable for observed and synthetic data.
glm.synds() is an equivalent function for estimating models for each of the m synthesised data
sets. A similar function called lm.synds() is available for a standard linear regression model.
An outcome of glm.synds() and lm.synds() function is an object of class ‘fit.synds’. If
m > 1, printing a ‘fit.synds’ object gives the combined (average) coefficient estimates. Re-
sults for coefficient estimates based on individual synthetic data sets can be displayed using
an msel argument of a print method.
Coefficients:
(Intercept) sexFEMALE
-0.2105 -0.4739
age eduVOCATIONAL/GRAMMAR
-0.0538 0.6275
eduSECONDARY eduPOST-SECONDARY OR HIGHER
0.3684 -0.1870
log(income)
-0.0461
20 synthpop: Synthetic Populations in R
ls
40
30
Percent
20
10
0
DE PL MO MI MO UN TE NA
LIG EA ST XE ST HA RR
HT SE LY D LY PP IBL
ED D SA DI Y E
TIS SS
FIE AT
D ISF
IED
Value
Figure 2: Relative frequency distribution of life satisfaction (ls) for observed and synthetic
data.
Note: To get a summary of results you would expect from the original data, or for populati
Call:
glm.synds(formula = wkabint ~ sex + age + edu + log(income),
family = "binomial", data = sds)
0.05634 -0.17453
log(income)
-0.02434
The summary() function of a fit.synds object can be used by the analyst to combine
estimates based on all the synthesised data sets. By default inference is made to orig-
inal data quantities. In order to make inference to population quantities the parameter
population.inference has to be set to TRUE. The function’s result provides point estimates
of coefficients (B.syn), their standard errors (se(B.syn)) and Z scores (Z.syn) for population
and observed data quantities respectively. For inference to original data quantities it contains
in addition estimates of the actual standard errors based on synthetic data (se(Beta).syn)
and standard errors of Z scores (se(Z.syn)). Note that not all these quantities are printed
automatically.
The mean of the estimates from each of the m synthetic data sets yields unbiased estimates
of the coefficients if the data conform to the model used for synthesis. The variance is
estimated differently depending whether inference is made to the original data quantities or
the population parameters and whether synthetic data were produced using simple or proper
synthesis (for details see Raab et al. 2016; expressions used to calculate variance for different
cases are presented in Table 1). By default a simple synthesis is conducted and inference is
made to original data quantities.
R> summary(model.sds)
Warning: Note that all these results depend on the synthesis model being correct.
Call:
glm.synds(formula = wkabint ~ sex + age + edu + log(income),
family = "binomial", data = sds)
Combined estimates:
xpct(Beta) xpct(se.Beta) xpct(z) Pr(>|xpct(z)|)
(Intercept) -0.21800 1.00300 -0.22 0.8279
sexFEMALE -0.45775 0.16367 -2.80 0.0052
age -0.05270 0.00557 -9.47 <2e-16
eduVOCATIONAL/GRAMMAR 0.19023 0.28919 0.66 0.5107
eduSECONDARY 0.05634 0.29864 0.19 0.8504
eduPOST-SECONDARY OR HIGHER -0.17453 0.33616 -0.52 0.6036
log(income) -0.02434 0.13448 -0.18 0.8563
(Intercept)
sexFEMALE **
age ***
22 synthpop: Synthetic Populations in R
eduVOCATIONAL/GRAMMAR
eduSECONDARY
eduPOST-SECONDARY OR HIGHER
log(income)
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Function compare() allows the synthesiser to compare the estimates based on the synthesised
data sets with those based on the original data and presents the results in both tabular and
graphical form (see Figure 3).
From both original and synthetic data we conclude that men are more likely to declare in-
tention to work abroad as are those who are young. The fact that the results from synthetic
data can have a similar pattern to the results from the real data is encouraging for further
developments of synthetic data tools.
5. Concluding remarks
In this paper we presented the basic functionality of the R package synthpop for generating
synthetic versions of microdata containing confidential information so that they are safe to
be released to users for exploratory analysis. Interested readers can consult the package
documentation for additional features currently implemented which can be used to influence
Beata Nowok, Gillian M Raab, Chris Dibben 23
sexFEMALE
●
age
●
eduVOCATIONAL/GRAMMAR
Coefficient
● Model
synthetic
● observed
eduSECONDARY
●
eduPOST−SECONDARY OR HIGHER
●
log(income)
●
−12 −8 −4 0 4
Z value
Figure 3: Estimates and 95% confidence intervals for Z statistics from a logistic regression of
intention to go abroad to work for observed and synthetic data.
the disclosure risk and the utility of the synthesised data. Note that synthpop is under
continual development and future versions will include, among others, appropriate procedures
for synthesising multiple event data, conducting stratified synthesis and replacing only selected
cases from selected variables. The ultimate aim of synthpop is to provide a comprehensive,
flexible and easy to use tool for generating bespoke synthetic data that can be safely released
to interested data users. Since there are many different options to synthesise data, developing
general guidelines for best practice remains an open issue to be addressed in our future
research.
References
Abowd JM, Lane J (2004). “New Approaches to Confidentiality Protection: Synthetic Data,
Remote Access and Research Data Centers.” In J Domingo-Ferrer, V Torra (eds.), Privacy
in Statistical Databases, 2004, pp. 282–289. Springer-Verlag.
Breiman L, Friedman JH, Olshen RA, Stone CJ (1984). Classification and Regression Trees.
Belmont, Wadsworth.
Caiola G, Reiter JP (2010). “Random Forests for Generating Partially Synthetic, Categorical
Data.” Transactions on Data Privacy, 3(1), 27–42.
Council for Social Monitoring (2011). “Social Diagnosis 2000–2011: Integrated Database.”
URL http://www.diagnoza.com/index-en.html.
Drechsler J (2011). Synthetic Data Sets for Statistical Disclosure Control. Springer-Verlag.
doi:10.1007/978-1-4614-0326-5.
Drechsler J, Reiter JP (2010). “Sampling with Synthesis: A New Approach for Releasing
Public Use Census Microdata.” Journal of the American Statistical Association, 105(492),
1347–1357. doi:10.1198/jasa.2010.ap09480.
Elliot M (2015). “Final Report on the Disclosure Risk Associated with the Synthetic Data
Produced by the SYLLS Team.” Report 2015-2, Cathie Marsh Institute for Social Re-
search (CMIST), University of Manchester. URL http://www.cmist.manchester.ac.uk/
research/publications/reports.
Elliot M, Purdam K (2007). “A Case Study of the Impact of Statistical Disclosure Control
on Data Quality in the Individual UK Samples of Anonymized Records.” Environment and
Planning A, 39(5), 1101–1118. doi:10.1068/a38335.
Kinney SK, Reiter JP, Berger JO (2010). “Model Selection When Multiple Imputation is Used
to Protect Confidentiality in Public Use Data.” Journal of Privacy and Confidentiality, 2(2),
3–19.
Kinney SK, Reiter JP, Reznek AP, Miranda J, Jarmin RS, Abowd JM (2011). “Towards Un-
restricted Public Use Business Microdata: The Synthetic Longitudinal Business Database.”
International Statistical Review, 79(3), 362–384. doi:10.1111/j.1751-5823.2011.00153.
x.
Little RJA (1993). “Statistical Analysis of Masked Data.” Journal of Official Statistics, 9(2),
407–26.
Beata Nowok, Gillian M Raab, Chris Dibben 25
Nowok B, Raab GM, Snoke J, Dibben C (2016). synthpop: Generating Synthetic Versions
of Sensitive Microdata for Statistical Disclosure Control. R package version 1.3-0, URL
https://CRAN.R-project.org/package=synthpop.
Raab GM, Nowok B, Dibben C (2016). “Practical Data Synthesis for Large Samples.”
arXiv:1409.0217 [stat.ME], URL http://arxiv.org/abs/1409.0217.
Raghunathan TE, Reiter JP, Rubin DB (2003). “Multiple Imputation for Statistical Disclosure
Limitation.” Journal of Official Statistics, 19(1), 1–17.
Raghunathan TE, Solenberger PW, Van Hoewyk J (2002). “IVEware: Imputation and
Variance Estimation Software User Guide.” Technical report, Survey Methodology Pro-
gram, Survey Research Center, Institute for Social Research, University of Michigan. URL
http://www.isr.umich.edu/src/smp/ive/.
R Core Team (2016). R: A Language and Environment for Statistical Computing. R Founda-
tion for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.
Reiter JP (2002). “Satisfying Disclosure Restrictions with Synthetic Data Sets.” Journal of
Official Statistics, 18(4), 531–544.
Reiter JP (2003). “Inference for Partially Synthetic, Public Use Microdata Sets.” Survey
Methodology, 29(2), 181–188.
Reiter JP (2005a). “Releasing Multiply Imputed, Synthetic Public Use Microdata: An Illus-
tration and Empirical Study.” Journal of the Royal Statistical Society A, 168(1), 185–205.
doi:10.1111/j.1467-985x.2004.00343.x.
Reiter JP (2005b). “Using CART to Generate Partially Synthetic, Public Use Microdata.”
Journal of Official Statistics, 21(3), 441–462.
Reiter JP, Kinney SK (2012). “Inferentially Valid, Partially Synthetic Data: Generating from
Posterior Predictive Distributions Not Necessary.” Journal of Official Statistics, 28(4),
583–590.
SAS Institute Inc (2013). SAS Software, Version 9.4. Cary. URL http://www.sas.com/.
Survey Methodology Program (2011). “IVEware: Imputation and Variance Estimation Ver-
sion 0.2 Users Guide (Supplement).” Technical report, Survey Research Center, Institute
for Social Research, University of Michigan. URL http://www.isr.umich.edu/src/smp/
ive/.
Affiliation:
Beata Nowok
Institute of Geography
School of GeoSciences
University of Edinburgh
Drummond Street
Edinburgh EH8 9XP, United Kingdom
E-mail: beata.nowok@ed.ac.uk