Skip to contents

A single call for synpmx_pca_summarize() followed by synpmx_pca_generate(). Use the two separately to look at what the summary contains before generating from it; it is on the result either way, as the pmx_trial_summary attribute.

Usage

synpmx_pca(data, roles, n_subjects = NULL, seed = NULL, ...)

Arguments

data

Source PMX event data.

roles

Explicit column roles from pmx_roles(), including nominal_time.

n_subjects

Number of synthetic subjects. Defaults to the source count.

seed

Generation seed.

...

Passed to synpmx_pca_summarize().

Value

A data frame in the source's shape, carrying the trial summary as an attribute.

Details

Where synpmx_avatar() blends values from real neighbouring patients, this writes out no number a patient measured. What it carries out of the source is a mean, a scale, a set of principal-component loadings, one mean score vector per arm, a residual covariance, and a dosing and visit model per arm. pca_report() inventories all of it.

nominal_time is required. No formal privacy claim is made.

Examples

data <- pmx_simulated_fixture(60)
roles <- pmx_roles(
  id = "ID", time = "TIME", nominal_time = "NTIME", dv = "DV", amt = "AMT",
  evid = "EVID", cmt = "CMT", dvid = "DVID", mdv = "MDV"
)
synthetic <- synpmx_pca(data, roles, seed = 1)
nrow(synthetic) > 0
#> [1] TRUE