lm_anova: lm_anova

Description Usage Arguments Value Examples

View source: R/lm_anova.R

Description

Compute analysis of variance (or deviance) tables for fitted model objects.'

Usage

1
lm_anova(object)

Arguments

object

a result of lm_fit; only support cases when the input response variable is a vector or a n * 1 matrix and the method for fitting the model is "qr".

Value

lm_anova returns a list containing following response values.

Df

degree of freedoms of SSR(the residual sum of squares) and SSE(sum of squared estimate of errors).

'Sum Sq'

SSR and SSE.

'Mean Sq'

MSR and MSE.

'F value'

the F statistics.

'Pr(>F)'

the p value of the f test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n = 10; p = 5; q = 2;
x = matrix(rnorm(n * p), n, p) # no intercept
y1 = rnorm(n)
y2 = matrix(rnorm(n * q), n, q)

z1 = lm_fit(x = x, y = y1)
z2 = lm_fit(x = x, y = y2)

z_anova = lm_summary(z1)
# lm_anova function doesn't support cases lm_anova(z2)
# because the response value y2 is a matrix with more than 1 columns.

leyaozh/lm.hw4 documentation built on Dec. 3, 2019, 7:18 a.m.