Analyses by Pattern

An analysis is what the researcher wants to know, such as the median of a variable or the effect of a treatment on survival. An algorithm is how it is calculated. The same analysis can often be calculated with different algorithms, and it is the algorithm that decides which Computational Pattern is used, and whether the result is the same as it would be with the data in one location.

For example, the median can be estimated in the Traditional Pattern by merging a t-digest from each TRE, calculated exactly in the Shared Pattern by a search that sends a candidate value back into each TRE over several rounds, or calculated exactly in the Pooled Pattern by sorting the pooled data.

The tables below list common analyses, with the algorithm that can be used for each in the Traditional and Shared Patterns:

  • Exact: the same result as if the data were all in one location
  • Estimated: close to, but not the same as, the result with the data in one location
  • Same as Traditional: the analysis can be carried out in the Shared Pattern, but it gives the same result as the Traditional Pattern, with more rounds of exchange and results sent back into the TREs

Every analysis can be carried out exactly in the Pooled Pattern, using the standard methods, so the Pooled Pattern is not listed in each table. The final table lists the analyses that need it.

These tables are not comprehensive. More detail on what each TRE sends is given on the Traditional and Shared pages.

Describing the data

AnalysisTraditionalShared
Counts, frequencies and proportionsCounts added across TREs (exact)Same as Traditional
Min/maxMin of the mins, max of the maxes (exact)Same as Traditional
MeanTotals (n, Σx) added across TREs (exact)Same as Traditional
Variance, standard deviation and covarianceTotals (n, Σx, Σx², Σxy) added across TREs (exact)Same as Traditional
Median and quantilesMerged t-digests, or histograms with agreed bins (estimated)Bisection search on a candidate value (exact)
Number of distinct individualsMerged HyperLogLog sketches (estimated)Same as Traditional
Standardisation (z-scores)Each TRE standardises with its own mean and standard deviation, which is not the same as the pooled valuesPooled mean and standard deviation sent back into each TRE (exact)

Statistical tests and correlation

AnalysisTraditionalShared
Chi-squared and Fisher’s exact testContingency tables added cell by cell (exact)Same as Traditional
t-tests (one-sample, two-sample, Welch’s)n, mean and variance for each group (exact)Same as Traditional
ANOVAn, Σx and Σx² for each group (exact)Same as Traditional
Hotelling’s T²n, mean vector and covariance matrix (exact)Same as Traditional
Pearson’s correlationCovariance totals (exact)Same as Traditional

Regression models

AnalysisTraditionalShared
Linear regressionClosed-form fit from XᵀX, Xᵀy and yᵀy (exact)Same as Traditional
Ridge regressionClosed-form fit from XᵀX and Xᵀy (exact)Same as Traditional
Logistic, Poisson and other generalised linear modelsFit on summed tables, categorical covariates only (exact), or meta-analysis (estimated)Newton–Raphson with score and information added across TREs, any covariates (exact)
Generalised estimating equations (GEE)Meta-analysis (estimated)Estimating equations added across TREs (exact)
Lasso and elastic netMeta-analysis (estimated)Gradient methods or ADMM (exact)
Linear mixed models, site-level random effectsClosed-form fit from totals (exact)Same as Traditional
Linear mixed models, random effects below site levelMeta-analysis (estimated)Likelihood added across TREs (exact)
Principal component analysis (PCA)Pooled covariance matrix from totals (exact)Same as Traditional

Survival analysis

AnalysisTraditionalShared
Survival curves and log-rank testKaplan–Meier or Nelson–Aalen from numbers at risk and events on an agreed time grid (exact)Same as Traditional
Cox regressionPiecewise-exponential model (estimated), or meta-analysis (estimated)Newton–Raphson, stratified by site (exact)
Parametric survival models (Weibull, accelerated failure time)Meta-analysis (estimated)Score and information added across TREs (exact)
Poisson and piecewise-exponential models, categorical covariatesFit on summed tables (exact)Same as Traditional

Clustering and machine learning

AnalysisTraditionalShared
Clusteringk-means at each TRE, with the local clusters merged centrally (estimated)k-means with per-cluster sums and counts added each round (exact)
Mixture modelsNone listedEM algorithm with per-component totals added each round (exact)
Neural networksTrained at each TRE and comparedFederated averaging (estimated)
Gradient-boosted treesTrained at each TRE and comparedFederated XGBoost with binned gradient totals (estimated)
Random forestsTrained at each TRE and comparedMerged local trees, or binned split summaries (estimated)

Any model in the Shared Pattern can be trained with differential privacy, which adds random noise to each update to protect individuals. This makes the result an estimate, even where the algorithm would otherwise be exact.

Comparing locations

Comparing results between locations is often the aim in its own right, and is where the Traditional Pattern is strongest: any analysis that can run within a TRE can be run in full at each one.

AnalysisTraditionalShared
Describe each populationSummary tables from each TRE, compared side by sideSame as Traditional
Test for differences between locationsEstimates and standard errors from each TRE, tested centrally, including heterogeneity (Cochran’s Q, I²)A model with a location term, fitted across TREs
Replicate a findingThe same analysis run in full at each TRESame as Traditional
Validate a model agreed in advancePerformance measures (such as AUC and calibration) from each TRE, comparedSame as Traditional
Check data quality and codingCompleteness, coding frequencies and ranges from each TRE, comparedSame as Traditional

Analyses that need pooled data

These analyses depend on having individuals’ records together, so they need the Pooled Pattern.

AnalysisWhy it needs pooled data
Linking records across TREsBrings together data held about the same individuals in different TREs
Removing duplicate individualsIndividuals present in more than one TRE are otherwise counted more than once. The Traditional Pattern can only estimate how many distinct individuals there are
Different variables held for the same individualsThe Traditional and Shared Patterns assume each TRE holds the same variables for different individuals
Cox regression, not stratified by siteThe risk sets span TREs, so the model cannot be broken into parts each TRE calculates
Exploratory analysisThe method is not known in advance, so cannot be broken into results each TRE calculates