Calculator Inputs
Tip: Separate numbers with commas, spaces, or line breaks. Dummy values must be coded as 0 and 1.
Example Data Table
| Observation | Sales | Advertising | RegionDummy | Group |
|---|---|---|---|---|
| 1 | 12 | 1 | 0 | Reference Group |
| 2 | 14 | 2 | 0 | Reference Group |
| 3 | 15 | 3 | 0 | Reference Group |
| 4 | 18 | 4 | 0 | Reference Group |
| 5 | 17 | 1 | 1 | Target Group |
| 6 | 21 | 2 | 1 | Target Group |
| 7 | 22 | 3 | 1 | Target Group |
| 8 | 26 | 4 | 1 | Target Group |
Formula Used
Main model: Sales = β0 + β1X + β2D + β3(X×D)
Reference group equation: Y = β0 + β1X when D = 0.
Target group equation: Y = (β0 + β2) + (β1 + β3)X when D = 1.
OLS estimator: β̂ = (X′X)-1X′Y
β2 measures the intercept shift between coded groups. β3 measures how the slope changes when the dummy switches from 0 to 1. When the interaction is disabled, both groups share one common slope and only the intercept changes.
How to Use This Calculator
- Enter a label for the response variable, predictor, and dummy variable.
- Paste the dependent values, predictor values, and 0/1 dummy values.
- Keep the intercept checked for the usual reference-group model.
- Enable the interaction term when you expect different slopes by group.
- Click Run Dummy Regression to estimate coefficients and diagnostics.
- Review the model summary, coefficient table, fitted graph, and residuals.
- Use the CSV or PDF buttons to export your latest results.
- For more than two categories, create separate k-1 dummy variables outside this page.
Frequently Asked Questions
1. What does the dummy coefficient mean?
It measures the difference between the coded groups when other included terms are held fixed. With no interaction, it shifts only the intercept. With interaction, it contributes to the group difference at the chosen predictor value.
2. When should I include an interaction term?
Include it when the relationship between the numeric predictor and the response may differ across groups. A meaningful interaction means the two groups have different slopes, not just different starting levels.
3. Can I use categories beyond two groups?
Yes, but this page handles one binary indicator at a time. For three or more categories, create k-1 dummy variables and estimate a broader regression model to avoid perfect multicollinearity.
4. Why do I get a singular matrix error?
That usually means your inputs create perfect collinearity. Common causes are all dummy values being identical, repeated columns, too few observations, or including terms that are exact combinations of other predictors.
5. Does the calculator require a numeric predictor?
No. You can leave the numeric predictor blank and estimate a simple group-mean difference model using the dummy variable. However, interaction terms require a numeric predictor to be present.
6. How should I code the dummy variable?
Use 0 for the reference group and 1 for the comparison group. The intercept and slope interpretation then becomes straightforward, especially when you compare fitted equations for both groups.
7. What does R² tell me here?
R² shows how much response variation the model explains. Higher values indicate better in-sample fit, but good statistical practice still checks residual patterns, coefficient meaning, and whether the coding matches the research question.
8. What do the CSV and PDF exports include?
They include the latest model summary, coefficient table, and observation-level diagnostics. The PDF is a lightweight report for quick sharing, while the CSV is better for spreadsheet analysis and archiving.