Guided analysis
Linear regression coefficients
A continuous outcome, a set of covariates, and a Table 3 of coefficients: unadjusted and adjusted side by side in the outcome's own units, a forest plot with its null at 0, residual diagnostics drawn for you, and continuous covariates reported per a clinically meaningful step.
Adjust for what else is going on
A group comparison tells you whether a continuous outcome differs between groups. Linear regression answers the next question: by how much, after accounting for the other things that differ between patients? Each covariate gets a coefficient — the change in the outcome, in its own units, per increment (for a number) or versus a reference level (for a category).
Unadjusted coefficients come from one model per covariate. Adjusted coefficients come from a single joint model, so each one is the effect of that variable with the others held fixed. When a treatment is given more often to sicker patients, the unadjusted column carries their longer stays and the adjusted column does not.
What a coefficient is, and is not
A coefficient is a difference in means. For a category it is the mean outcome in that level minus the mean in the reference level, holding the other covariates fixed. For a number it is the change in the outcome per increment — set the increment (for example age per 10 years) so that one step is clinically meaningful; the confidence interval scales with it and the p-value does not.
It is a difference on the outcome's own scale, not a ratio and not a percentage. "New treatment: −1.5 (−2.0 to −1.0)" for length of stay means one and a half fewer days on average, not 1.5 times anything. A coefficient of 0 is no difference, which is why the forest plot's dashed line sits at 0.
Is linear regression appropriate?
Use it when each row is one independent participant, the outcome is a continuous measurement (days, mmHg, a score), and you have the baseline covariates you want to adjust for. The tool needs at least 10 residual degrees of freedom before it will fit a model, and it drops rows with a missing value in any column you use.
It checks the residuals for normality (Shapiro–Wilk) and for constant variance across fitted values (Breusch–Pagan), and it draws both checks as a residuals-vs-fitted plot and a normal Q-Q plot. It also flags multicollinearity among numeric covariates, covariates that are exact combinations of others, and influential observations. Every check is advisory — none blocks a result or changes a number. The tool does not transform the outcome, fit robust standard errors, or add interaction terms; if the residual checks warn, that is the moment to seek statistical review.
How to read the result
- β < 0: a lower outcome. β > 0: higher. The units are the outcome's own.
- A numeric covariate's β is per increment (for example per 10 years).
- A category's β is versus its reference level, shown as "0 (reference)".
- A 95% CI that crosses 0 means the effect is not statistically resolved. It does not mean there is no effect.
- R² is the share of the outcome's variance the joint model explains; adjusted R² penalises it for the number of terms. A low R² with a precise coefficient is common and not a problem — the question is the coefficient, not the fit.
- Adjusted coefficients are adjusted only for the covariates you put in the model.
With fewer than about 10 observations per model term, adjusted estimates become unstable — the tool warns you when that happens.
Example output
| Characteristic | Unadjusted β (95% CI, p) | Adjusted β (95% CI, p) |
|---|---|---|
| arm (reference: Standard care) | 0 (reference) | 0 (reference) |
| New treatment | 0.06 (-0.50 to 0.63, p=0.830) | -1.47 (-2.05 to -0.90, p<0.001) |
| age (per 10 units) | 0.66 (0.36 to 0.96, p<0.001) | 0.84 (0.55 to 1.12, p<0.001) |
| stage (reference: I) | 0 (reference) | 0 (reference) |
| II | 0.94 (0.32 to 1.56, p=0.003) | 1.30 (0.70 to 1.90, p<0.001) |
| III | 2.37 (1.72 to 3.02, p<0.001) | 3.00 (2.33 to 3.67, p<0.001) |
The text Figura produced for this example, ready to paste into a methods section:
Characteristic Unadjusted β (95% CI, p) Adjusted β (95% CI, p) arm (reference: Standard care) New treatment 0.06 (-0.50 to 0.63, p=0.830) -1.47 (-2.05 to -0.90, p<0.001) age (per 10 units) 0.66 (0.36 to 0.96, p<0.001) 0.84 (0.55 to 1.12, p<0.001) stage (reference: I) II 0.94 (0.32 to 1.56, p=0.003) 1.30 (0.70 to 1.90, p<0.001) III 2.37 (1.72 to 3.02, p<0.001) 3.00 (2.33 to 3.67, p<0.001) Multivariable linear regression (n = 320) of los adjusted for arm, age, stage. Unadjusted coefficients are from single-covariate models; adjusted coefficients are from the joint model (R² = 0.246, adjusted R² = 0.237). 18 observation(s) were flagged as influential (Cook's distance > 4/n); inspect them for data-entry errors. Analyses were performed with Figura (Saha, 2026; https://figurastats.org), which runs R with the ggplot2 package in the browser.
Sample data
Download sample.csv — 320 rows, columns arm, age, stage, los. A frozen synthetic dataset generated by a script in the repository's data-raw/ folder; nothing in it is a real patient.
How to cite
Journals ask for a software statement. The methods text Figura generates already ends with one; this is the same attribution in reference form.
Saha S. Figura: clinical manuscript figures and statistics in the browser. 2026. https://figurastats.org
@misc{figura2026,
author = {Saha, Sandeep},
title = {Figura: clinical manuscript figures and statistics in the browser},
year = {2026},
url = {https://figurastats.org},
note = {Accessed <date>}
}