Research & PolicyFree
Statistical Methods Section From Your Code
Every model the script actually fitted, the number of rows each one used, and the standard errors the code asked for, not the ones you remember.
River reads your analysis script and builds a register of every model it actually fits, then writes the methods section from that register. Each row carries the estimator, the exact right-hand side, the standard error the code requested, the software with its non-default options, and the number of rows the model really used. Anything the script does not settle is marked as a decision you still owe rather than filled in with the plausible default.
Every guide on this query asks you to describe your analysis, so you describe the one you designed. The code holds the one that ran, and the gap is mostly missing data. R's reference page for lm says the factory-fresh default is na.omit, so a row with one missing covariate leaves without a message. Python behaves differently again: statsmodels ships missing='none', where no nan checking is done. Same data, same model, two different samples, neither announced.
Built for the author whose reviewer asked which N belongs to which table, the candidate writing methods eighteen months after the analysis, and anyone who inherited a script from someone who left. Run it before the results are drafted, because a specification you cannot account for is one you may have to remove. The cleaning record is where the analytic sample comes from, the results section writer takes the output block afterwards, and more research packs sit alongside this one. The table and figure formatter turns that output into what the journal will accept.
Half the sample, and nobody chose it
One illustrative workforce study reports an analytic sample of 3,465 and fits its headline model on 1,729 rows. The loss arrives as a cascade. The bivariate model drops 63 rows for a missing job-demand item. Adding supervisor support costs 54 more, tenure and contract type another 225, and the overtime measure a further 1,394. That is 1,736 rows gone, 49.9 per cent of the sample the paper describes, and no sentence in the methods section accounts for one of them.
The size is not the real problem. Of the 1,547 rows carrying no overtime value, 1,422 were never asked the question, because their contract has no overtime provision. So the headline estimate is about employees whose contract carries an overtime clause, not about employees. Nobody decided that. A default deleted the rows and the paper inherited a narrower claim than the one it makes. STROBE asks authors to explain how missing data were addressed.
The same script fits fourteen models and the paper reports three. The register sorts the other eleven into four sensitivity analyses and two subgroup models a standard wants described, three abandoned mis-specifications, and two duplicates of a reported fit. It also catches the sentence nobody checks. The clustered standard errors exist in the script as a separate object, and the table was built from the classical fit. The draft says clustered. The table is not, and one of the two has to change.
How it works
Send the code
The script or notebook, your design notes, and the standard the journal expects you to meet.
Register the specifications
One row per model the script fits, with its estimator, its right-hand side and its row count.
Reconcile the counts
Each model's N against the analytic sample, with the reason for every row the software deleted.
Write, then flag
The methods prose, with anything the code cannot settle listed as a decision you still owe.
What you get
- The methods section as a Doc, with every statement traceable to the line of code behind it
- The specification register as a Sheet: one row per model the script fits, reported or not
- The row count each model actually used, set against the analytic N your paper describes
- The standard error type as the code requested it, flagged wherever your draft disagrees
- Software, package and version for everything the analysis loaded, in the form a replicator needs
- Every claim the code cannot support named as an open decision instead of filled with a default
Common questions
Does it re-run my analysis?
No. It reads the code to find out what the code did, then writes the section describing it. Nothing is re-estimated and your data is never needed. If the script's own printed output is available too, it reconciles the two and reports where they disagree, which is usually a stale table.
My script has no comments and I did not write it.
Then it writes what can be written and lists what cannot. A script with no comments still states the estimator, the variables, the deletion rule and the package. What it cannot supply is why a covariate set was chosen, so that arrives as a numbered question rather than a confident sentence you would have to defend.
Which languages and packages does it read?
R, Stata, Python, SAS and SPSS syntax, plus notebooks and shell scripts that chain them. The defaults differ in ways that change the sample, which is the reason it reads the code rather than a summary. A do-file and an R script performing the same analysis produce two different methods sections, correctly.
What if a model's N does not match the table it produced?
It flags them. A model fitted on a different number of rows than the table it supposedly produced means the table is stale, the object was renamed, or a filter moved. All three are worth knowing before a reviewer finds them, and the register shows which of the three it is.
Will it list models I never reported?
Yes, and that is the point of the register. Every specification the script fits gets a row, whether or not it reached the paper. Sensitivity analyses and subgroup models are then named in the draft, because a standard asks for them, while abandoned mis-specifications and duplicate fits are marked as not requiring disclosure.
Which reporting standard does it write to?
Whichever one you name in the intake, and the section is organised to answer its items in its order. Pick a reporting guideline, a journal's own instructions, or a style standard, and the draft is checked against it item by item with anything unmet listed. Nothing is silently skipped.
Does it record software versions?
Yes. Version numbers are what a replicator needs and what nobody records, so it reads them from the session information, the lock file or the log if any of those exist, and asks for them if none do. Every package the analysis loaded appears, not only the modelling one. The researcher workspace keeps the script and the section in one project.
Statistical Methods Section From Your Code
Fill in the form and your workspace opens with the work already underway.