What this calculator does
Linear Regression is Module 5 of Analysis Studio, and it is a free module. It explains or predicts a continuous outcome from continuous, binary, and categorical predictors, with dummy or deviation coding, two-way interactions you specify, mean centering, and hierarchical blocks with change tests. Factorial ANOVA arrives through the same machinery, with Type III tables under sum-to-zero contrasts.
The inferential choices are the ones working analysts actually reach for:
- Standard errors: classical, heteroskedasticity-consistent (HC0 through HC3), or cluster-robust (CR1)
- Under a survey design, a design-based sandwich from the Studio variance engine, matching the standard survey-package fit
- Diagnostics on the same screen: variance inflation factors, Cook distance, studentized residuals, and the Koenker studentized Breusch-Pagan test
- Predictions with confidence and prediction intervals, and estimated marginal means on request
Outputs include the coefficient table with standardized coefficients, the model summary, ANOVA and block-change tables, and a diagnostics panel. Stepwise selection is not offered, deliberately: automated selection produces confident models that travel badly, and the module declines to lend it machinery.
The method, in plain terms
The fit is by QR decomposition of the predictor matrix, the numerically stable route. Each coefficient reads as the expected change in the outcome for a one-unit increase in its predictor, with the others held fixed. The standard error decides which of those readings the data support, and the choice of standard error formula decides how much the fit trusts its own assumptions: classical errors assume constant residual variance, the HC family relaxes that, and cluster-robust errors relax independence within clusters as well.
Worked example
Eight points, one predictor. x runs from one to eight; y reads 3, 5, 6, 8, 10, 11, 13, 15.
- Intercept: 1.321
- Slope: 1.679, with standard error 0.046
- t for the slope: 36.406
- R squared: 0.996
The slope says each additional unit of x carries an expected 1.68 additional units of y, and the fit is tight, as the R squared near one states. Two cautions ride with any such clean example, and the module prints the machinery for both: eight points cannot support a second predictor with any honesty, and a single outlying case at this size can carry the slope. Cook distance is on the diagnostics panel to check the second point, and the first is a judgment the design has to make before fitting.
When the calculator fits, and when it does not
It fits when:
- The outcome is continuous and the relationship is plausibly linear, or transformable to linear, in the predictors.
- The report needs defensible standard errors: robust for uneven residual variance, cluster-robust for grouped data, design-based for survey data.
- Models are built in blocks with stated reasons, and the change in R squared between blocks is part of the question.
It does not fit when:
- The outcome is binary, a count, or ordered categories. Modules 6 and 14 carry those models.
- Cases are clustered with random effects that are themselves of interest, as in students within schools studied for the school variance. That is Module 15.
- The aim is pure prediction at scale. Machine learning prediction is outside the Studio scope by design; this module is for estimation and explanation.
Run it
Module 5: Linear RegressionOpen in Analysis Studio →Load your data, choose the outcome and predictors, pick the standard error form your design calls for, and read the diagnostics panel with the coefficients.
Questions
Which standard errors should I use? Match them to the design. Classical when the classical assumptions are a fair description. HC3 as a sound default when residual variance may vary. Cluster-robust when cases arrive in groups that share unmeasured influences. Design-based when the data come from a declared survey design, where the module applies it automatically.
What does a VIF tell me? How much a predictor variance is inflated by its correlation with the other predictors. Values past five deserve a look and past ten a decision: combine, drop, or accept wider intervals with the reason stated. The module prints VIF for every predictor so collinearity is diagnosed rather than suspected.
Why is stepwise not offered? Because stepwise models overfit by construction: they capitalize on the noise in the sample at hand, their p values lose their meaning, and their coefficients bias away from zero. Blocks chosen on subject grounds, with change tests, answer the same modeling questions honestly.
Can I include a categorical predictor? Yes. Nominal predictors enter with dummy or deviation coding chosen by you, and a categorical predictor with several levels can carry an interaction with a continuous one. Factorial ANOVA through categorical predictors is part of the same module.
What is the difference between confidence and prediction intervals? A confidence interval locates the mean outcome at given predictor values. A prediction interval locates one new case, and is always wider because individual variation adds to estimation uncertainty. The module offers both and labels each.