pmse: Propensity-score utility (pMSE)

pmseR Documentation

Propensity-score utility (pMSE)

Description

The real and synthetic records are stacked and a logistic regression (main effects; categorical variables as dummies, missing values as indicators) predicts membership of the synthetic set. The propensity score mean-squared error

pMSE = \frac{1}{N}\sum_i (\hat p_i - c)^2,\quad c = n_{syn}/N

is 0 when the two sets are indistinguishable. pmse_ratio divides it by its expectation under the null hypothesis that both sets come from the same distribution, (k-1)(1-c)^2 c / N with k model parameters; values near 1 indicate high utility.

Usage

pmse(
  real,
  synthetic,
  vars = NULL,
  max_rows = 10000L,
  seed = NULL,
  model = c("linear", "quadratic")
)

Arguments

real, synthetic

Data frames with common columns.

vars

Optional subset of variables.

max_rows

Each data set is subsampled to at most this many rows.

seed

Optional random seed (subsampling).

model

Propensity model: "linear" (main effects, default) or "quadratic".

Details

With model = "quadratic", squares and pairwise products of the numeric variables are added to the logistic model (as recommended by Snoke et al. for detecting differences in the dependence structure).

Value

A list with pmse, pmse_null, pmse_ratio and n_params.

References

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 A, 181(3), 663–688. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/rssa.12358")}

Examples

syn <- synthesize(iris, seed = 1)
pmse(iris, syn)

SynthesizerPlus documentation built on Oct. 16, 2026, 5:10 p.m.