Docs · Research
Data Studio: statistics, graphs, Python and R
Every dataset opens in a studio with SPSS-style menus: Data (select, sort, restructure, merge), Transform (recode, standardize, rank, bin, impute…), Analyze (45 analyses from frequencies to Cox regression, factor analysis and clustering), Graphs, a Python/R code runner and an Assistant tab your own AI agent works through. Every result is saved in the Output viewer with the syntax that reproduces it.
The studio at a glance
Project → Data lists the datasets; creating or importing one opens the studio: six tabs (Data · Variables · Output · Graphs · Code · Assistant) under a menu bar (File · Data · Transform · Analyze · Graphs · Code). The Analyze menu opens with a search box and a “Common” shortlist in plain language (compare two groups, predict a yes/no outcome…) above the full catalogue.
| Tab | What it holds |
|---|---|
| Data | The case grid: click a cell and type, Enter moves down, Tab moves right, paste a block from a spreadsheet. Toolbar: undo/redo, add or delete rows, add variable, compute, select cases, pivot, export, history, value labels. |
| Variables | The codebook: one row per variable with name, label, type, measure, value labels, missing values and width. |
| Output | Every saved result: analyses, code runs and AI answers, pinned ones first. Tables copy as tab-separated text; charts export as SVG or 300-DPI PNG; the syntax that reproduces an analysis is one click away. |
| Graphs | The chart builder bound to this dataset: bar, line, scatter, box, histogram, Kaplan–Meier, bubble, forest and funnel plots with journal presets. |
| Code | Write Python or R against the dataset and run it in the sandbox; the script, printed output, tables and figures are saved together. |
| Assistant | Where your AI agent works on this dataset: it describes the variables, runs analyses from the catalogue and sandboxed Python or R, and the outputs land in Output. Where an administrator has switched platform AI on, you can also type the question here. |
The graphs hub tab moved here: figures belong with the data they draw. The datasets page also has project-wide Outputs and Graphs tabs.
Code — Python and R
The Code tab runs your own script in an isolated sandbox (no network, three-minute limit) against the active cases. Python has pandas, numpy, scipy, statsmodels, lifelines, scikit-learn, seaborn/matplotlib and pingouin; R has survival, ggplot2, lme4, metafor, meta, pROC, car, emmeans, psych, irr, nnet and ordinal.
Python: numbers with hikma.result, tables with hikma.table, figures with hikma.figure(name, fig, caption)
import pandas as pd
d = pd.read_csv(DATA_PATH + "/data.csv")
hikma.result("n", len(d), label="Cases")
hikma.table("means", d.groupby("arm")["sbp"].mean().reset_index(), "Mean SBP by arm")R: hikma$data() reads the cases; hikma$result / hikma$table / hikma$figure report
d <- hikma$data()
m <- coxph(survival::Surv(time, status) ~ group, data = d)
hikma$table("hr", as.data.frame(summary(m)$conf.int), "Hazard ratios")
hikma$figure("km", function() plot(survival::survfit(survival::Surv(time, status) ~ group, data = d)), "Kaplan–Meier")Templates in the tab give you a starting script for descriptives, tests, mixed models, Cox models and plots. Every run is saved to Output with its script, so a reviewer can rerun it.
Analysing with AI
Ask your connected agent (project → Your AI) about the dataset in plain language — “does systolic blood pressure differ between arms after adjusting for age?”. Over MCP it describes the dataset and its variable dictionary, runs analyses from the catalogue, writes and runs sandboxed Python or R for what the catalogue cannot express, and reads the results back; every output lands in the Output viewer with the syntax that reproduces it, so its interpretation can be checked number by number.
The Assistant tab's own question box — type a question, the platform plans 1–6 steps, runs them and writes the interpretation from the returned results only — needs platform AI switched on by an administrator. In the default mode the tab explains where to ask instead.
- Describe what you want to know, naming the project and the dataset.
- The steps are planned against the variable dictionary, preferring analyses from the catalogue over hand-written code.
- Each step runs on your real data in the sandbox; nothing is estimated.
- The interpretation must come from the returned tables — every number copied, with caveats — because that is all the results contain.
- The answer, its steps and their tables are saved to Output and listed under Earlier questions.
From an MCP client (Claude, Codex, Cursor…), the same power is available through describe_dataset, list_analysis_catalog, run_dataset_analysis, transform_dataset, dataset_cases, run_dataset_code and list_dataset_outputs.
From Output into the manuscript
Every saved output has “Insert into manuscript”: choose the manuscript, what to include (the summary sentence, the tables, the charts) and where; the tables arrive as real tables, the charts as figures with captions, all as tracked changes attributed to whoever inserted them — “Claude Code” or whatever your connected agent is called — so co-authors can accept or reject them. Meta-analysis results, risk-of-bias and Summary-of-Findings tables insert the same way from their own pages.
Identifier scan and de-identification
Every dataset is scanned when it is created or imported: variable names, labels and a sample of values are checked for direct identifiers (names, e-mail addresses, telephone numbers, postal addresses, national or hospital numbers, dates of birth, device identifiers). A red or amber banner in the studio lists the flagged columns with the reason. Remove or recode them (Variables tab, Transform › Recode), re-scan, or record an attestation that the data are de-identified — the attestation is kept with the dataset's history with your name and the time. Study codes issued by the project are flagged as “possible” only so you can confirm them.
Graphs — from the dataset, saved as outputs
The Graphs tab (and Graphs › New graph) builds a figure from the dataset's own variables: bar (counts or a summary by category, stacked), line, pie, mean ± SD/SE/95% CI, scatter with trend line, box plot, histogram, Kaplan–Meier with log-rank, bubble, forest and funnel plots. Map the variables and the graph draws at once; style it (title, axes, palette, journal size) and press “Save graph” — it is stored in Output as a chart result with its settings, so you can reopen it with “Edit graph”, export it as SVG or 300-DPI PNG, and copy it to project files. The project's Data › Graphs gallery lists every saved graph across datasets; “New graph” always starts from a dataset. Numbers that are not in any dataset can still be graphed from the gallery's “typed values” panel.
Analyses save their own charts too (histograms with normal curve, Q–Q, error bars, ROC, survival curves, forest plots), and the Analysis hub's “Run an analysis” opens the chosen procedure on the chosen dataset in one step.
Output viewer
- Pin what matters; rename outputs; delete drafts.
- Copy any table as tab-separated text for Word or Excel; export any chart as SVG or 300-DPI PNG.
- Analyses carry a Hikma syntax line (ANALYZE …) — the exact specification that produced them.
- The datasets page → Outputs lists results across all datasets of the project.
Related
Something missing or wrong? Tell us.