StatsWithR StatDesk
Export data
Download the current data set.
Name the export
The extension is added automatically.
Choose an export format
Use StatDesk JSON, SPSS syntax, or Stata do-file export to preserve labels.
SPSS/Stata syntax exports rebuild the data and labels in those programs.
Calculate variables
Create variables from formulas.
Create a calculated variable
Use R-like formulas such as ifelse(petal_width > mean(petal_width), 1, 0). Bare names work; use brackets for names with spaces.
Formula function reference
Variable references
Use bare names such as age; use brackets for names with spaces.
Examples: age, pre_score - post_score, [pre score] - [post score].
Operators
+, -, *, /, ^, %%, %/%, and parentheses. JavaScript-style ** still works, but ^ is recommended for R-like exponent syntax.
Comparisons: ==, !=, >, >=, <, <=. Logical operators: R-style &, |, ! and JavaScript-style &&, ||.
Math functions
abs, sqrt, log, log10, exp, round, floor, ceiling/ceil, pow, sin, cos, tan.
Examples: sqrt(variance), round(score, 2), x^2, ceiling(score).
Row summaries
min, max, pmin, pmax, sum, mean, median, sd, and var work across values supplied in the same row.
Examples: mean(petal_width) for a column mean, mean(item1, item2, item3) for a row-wise mean, and ifelse(petal_width > mean(petal_width), 1, 0).
Conditional logic
ifelse(condition, value_if_true, value_if_false).
Examples: ifelse(age >= 18, 1, 0), ifelse(group == "Treatment", 1, 0), ifelse(score > mean(item1, item2), "High", "Low").
Missing values and text
missing/is.na, notmissing, as.numeric/asNumber, nchar/len, tolower/lower, toupper/upper, grepl, contains, paste, and paste0.
Examples: ifelse(is.na(score), 0, score), tolower(group), grepl("yes", notes), paste0(group, "_", score).
Variable labels
Edit variable labels.
Edit labels
Use StatDesk JSON, SPSS syntax, or Stata do-file export to preserve labels.
Missing value recoding
Convert selected values to empty cells.
Recode indicators to empty cells
Enter values to convert to empty cells.
Plots
CanvasExport the current plot as a PNG.
Save and restore your work
Save or restore your session.
Autosave status: not saved yet
Includes data, output, labels, settings, and plot state.
What gets saved
- Browser autosave: restores the most recent session after a refresh or browser restart when browser storage is available. Autosave uses the same compact state format to reduce browser storage use.
- Application state file: downloads a compact portable JSON file containing the current data, labels, variable type settings, output, selected analysis, paging, tabs, plot settings, and StatDesk version information.
- Local-only storage: browser autosave is stored locally with IndexedDB. This feature does not send your data to a server.
- Long-term backup: use Save application state file when you want a file you can keep, move to another computer, or reload later.
- Privacy reminder: only load saved state files that you created or trust, because session files can contain output text and project data.
- Browser limits: private browsing, clearing site data, storage quotas, or mobile browser cleanup can remove the browser autosave copy.
Accuracy tests
Version and citation
Created by Michael Harris, MS, MAS for StatsWithR.com.
Recommended citation
Harris, M. (2026). StatsWithR StatDesk (Version 0.9) [Computer software]. StatsWithR.com. https://www.statswithr.com/statdesk
BibTeX / software citation
@software{harris2026statdesk,
author = {Harris, Michael},
title = {StatsWithR StatDesk},
version = {0.9},
year = {2026},
url = {https://www.statswithr.com/statdesk},
note = {Statistical analysis software by Michael Harris, MS, MAS.}
}
Quick start
- Load the iris sample, import a file, or enter data in the grid.
- Check variable types in the left panel and change any that are incorrect.
- Choose an analysis, select variables, and run it.
- Compare important results with R or another trusted source.
Data and variables
- Edit cells directly in Data View.
- Use Undo and Redo for recent data edits.
- Use Variable labels for readable labels in exports.
- Use Missing values to convert selected codes to empty cells.
Calculated variables
- Use R-like formulas:
ifelse(petal_width > mean(petal_width), 1, 0). - Bare names work for simple variables; use brackets for names with spaces.
mean(variable),sd(variable), and similar summaries use the full column.mean(item1, item2, item3)summarizes row values.- The formula stays in the editor after the variable is created.
Formula reference
- Operators:
+,-,*,/,^,%%,%/%,&,|,!. - Math:
abs,sqrt,log,round,floor,ceiling,min,max,sum,mean,median,sd,var. - Logic/text:
ifelse,is.na,as.numeric,nchar,tolower,toupper,grepl,paste,paste0.
Analyses and output
- Analysis Setup shows the required fields for the selected method.
- The R code panel shows comparable R syntax for review.
- Use Output to review results and export a PDF.
- Use Plots to create and export common exploratory graphics.
Save, restore, and export
- Autosave stores the current session in this browser.
- Export a session file to move work between browsers or devices.
- Use StatDesk JSON to preserve data, labels, and variable types.
- Use CSV/TSV for broad compatibility.
- Use SPSS or Stata syntax exports when labels need to carry into those programs.
Accuracy tests
- Accuracy tests are development checks for the browser calculations.
- Passing tests do not make the app fully validated.
- Methods still need review by multiple qualified experts.
Supported file formats
- Import: CSV, TSV/TXT, JSON, StatDesk JSON, XLSX, Excel XML/HTML tables, SPSS SAV, Stata DTA, SPSS syntax, and Stata do-files.
- Export: CSV, TSV, JSON, StatDesk JSON, HTML table, Excel XML, SPSS syntax, and Stata do-file.
- Native SPSS/Stata imports are best-effort. Use syntax exports for label-preserving handoff.
Legal and use disclaimer
- StatDesk is beta software. Results are experimental and may contain errors.
- Do not rely on StatDesk as the sole source for clinical, regulatory, legal, financial, publication-critical, or high-stakes decisions.
- Users are responsible for verifying results with trusted statistical software, source data review, and qualified expert judgment.
- Accuracy of all methods should be reviewed by multiple qualified experts before the software is treated as validated.
- The software is provided without warranty; use is at the user's own risk.