Calculator
Example data table
| Y | X1 | X2 | X3 | X4 |
|---|---|---|---|---|
| 42 | 3 | 7 | 1 | 10 |
| 45 | 4 | 8 | 1 | 11 |
| 47 | 5 | 8 | 2 | 10 |
| 50 | 6 | 9 | 2 | 12 |
| 52 | 7 | 10 | 3 | 13 |
| 55 | 8 | 11 | 3 | 14 |
How to use this calculator
- Paste your numeric dataset with headers.
- Select the target column and candidate predictors.
- Choose method and criterion for selection.
- Run the tool to see selected variables and metrics.
- Download CSV or PDF to save the output.
Formula used
Notes
- Stepwise procedures may select unstable models on small samples.
- Strongly correlated predictors can cause near-singular matrices.
- Use domain knowledge and out-of-sample testing when possible.
Why stepwise regression is used in practice
Stepwise regression is a practical way to narrow a wide predictor list into a compact linear model. The tool starts from an initial set (or none) and then adds or removes one variable at a time. Each step must improve the chosen criterion, so the process stops automatically when extra complexity no longer earns better fit. This is useful when you need an interpretable equation rather than a black-box predictor.
How the tool evaluates candidate predictors
This calculator scores every trial model using AIC, BIC, or adjusted R². AIC rewards goodness of fit but penalizes each parameter by 2k, often selecting slightly richer models. BIC applies a stronger penalty using k ln(n), so it tends to be more conservative as sample size grows. Adjusted R² rises only when the new variable improves fit more than expected by chance.
Interpreting coefficients and diagnostics
After selection, coefficients are estimated with ordinary least squares using β = (XᵀX)⁻¹Xᵀy and predictions ŷ = Xβ. The results panel reports RMSE, SSE, and both R² measures, so you can compare error scale and explained variance. Standardized betas help compare relative influence when predictors use different units. Variance inflation factors highlight multicollinearity; values above about 5–10 suggest unstable estimates.
Common data preparation choices
Clean inputs matter. The dataset must be numeric, with one header row and consistent columns. For missing values, “Drop incomplete rows” keeps only complete cases, while mean imputation fills required columns using column averages to preserve row count. Standardizing predictors converts each selected X to a z-score (x−mean)/sd, which can improve numerical stability and makes coefficient magnitudes more comparable, but it also changes the interpretation of raw slopes.
Validation and reporting for stakeholders
Selection can overfit, so the tool offers optional k-fold cross-validation RMSE for a sanity check on generalization. Use a small k like 5 or 10 when you have enough rows, and treat a large gap between training RMSE and CV RMSE as a warning sign. Finally, export the full predictions and residuals to CSV, or save a PDF report, to document your modeling decisions clearly.
FAQs
Which criterion should I choose: AIC, BIC, or adjusted R²?
AIC often keeps more predictors for better fit; BIC is stricter and favors simpler models as n grows. Use adjusted R² when you want an intuitive, variance-based comparison. Try more than one and validate with new data.
What does a high VIF indicate?
High VIF means a predictor is strongly explained by other predictors, so its coefficient may be unstable. As a rule of thumb, values above 5 suggest concern and above 10 suggest serious multicollinearity. Consider removing or combining correlated variables.
Why are p-values marked as approximate?
The calculator estimates p-values using a normal approximation for speed and portability. It is adequate for rough screening but not a substitute for a full statistical package that uses the exact t distribution and richer diagnostics.
Can I use this tool for classification outcomes?
No. The current method fits linear regression for continuous targets using ordinary least squares. For classification, use logistic regression or other generalized models, and choose criteria designed for those likelihoods.
How many rows do I need for reliable selection?
More is better. Aim for at least 10–20 usable rows per predictor you expect to keep, plus enough variation in the target. With small samples, stepwise paths can change drastically from minor data noise.
What does standardizing predictors change?
Standardizing turns each predictor into a z-score, so coefficients represent change per one standard deviation. It can improve numerical stability and makes standardized betas easier to compare, but predictions in original units still depend on the fitted intercept and scaling.