Skip to contents

Fit an analysis on each of the m synthetic datasets in a synth() result and combine the results into one estimate whose standard error reflects the extra variability that synthesis introduces. An analysis of a single synthetic dataset does not estimate between-synthesis variation, so its usual standard errors can be miscalibrated. These functions implement published fully-synthetic combining rules; their large-sample calibration still depends on the estimand, synthesis model, sample size, and analysis assumptions.

Usage

pool_synth(
  object,
  analysis,
  rule = c("synthpop", "reiter"),
  population_inference = TRUE,
  conf.level = 0.95,
  ...
)

Arguments

object

A synth_result from synth() or synth_linked_result from synth_linked() (ideally with m >= 5).

analysis

A function of one synthetic data.frame (or named list of tables for synth_linked()) returning a fitted model (with coef()/vcov()) or a list(estimate =, variance =).

rule

Combining rule: "synthpop" (default, Raab/Nowok/Dibben 2016) or "reiter" (Reiter 2003 fully-synthetic; needs m >= 2).

population_inference

If TRUE (default) the standard error targets the population the real data was drawn from, inflating for synthesis. If FALSE it reports only the (size-rescaled) within-synthesis variance – the standard error an analyst of the original data would have seen.

conf.level

Confidence level for the intervals (default 0.95).

...

Reserved for future use.

Value

A flexsynth_pool object; $estimates is a data frame with term, estimate, std.error, statistic, p.value, conf.low, conf.high.

Details

analysis is run once per synthetic dataset and must return either a fitted model supporting coef() and vcov() (such as lm() or glm()) or a list with numeric estimate and variance (squared standard error) vectors. The per-dataset estimates are then combined with the chosen rule: "synthpop" (Raab, Nowok & Dibben 2016, matching synthpop's summary.fit.synds) or "reiter" (Reiter 2003 fully-synthetic, Tf = (1 + 1/m) b_m - vbar, which needs m >= 2 and can be negative). Intervals are large-sample normal, as in synthpop.

Only Track A (synth() or synth_linked() without privacy) results are supported: differentially private (Track B) inference must additionally account for the DP noise and is out of scope here. For a synth_linked() result, analysis receives each replicate's named list of synthetic tables.

See also

synth_glm() for the common linear / generalised-linear case.

Examples

d <- data.frame(id = 1:400, x = rnorm(400))
d$y <- 1 + 2 * d$x + rnorm(400)
res <- synth(d, ~ id, m = 5, seed = 1)
pool_synth(res, function(dat) lm(y ~ x, dat))
#> <flexsynth_pool> pooled inference from 5 synthetic dataset(s)
#>   rule: synthpop   population inference   (n = 400, k = 400)
#>         term estimate std.error statistic   p.value conf.low conf.high
#>  (Intercept)  0.96836   0.06837    14.164  1.54e-45  0.83435   1.10236
#>            x  2.00816   0.06758    29.717 4.63e-194  1.87572   2.14061