Linear Regression

Linear regression model function.

linreg()

Linear Regression

Descriptive Statistics

Descriptive statistics.

descriptives()

Descriptive Statistics

Model-Implied Matrices

Model-implied matrices for the k-variable linear regression model.

Sigmatheta()

Model-Implied Variance-Covariance Matrix \(\boldsymbol{\Sigma} \left( \boldsymbol{\theta} \right)\)

mutheta()

Model-Implied Mean Vector \(\boldsymbol{\mu} \left( \boldsymbol{\theta} \right)\)

Coefficients and Error Variance

Regression coefficients and error variance from model-implied matrices.

.intercept()

Regression Intercept \(\beta_{1}\)

.slopes()

Regression Slopes \(\boldsymbol{\beta}_{2, \cdots, k}\)

.slopesprime()

Regression Standardized Slopes \(\boldsymbol{\beta}_{2, \cdots, k}^{\prime}\)

intercept()

Regression Intercept \(\beta_{1}\)

sigma2epsilon()

Error Variance \(\sigma_{\varepsilon}^{2}\)

slopes()

Regression Slopes \(\boldsymbol{\beta}_{2, \cdots, k}\)

slopesprime()

Regression Standardized Slopes \(\boldsymbol{\beta}_{2, \cdots, k}^{\prime}\)

Coefficients OLS

Regression coefficients ordinary least squares estimator.

betahat()

Estimates of Regression Coefficients \(\boldsymbol{\hat{\beta}}\)

.betahatnorm()

Estimates of Regression Coefficients \( \boldsymbol{\hat{\beta}} = \left( \mathbf{X}^{T} \mathbf{X} \right)^{-1} \left( \mathbf{X}^{T} \mathbf{y} \right) \)

.betahatqr()

Estimates of Regression Coefficients \(\boldsymbol{\hat{\beta}}\) - QR Decomposition

.betahatsvd()

Estimates of Regression Coefficients \(\boldsymbol{\hat{\beta}}\) - Singular Value Decomposition

.intercepthat()

Estimated Regression Intercept \(\hat{\beta}_{1}\)

.slopeshat()

Estimates of Regression Slopes \(\boldsymbol{\hat{\beta}}_{2, \cdots, k}\)

.slopeshatprime()

Estimates of Regression Standardized Slopes \(\boldsymbol{\hat{\beta}}_{2, \cdots, k}^{\prime}\)

intercepthat()

Estimated Regression Intercept \(\hat{\beta}_{1}\)

slopeshat()

Estimates of Regression Slopes \(\boldsymbol{\hat{\beta}}_{2, \cdots, k}\)

slopeshatprime()

Estimates of Regression Standardized Slopes \(\boldsymbol{\hat{\beta}}_{2, \cdots, k}^{\prime}\)

Projection

Projection matrix functions.

M()

M Matrix

P()

P Matrix

.M()

M Matrix

.h()

Leverage

h()

Leverage

Predicted

Predicted values.

Py()

y-hat \(\left( \mathbf{\hat{y}} = \mathbf{P} \mathbf{y} \right)\)

Xbetahat()

y-hat \(\left( \mathbf{\hat{y}} = \mathbf{X} \boldsymbol{\hat{\beta}} \right)\)

.Py()

y-hat \(\left( \mathbf{\hat{y}} = \mathbf{P} \mathbf{y} \right)\)

.Xbetahat()

y-hat \(\left( \mathbf{\hat{y}} = \mathbf{X} \boldsymbol{\hat{\beta}} \right)\)

yhat()

y-hat \(\left( \mathbf{\hat{y}} = \mathbf{X} \boldsymbol{\hat{\beta}} \right)\)

Residuals

Residuals.

My()

Residuals \(\left( \boldsymbol{\hat{\varepsilon}} = \mathbf{My} \right)\)

.My()

Residuals \(\left( \boldsymbol{\hat{\varepsilon}} = \mathbf{My} \right)\)

.tepsilonhat()

Studentized Residuals

.yminusyhat()

Residuals \( \left( \boldsymbol{\hat{\varepsilon}} = \mathbf{y} - \mathbf{\hat{y}} \right) \)

epsilonhat()

Residuals \( \left( \boldsymbol{\hat{\varepsilon}} = \mathbf{y} - \mathbf{\hat{y}} \right) \)

tepsilonhat()

Studentized Residuals

yminusyhat()

Residuals \( \left( \boldsymbol{\hat{\varepsilon}} = \mathbf{y} - \mathbf{\hat{y}} \right) \)

Sum of Squares

Sum of squares.

ESS()

Explained Sum of Squares

RSS()

Residual Sum of Squares

TSS()

Total Sum of Squares.

.ESS()

Explained Sum of Squares (from \(\mathbf{\hat{y}}\) and \(\mathbf{\bar{Y}}\))

.RSS()

Residual Sum of Square (from \(\boldsymbol{\hat{\varepsilon}}\))

Residual Variance

Residual variance.

.sigma2hatepsilonhat()

Residual Variance \(\hat{\sigma}_{\hat{\varepsilon}}^{2}\) (from \(\mathrm{RSS}\))

.sigma2hatepsilonhatbiased()

Residual Variance \(\hat{\sigma}_{\hat{\varepsilon} \ \textrm{biased}}^{2}\) (from \(\mathrm{RSS}\))

sigma2hatepsilonhat()

Residual Variance \(\hat{\sigma}_{\hat{\varepsilon}}^{2}\)

sigma2hatepsilonhatbiased()

Residual Variance \(\hat{\sigma}_{\hat{\varepsilon} \ \textrm{biased}}^{2}\)

Model Assessment

Assessment of model quality.

MSE()

Mean Squared Error

R2()

Coefficient of Determination \(R^2\)

RMSE()

Root Mean Squared Error

Rbar2()

Adjusted R-squared \(\bar{R}^{2}\)

.MSE()

Mean Squared Error (from \(\mathrm{RSS}\))

.R2fromESS()

Coefficient of Determination \(R^2\) (from \(ESS\))

.R2fromRSS()

Coefficient of Determination \(R^2\) (from \(RSS\))

.RMSE()

Root Mean Squared Error (from \(\mathrm{RSS}\))

.Rbar2()

Adjusted R-squared \(\bar{R}^{2}\) (from \(R^2\))

.model()

Model Assessment

model()

Model Assessment

Sampling variances and covariances

Sampling variances and covariances of estimated regression coefficients.

.vcovhatbetahat()

Variance-Covariance Matrix of Estimates of Regression Coefficients (from \(\hat{\sigma}_{\varepsilon}^{2}\))

.vcovhatbetahatbiased()

Variance-Covariance Matrix of Estimates of Regression Coefficients (from \(\hat{\sigma}_{\varepsilon \ \textrm{biased}}^{2}\))

vcovhatbetahat()

Variance-Covariance Matrix of Estimates of Regression Coefficients

vcovhatbetahatbiased()

Variance-Covariance Matrix of Estimates of Regression Coefficients (from \(\hat{\sigma}_{\varepsilon \ \textrm{biased}}^{2}\))

Standard errors

Standard errors of estimated regression coefficients.

.sehatbetahat()

Standard Errors of Estimates of Regression Coefficients (from \(\hat{\sigma}_{\varepsilon \ \textrm{unbiased}}^{2}\))

.sehatbetahatbiased()

Standard Errors of Estimates of Regression Coefficients (from \(\hat{\sigma}_{\varepsilon \ \textrm{biased}}^{2}\))

.sehatslopeshatprimedelta()

Standard Errors of Standardized Estimates of Regression Coefficients (Yuan and Chan (2011))

.sehatslopeshatprimetb()

Standard Errors of Standardized Estimates of Regression Coefficients (Textbook)

sehatbetahat()

Standard Errors of Estimates of Regression Coefficients (from \(\hat{\sigma}_{\varepsilon \ \textrm{unbiased}}^{2}\))

sehatbetahatbiased()

Standard Errors of Estimates of Regression Coefficients (from \(\hat{\sigma}_{\varepsilon \ \textrm{biased}}^{2}\))

sehatslopeshatprimedelta()

Standard Errors of Standardized Estimates of Regression Coefficients (Yuan and Chan (2011))

sehatslopeshatprimetb()

Standard Errors of Standardized Estimates of Regression Coefficients (Textbook)

Hypothesis Testing

Hypothesis testing and confidence intervals.

anovatable()

Analysis of Variance

betahatinference()

Regression Coefficients Hypothesis Test and Confidence Intervals

ci()

Confidence Intervals of Estimates of Regression Coefficients

.anovatable()

Analysis of Variance (from \(RSS\) and \(ESS\))

.betahatinference()

Regression Coefficients Hypothesis Test and Confidence Intervals

.slopeshatprimeinference()

Standardized Regression Slopes Hypothesis Test and Confidence Intervals

nhst()

Hypothesis Test for Estimates of Regression Coefficients

slopeshatprimeinference()

Standardized Regression Slopes Hypothesis Test and Confidence Intervals

Plotting Functions

Plotting functions.

residual.plot()

Residual Plots

scatter.plot()

Scatter Plot Matrix