mylm: Fitting linear Models

Description Usage Arguments Value Examples

View source: R/mylm.R

Description

Fit the linear regression model.

Usage

1
mylm(obj, inputdata = NULL, style = "simple")

Arguments

obj

input formula

inputdata

dataset

style

Choose different kind of output. Nothing prints out if style = "nothing". Get only the model and coefficients if style = "simple". Get a summary of linear regresion if style = "summary"

Value

a list containing the following components:

Call

the formula of the model

fitted_value

the fitted mean value

Residuals

the usual residuals of the model

coefficients

a p*4 matrix with columns for the estimated coefficients, their standard error, t-statistics and p-value of the t-test

RSE

the square root of estimated variance (mean square error)

R_squared

the fraction of variance explained by the model

adjusted_R_squared

the fraction of variance explained by the model penalized by p

f_value

the statistic of F test

p_f

the p value of F test

d_f

degrees of freedom, a 2-vector (p,n-p)

Examples

1
2
mylm( mpg~wt+drat,inputdata = mtcars, style = "summary" )
mylm( mtcars$mpg~mtcars$wt+mtcars$drat )

ZimanJiang/mylm documentation built on Dec. 18, 2021, 9:22 p.m.