TSS: Total Sum of Squares.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/SS.R

Description

Calculates the total sum of squares ≤ft( \mathrm{TSS} \right) using

\mathrm{TSS} = ∑_{i = 1}^{n} ≤ft( Y_i - \bar{Y} \right)^2 \\ = ∑_{i = 1}^{n} Y_{i}^{2} - n \bar{Y}^2

In matrix form

\mathrm{TSS} = ∑_{i = 1}^{n} ≤ft( \mathbf{y} - \mathbf{\bar{y}} \right)^2

Equivalent computational matrix formula

\mathrm{TSS} = \mathbf{y}^{\prime} \mathbf{y} - n \mathbf{\bar{Y}}^{2}.

Note that

\mathrm{TSS} = \mathrm{ESS} + \mathrm{RSS} .

Usage

1
TSS(y)

Arguments

y

Numeric vector of length n or n by 1 matrix. The vector \mathbf{y} is an n \times 1 vector of observations on the regressand variable.

Value

Returns the total sum of squares ≤ft( \mathrm{TSS} \right).

Author(s)

Ivan Jacob Agaloos Pesigan

References

Wikipedia: Residual Sum of Squares

Wikipedia: Explained Sum of Squares

Wikipedia: Total Sum of Squares

Wikipedia: Coefficient of Determination

See Also

Other sum of squares functions: .ESS(), .RSS(), ESS(), RSS()

Examples

1
2
y <- jeksterslabRdatarepo::wages.matrix[["y"]]
TSS(y = y)

jeksterslabds/jeksterslabRlinreg documentation built on Jan. 7, 2021, 8:30 a.m.