No packages match

masque - Synthetic Copies of Confidential Data Tables

Creates a synthetic copy of a confidential data table, so that analysis code can be written and tested without the real values. By default, every outcome and covariate is simulated independently, with no link to other columns or to the real rows. Each numeric column keeps only an eleven-point summary: its 1st percentile, deciles and 99th percentile. The experimental design and the pattern of missing values are kept exactly, and category labels, including those of the design and the treatments, are replaced by codes. Columns that look like identifiers or free text are left out. More of the real structure can be kept on request, at the cost of disclosing more about the real data. With mode = "local" (for the data owner's own use) or mode = "collaborate" (for sharing), numeric columns are simulated from a Gaussian copula, which approximately preserves each column's distribution and the correlations between them. In those modes, treatment effects can also be mimicked by setting conditional = TRUE in mask(). A folder of files or a multi-sheet workbook can be masked together. Keys shared by the tables get the same codes in every table, so the synthetic tables still join. Each run also returns a recipe, which maps the codes back to the real labels. The recipe is as confidential as the data and should stay with the data owner. apply_recipe() converts the real data into the names and codes of the copy, so code written on the copy runs on it unchanged, and unmask() converts results back to the real labels. The package gives no formal privacy guarantee.

Last updated

5.60 score 212 downloads

survestimand - Survival Estimands from Many Models Through One Interface

Fits time-to-event models through one interface: Cox proportional hazards and Kaplan-Meier from 'survival', parametric (accelerated failure time and proportional hazards), spline and cure models from 'flexsurv' and 'flexsurvcure', shared frailty from 'coxme', interval-censored regression from 'icenReg', competing-risks models, and the Andersen-Gill model for recurrent events. Every fit returns one object type with the same coefficient, tidying and summary methods; survival curves and restricted means are computed for the parametric, spline, cure, Cox and Kaplan-Meier fits. New estimators are added through a method registry. From a fit it estimates the quantities a randomised comparison reports: survival and restricted mean survival time (RMST) by arm and their differences, standardised over the sample or from Kaplan-Meier, with delta-method or bootstrap intervals; cumulative incidence of a cause and time lost to it; and pseudo-observation regression (Andersen, Hansen and Klein 2004 <doi:10.1007/s10985-004-4771-0>). It also provides the log-rank test, the test of proportional hazards (Grambsch and Therneau 1994 <doi:10.1093/biomet/81.3.515>), a piecewise-exponential layout whose hazard draws give standardised survival quantities, simulated illness-death data with known true values, information criteria, and censoring-weighted prediction scores. Fits with too few events per predictor raise a warning or a typed refusal.

Last updated

3.90 score