Skip to content
Celeus

Linear regression

Shown in the app as linear_regression. Part of the method reference, under Regression.

When to use

Model a continuous outcome from predictors, adjusting for covariates.

What you provide

  • Outcome: one numeric column.
  • Predictors: one or more columns.

Options

Missing data

  • Complete case (listwise deletion)
  • Mean imputation (single)
  • Median imputation (single)
  • Multiple imputation

Multiple comparisons

  • Not adjustable for this method. Where it makes post-hoc comparisons, the procedure applies its own correction.

Other methods under Regression:

Guides that discuss this method

How to read the output

Linear regression models a numeric outcome from one or more predictors, for example house price from floor area and neighbourhood, or plant height from hours of light and amount of water. Celeus fits the model by ordinary least squares.

Coefficients. For a numeric predictor, the coefficient is the estimated change in the outcome per one-unit increase; for a categorical predictor, it is the difference from the reference category. Each is adjusted for the other predictors in the model. The reference category is the first one, which is alphabetical unless you reordered the categories. Every term is listed with its t-test and 95% confidence interval. The headline result is the coefficient for the first predictor you list (for a categorical predictor with more than two categories, its first comparison with the reference), so the order of predictors matters.

R-squared. The effect size is R-squared, the proportion of the outcome’s variance that the model accounts for, from 0 to 1. It is the plain R-squared, not the adjusted one, so it never falls when a predictor is added, even one with no real relationship to the outcome. Compare models with different numbers of predictors with that in mind.

Checks to read alongside. The only assumption check on the fit itself is a Shapiro-Wilk test of normality on the residuals, which is not assessed below 3 or above 5000 residuals. It is most informative in small samples. With moderate to large samples the coefficient tests depend on the sampling distribution of the estimates rather than on the residuals being normal, so a significant Shapiro-Wilk result there is not on its own a reason to abandon the model (Lumley and colleagues, 2002). The standard errors are the classical ones, not robust (sandwich) ones, and Celeus does not check for unequal residual spread (heteroscedasticity). It does add advisory notes for influential observations (Cook’s distance above 4/n) and for strongly correlated predictors (variance inflation factor above 5), but these are screening notes, so look at the residual plots yourself.

Missing values. Rows with a missing value can be dropped, filled with the column mean or median, or handled by multiple imputation. With multiple imputation the coefficients and their intervals are pooled across the imputed datasets, R-squared is the average over them, and the residual normality check is replaced by a small-sample warning below 10 observations.

Sources: Lumley T, Diehr P, Emerson S, Chen L (2002), Annual Review of Public Health 23:151-169, doi:10.1146/annurev.publhealth.23.100901.140546. Shapiro SS, Wilk MB (1965), Biometrika 52(3-4):591-611, doi:10.1093/biomet/52.3-4.591.

Worked example

Celeus's result on a published or illustrative dataset, next to an independent computation and, where one exists, a published value. The data themselves are not reproduced here.

datasets::mtcars

  • Source: Published dataset distributed with an R package
  • Licence: base R (GPL)
  • Reference: Henderson & Velleman (1981)
QuantityCeleusIndependent computationPublished valueAgrees
Estimate-3.87783-3.87783-Yes
p-value1.11965e-061.11965e-06-Yes

Validation report

References

  1. R Core Team. R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria.