Data analysis
Data and statistical analysis
Upload your data. The studio cleans it step by step, shows every change, and gives you a cleaned file and an audit report.
1Upload your data
The first row must hold the variable names. For Excel, the first sheet is read.
Upload a file
CSV or Excel file.
Copy the cells from Excel (include the header row) or paste CSV text here, then press Load.
No data yet?
- Load 200 simulated patients to practise.
- The data is made up and has no clinical meaning.
- It does not count toward your run allowance.
- Every analysis type is open on the sample, and you can read an example results narrative.
+Optional: de-identify this file
Use this before you share data with anyone, including Datathrob. It runs in your browser and nothing is uploaded. Direct identifiers are removed or replaced with study codes, and dates become days from a reference date. You keep an encrypted key that links the codes back to your patients. Datathrob never receives it.
Link the codes back to the original IDs
- Choose the file that has the study codes. This can be the de-identified data or a results file you received with a study_id column.
- Choose your key file (.dtkey) and type its password.
- Press the button. You get the same file with the original IDs added, and dates restored where they were converted.
2Review and approve the cleaning steps
Nothing is deleted without your approval. The original file is never changed. Every action is logged.
Intake and profiling
Categorical harmonization
Plausibility limits (draft, pending clinical review)
Missing value audit
3Results
Data Quality Scorecard
Activity log
Cleaned data
4Choose your analysis
Analyses use the cleaned data from step 3. Each result is added to the audit report.
Example written in advance from the sample data. It is not clinical evidence, and Nora did not write it for your runs.
Members get a narrative like this written from their own results. To see the same numbers, run these analyses on the sample in step 4: Table 1 by group, Compare a number between two groups (sbp_after by group), Chi-square (responder and group), Survival over time (time_months, event 1, by group) and Cox regression (group, age, smoker, diabetes).
Statistical analysis
Baseline characteristics were compared between the Treatment and Control groups with Welch t tests for numbers and chi-square tests for categories. Systolic blood pressure after treatment was compared between groups with a Welch two-sample t test. The share of responders was compared with a Pearson chi-square test. Time to event was summarised with Kaplan-Meier curves and compared with the log-rank test. A Cox regression estimated hazard ratios for group, adjusted for age, smoking and diabetes. All tests were two-sided with a significance level of 0.05. No adjustment was made for multiple comparisons.
Results
The sample included 200 patients, 98 in the Treatment group and 102 in the Control group. The groups were similar at baseline in age (56.9 years, SD 10.3, versus 56.5 years, SD 11.1; p = 0.793), body mass index (26.8 versus 25.7; p = 0.105), systolic blood pressure before treatment (128.4 versus 129.1 mmHg; p = 0.754), smoking (23.5% versus 26.5%; p = 0.624) and diabetes (15.3% versus 18.6%; p = 0.532). The share of men was 37.8% in the Treatment group and 50.0% in the Control group (p = 0.081).
Systolic blood pressure after treatment was lower in the Treatment group. The mean was 116.42 mmHg (SD 17.21, n = 93) in the Treatment group and 125.41 mmHg (SD 15.59, n = 99) in the Control group. The difference in means was -8.99 mmHg (95% CI -13.68 to -4.31; t = -3.79, df = 185.2; p < 0.001; Cohen's d = -0.55).
More patients responded in the Treatment group than in the Control group: 63 of 98 (64.3%) versus 32 of 102 (31.4%) (chi-square = 21.71, df = 1; p < 0.001; Cramer's V = 0.33).
During follow-up, 34 Treatment patients (34.7%) and 47 Control patients (46.1%) had the event. Estimated survival at 30 months was 0.682 (95% CI 0.576 to 0.766) in the Treatment group and 0.574 (95% CI 0.469 to 0.665) in the Control group. The log-rank test did not show a clear difference between the curves (chi-square = 3.50, df = 1; p = 0.062). In the Cox model (200 patients, 81 events), the hazard ratio for Control versus Treatment was 1.54 (95% CI 0.98 to 2.41; p = 0.059). Higher age (HR 1.02 per year, 95% CI 1.00 to 1.05; p = 0.027) and smoking (non-smokers versus smokers, HR 0.59, 95% CI 0.37 to 0.96; p = 0.032) were linked to the event. Diabetes was not (HR 1.38, 95% CI 0.80 to 2.39; p = 0.251).
Table
| Outcome | Treatment | Control | Estimate | p-value |
|---|---|---|---|---|
| Systolic blood pressure after treatment, mean (SD), mmHg | 116.42 (17.21) | 125.41 (15.59) | Difference -8.99 (95% CI -13.68 to -4.31) | < 0.001 |
| Responders, n (%) | 63 (64.3%) | 32 (31.4%) | Chi-square 21.71 | < 0.001 |
| Event, n (%) | 34 (34.7%) | 47 (46.1%) | Log-rank chi-square 3.50 | 0.062 |
| Hazard ratio, Control vs Treatment (adjusted) | Reference: Treatment | 1.54 (95% CI 0.98 to 2.41) | 0.059 | |
Discussion points
- Blood pressure after treatment was about 9 mmHg lower with treatment, a moderate difference (d = -0.55). Baseline pressure was similar in both groups, so this difference is not explained by the starting values.
- The response rate was about twice as high with treatment (64.3% versus 31.4%).
- The survival difference favoured treatment, but the log-rank test and the confidence interval for the hazard ratio included no effect. A larger sample or longer follow-up would be needed to decide.
- Median survival times fall close to the 36-month end of follow-up, so they should be read with caution.
- Limits: the data are simulated, blood pressure after treatment was missing for some patients (93 and 99 values available), and many comparisons were made without adjustment.
Nora reads the output of the analyses you ran and drafts a statistical analysis paragraph, results text, tables and Discussion points for a manuscript. Only the text in the box below is sent. Your data rows are never sent.
Sources: analyses to include
See exactly what Nora will receive
Draft for the researcher. A statistician or the senior author should review the text before submission.
Independent checks run on the analyses
Each statistic was computed by this page and by Python on the same random test data. Each row used one random data set, not many. R was not available. Differences are the largest absolute difference found.
| Analysis | Compared with | Largest difference |
|---|---|---|
| Welch t-test, Mann-Whitney, ANOVA, Kruskal-Wallis, chi-square, Fisher exact, Pearson, Spearman | scipy 1.18 | 3.3e-9 (17 values) |
| Paired t-test (t, p, 95% CI) | scipy | 1.2e-13 |
| Wilcoxon signed-rank (exact for up to 50 pairs without ties or zeros; normal approximation otherwise) | scipy | 0 (exact), 6.7e-15 (approximation) |
| Kaplan-Meier survival, Greenwood standard error, median and its 95% CI | statsmodels 0.15 | 1.1e-16 (survival), 1.4e-17 (SE), medians and CIs identical |
| Log-rank test | statsmodels | 2.7e-15 |
| Linear regression (coefficients, SE, p, CI, R-squared, F test) | statsmodels | 5e-14 |
| Variance inflation factor | statsmodels | agrees to 6 decimals |
| Logistic regression (coefficients, SE, p, log-likelihood, likelihood ratio test) | statsmodels | 8.4e-9 |
| AUC | scikit-learn 1.9 | 1.1e-16 |
| Cox regression with Breslow ties (coefficients, SE, p, log-likelihood) | statsmodels | 1.5e-14 |
| Concordance index | Independent pair-counting code in Python | 0 |
| Newcombe 95% CI for a risk difference (3 tables) | statsmodels | 2.1e-9 |
| Decision curve net benefit (6 thresholds) | Direct calculation in Python | 1.1e-16 |
| Principal components (variance explained, eigenvalues, loadings) | scikit-learn | 1.7e-16, 1.8e-15, 2.9e-15 |
| k-means sum of squares; silhouette from the same labels | scikit-learn | identical on 3 separated clusters; silhouette 1e-15 |
| Ridge, LASSO and elastic net coefficients at fixed penalty strength | scikit-learn (ridge: closed form) | 3.9e-11 |
| Cross-validated error across the penalty path (same folds) | scikit-learn | 7.5e-13 |
| Gradient boosting predictions (same settings, regression and classification) | scikit-learn | 3.6e-15 and 2.2e-16 |
Python scripts (members): each of the 13 script types was run in Python on the 90-row test file. Coefficients, test statistics and p-values matched the studio. Cross-validated figures, the random forest and the penalty choice differ slightly because scikit-learn draws its own folds and random numbers.
Checked end to end: on a 90-row file, the linear, logistic and Cox regression tables produced by this page (including dummy coding of categories) agree with statsmodels to the rounding shown.
Not identical by design: the random forest uses random resampling, so it is checked by performance, not value by value. On the test data the out-of-bag AUC was 0.708 here and 0.707 in scikit-learn, with the same top variable and the same variable ranking. For a numeric outcome, out-of-bag R-squared was 0.633 here and 0.597 in scikit-learn. For k-means on overlapping data with 5 clusters, the best of 20 random starts here was 0.2% above the best of 30 starts in scikit-learn (the two agreed for 2, 3 and 4 clusters).
Not covered: the automatic choice between mean-based and rank-based methods is a rule of thumb. Effect sizes, the Table 1 layout, the bootstrap AUC interval, the calibration table, cross-validation fold assignment, the charts, the cost-effectiveness arithmetic (checked by hand on one example) and the proportional hazards assumption were not compared with other software.
References
Van den Broeck J, et al. Data cleaning: detecting, diagnosing, and editing data abnormalities. PLoS Med. 2005;2(10):e267. doi:10.1371/journal.pmed.0020267
Sterne JAC, et al. Multiple imputation for missing data in epidemiological and clinical research. BMJ. 2009;338:b2393. doi:10.1136/bmj.b2393
Kaplan EL, Meier P. Nonparametric estimation from incomplete observations. J Am Stat Assoc. 1958;53(282):457-481. doi:10.1080/01621459.1958.10501452
Cox DR. Regression models and life-tables. J R Stat Soc Series B. 1972;34(2):187-220. doi:10.1111/j.2517-6161.1972.tb00899.x
Wilcoxon F. Individual comparisons by ranking methods. Biometrics Bulletin. 1945;1(6):80-83. doi:10.2307/3001968
Newcombe RG. Interval estimation for the difference between independent proportions: comparison of eleven methods. Stat Med. 1998;17(8):873-890. doi:10.1002/(SICI)1097-0258(19980430)17:8<873::AID-SIM779>3.0.CO;2-I
Altman DG. Confidence intervals for the number needed to treat. BMJ. 1998;317(7168):1309-1312. doi:10.1136/bmj.317.7168.1309
Vickers AJ, Elkin EB. Decision curve analysis: a novel method for evaluating prediction models. Med Decis Making. 2006;26(6):565-574. doi:10.1177/0272989X06295361
Hoerl AE, Kennard RW. Ridge regression: biased estimation for nonorthogonal problems. Technometrics. 1970;12(1):55-67. doi:10.1080/00401706.1970.10488634
Tibshirani R. Regression shrinkage and selection via the lasso. J R Stat Soc Series B. 1996;58(1):267-288. doi:10.1111/j.2517-6161.1996.tb02080.x
Zou H, Hastie T. Regularization and variable selection via the elastic net. J R Stat Soc Series B. 2005;67(2):301-320. doi:10.1111/j.1467-9868.2005.00503.x
Jolliffe IT, Cadima J. Principal component analysis: a review and recent developments. Philos Trans A. 2016;374(2065):20150202. doi:10.1098/rsta.2015.0202
Rousseeuw PJ. Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. J Comput Appl Math. 1987;20:53-65. doi:10.1016/0377-0427(87)90125-7
Breiman L. Random forests. Mach Learn. 2001;45:5-32. doi:10.1023/A:1010933404324
Friedman JH. Greedy function approximation: a gradient boosting machine. Ann Stat. 2001;29(5):1189-1232. doi:10.1214/aos/1013203451
The plausibility limits are a draft based on clinical judgment and have not been reviewed or sourced. Uniqueness is added to the Kahn categories. Version 0.4. Datathrob. Clinical research made simple.