UHDmedi · Local installation & walkthrough

Mediation analysis,
on your own computer.

A step-by-step guide to installing the workbench, running a Factor example and saving your results.

Download the complete workbench, install its dependencies once, and run analyses on your own computer. The download includes the browser interface, R analysis source, Python support and all five simulation datasets.

Windows walkthroughR + PythonFive included datasets
  1. Download and extract the workbench

    Save UHDmedi-local-workbench.zip, right-click the ZIP and choose Extract All. Open the extracted UHDmedi-local-workbench folder. Keep its files together; run the launchers from this folder, outside the ZIP.

    1-Setup.cmdInstall dependencies once
    2-Start-Workbench.cmdStart the workbench whenever you need it
    app/Website, analysis code and example CSVs
    Local-user-guide.htmlThis illustrated guide, available offline
    docs/workbench-demo.mp4The video walkthrough, available offline
  2. Install R and Python

    You need a 64-bit installation of R for Windows and Python 3.11 or 3.12. If both are already installed, continue to the next step. For a new Python installation, enable Add python.exe to PATH. RStudio is optional.

    The setup step needs an internet connection to download R packages and the Python libraries used by MediEncoder. It creates a project-specific environment inside the extracted folder.

  3. Run the one-time setup

    Double-click 1-Setup.cmd and keep the setup window open until it finishes. This installs dependencies for Sparsity, Linear factor, MediEncoder and missing-data handling, and attempts to install the optional multiply robust method.

    Read the final dependency check before closing the window. If the optional multiply robust dependencies are unavailable, the three main methods can still be used when their checks pass. The interface shows which methods are ready.

    Only once per extracted copy. You do not need to repeat setup each time you open the app.
  4. Start your local website

    Double-click 2-Start-Workbench.cmd. Leave its window open while using the workbench. Open http://127.0.0.1:8765/ in your browser if it does not open automatically. The sidebar should report Local R service connected. On the first launch, dependency checks can take a minute; wait for this status before running an analysis.

    Closing the server window stops the local website. Start it again with the same launcher next time. Opening index.html alone displays the interface without starting the analysis service.

    The extracted local workbench, connected to its local R service. Choose the Factor example to begin.
    The extracted local workbench, connected to its local R service. Choose the Factor example to begin.
  5. Follow the Factor example

    This is the same synthetic example used in the video: 300 observations, 400 X measurements and 500 M measurements.

    Data → Variables

    In the Factor card, click Load example. Roles are filled for you: outcome is Y, treatment is A, x_measure_* are X and m_measure_* are M. Leave sample_id ignored. Confirm that control is 0 and treated is 1, then click Confirm variables.

    Preprocessing → Analysis path

    The example is complete, so keep Keep data unchanged. Review the treatment-assignment overlap plot, then click Continue to analysis path. Under What do you observe?, choose Noisy measurements, followed by Linear factor. Click Continue to settings.

    Confirm the outcome, treatment, covariates and mediators before continuing.
    Confirm the outcome, treatment, covariates and mediators before continuing.

    Settings & run

    Keep Cumulative explained variance at 50% and Center and standardize. The example selects two factors for X and two for M. Expand Variance & scree plot to inspect the choice.

    Turn on Bootstrap Uncertainty and set Completed bootstrap replicates to 20 for this walkthrough. To include the video’s four-cell sensitivity grid, turn on Sensitivity to latent dimensions and use the ranges below.

    Small dimension grid for the tutorial
    SettingFromToStep
    Mediator dimensions121
    Covariate dimensions231

    The grid refits four dimension pairs; your primary estimate still uses the two factor counts selected above. Click Run analysis and wait for Completed R analysis.

    The Factor example at the 50% cumulative-variance threshold selects two dimensions for each block.
    The Factor example at the 50% cumulative-variance threshold selects two dimensions for each block.
    A quick demonstration. Twenty bootstrap refits exercise the workflow. Use a larger target for final uncertainty analysis. Runtime depends on your computer and the settings; the video shortens the waiting time.
  6. Read and save your results

    NIE is the natural indirect effect, NDE is the natural direct effect and TE is the total effect. Read their estimates and confidence intervals together. An interval containing zero does not establish that the effect is exactly zero.

    In the sensitivity panel, switch among NIE, NDE and TE to see how the point estimates change with the dimension pair. This checks sensitivity to tuning choices, not to unmeasured confounding.

    Choose Download CSV for the effect table and Download analysis record for the run configuration, results and diagnostics. Save them before starting a new session. If you change the inputs or settings, rerun the analysis to obtain results for the new configuration.

    A completed run reports indirect, direct and total effects with the selected uncertainty estimates.
    A completed run reports indirect, direct and total effects with the selected uncertainty estimates.

Try another example

Choose the interpretation that matches how the data were generated
ExampleYour answerAnalysis path
SparsityObserved covariates and mediatorsSparsity; regularization applies to coefficients of X and M.
FactorNoisy measurementsChoose Linear factor or MediEncoder.
Low-dimensionalObserved covariates and mediatorsMultiply robust, when its optional dependencies are installed.
Sparsity · low-dimensional XObserved covariates and mediatorsSparsity; coefficients of X remain unpenalized.
Factor · low-dimensional XNoisy measurementsX remains observed; only M receives a factor representation.

The last three examples are under More simulation datasets. For Sparsity, enable Sensitivity to balancing constants K₁ and K₂ to obtain a data-checked recommended range automatically. Adjust the two range bars if needed; the grid can contain at most 81 combinations per run. For factor methods, the variance slider offers 10%, 15%, …, 95%, 99%, and Eigenvalue ratio is an alternative dimension-selection rule.

Use your own CSV

Keep one observation per row and unique column names. Choose Choose CSV file, then assign one numeric Y, one binary A, numeric mediator columns M and baseline covariates X. X may contain categorical variables; the analysis service encodes them. Ignore identifiers and unrelated columns. Use Bulk assignment when there are many columns, and check the control/treated labels.

Choose a missing-data approach before continuing. Complete observations removes affected rows; mean/mode or median/mode fills them once; MICE multiple imputation creates several datasets and pools results. Simple imputation does not account for missing-value uncertainty. MICE with the factor methods requires bootstrap uncertainty.

Answer the measurement question based on your study. For observed variables, the app checks dimensions and routes to Sparsity or the multiply robust estimator. For noisy measurements, you choose Linear factor or MediEncoder. Low-dimensional X is retained directly. The treatment-overlap diagnostic is a useful data check; causal interpretation still requires the identification assumptions described in the papers.

If something does not open

The browser cannot reach the local page
Check that the start window is still open, and read its message. If port 8765 is already in use, close your previous workbench window or follow the launcher’s instructions.
A method is unavailable
Review the setup dependency check. Install the missing dependency, then restart the workbench. The local page does not substitute another estimator silently.
The Run button is disabled
Read the message beside the button. Confirm variable roles, complete the measurement question and correct any out-of-range setting or oversized sensitivity grid.
An analysis does not complete
Read its status and download the available diagnostic record. Adjust settings only when the message explains what needs to change; an incomplete computation is not a completed estimate.

The first image shows the extracted workbench running locally. The remaining images are from the recorded demonstration and use the same workflow and controls. Guide prepared October 4, 2026.