Upload or paste datasets with any number of predictors and rows. Choose intercept, scaling, and robust options for stable estimates under collinearity stress. View coefficients, standard errors, t tests, and model fit with clear visuals. Export summaries to CSV and PDF with one click.
Let y be an n×1 vector and X an n×p design matrix (first column ones if intercept). Ordinary least squares estimates coefficients
as β = (X'X)^{-1} X' y. Fitted values are ŷ = Xβ and residuals e = y - ŷ. Residual sum of squares SSE = e'e,
total sum of squares SST = ∑(y - \bar{y})^2, and SSR = SST - SSE. With residual variance s^2 = SSE/(n-p), the covariance matrix is
Var(β) = s^2 (X'X)^{-1} (or HC1 robust (n/(n-p))(X'X)^{-1} X' diag(e^2) X (X'X)^{-1}). Standard errors are square roots of diagonal terms.
t-statistics are t_j = \beta_j / SE(\beta_j) with df = n-p and two-sided p-values from the t distribution. The model F-statistic is
F = (SSR/(p-1)) / (SSE/(n-p)) for an intercept model, with p-value from the F distribution. Confidence intervals use \beta_j \pm t_{1-\alpha/2,df} SE.
A mean response at new x_0 has variance s^2 x_0' (X'X)^{-1} x_0; prediction interval adds an extra s^2 term.
You can obtain confidence intervals for coefficients directly with confint(), or compute them manually from the summary() output using the reported standard errors and residual degrees of freedom.
# Fit model fit <- lm(y ~ x1 + x2 + x3, data = df) # 95% CIs for coefficients confint(fit, level = 0.95) # Mean-response CI and prediction interval at new values new <- data.frame(x1 = 10, x2 = 5, x3 = 2) predict(fit, newdata = new, interval = "confidence", level = 0.95) predict(fit, newdata = new, interval = "prediction", level = 0.95)
summary(fit) by hands <- summary(fit) b <- coef(fit) # estimates se <- coef(s)[, "Std. Error"] # standard errors df <- s$df[2] # residual df (n - p) tcrit <- qt(0.975, df) # two-sided 95% ci_lo <- b - tcrit * se ci_hi <- b + tcrit * se cbind(Estimate = b, `2.5%` = ci_lo, `97.5%` = ci_hi)
# Install once: install.packages(c("sandwich","lmtest"))
library(sandwich); library(lmtest)
Vrob <- vcovHC(fit, type = "HC1")
se_rob <- sqrt(diag(Vrob))
df <- fit$df.residual
tcrit <- qt(0.975, df)
b <- coef(fit)
ci_lo <- b - tcrit * se_rob
ci_hi <- b + tcrit * se_rob
cbind(Estimate = b, `2.5%` = ci_lo, `97.5%` = ci_hi)
# Or: robust tests and CIs via coeftest/coefci
coeftest(fit, vcov = Vrob)
# coefci() from 'lmtest' can build intervals too
confint() for quick coefficient intervals.predict(..., interval="confidence") for mean response intervals.predict(..., interval="prediction") for individual outcome intervals.| Column | Answers | Quick rule of thumb |
|---|---|---|
| Coef | Direction and size of effect | Meaningful magnitude; interpretable units |
| Std Err | Uncertainty of estimate | Small relative to Coef |
| t | Signal-to-noise ratio | |t| ≳ 2 (rough guide) |
| p | Evidence against zero effect | < 0.05 often notable |
| CI | Plausible range for effect | Exclude 0 for 5% level |
| R², adj R² | Variance explained by model | Higher is better; compare models |
| RMSE | Typical error in y units | Smaller is better |
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.