knitr::opts_chunk$set( collapse = TRUE, out.width = "100%" ) options(tibble.print_min = 5, tibble.print_max = 5)
Implementing Linear Regression Model
myLM is a package implementing the original lm function, generating the same output with some optimization. This package aims to output the exact same output as the original lm() function with minimal optimization.
devtools::install_github("wjhlang/myLM") library(myLM)
library(myLM) data("iris") # Output call and coefficients myLM(Petal.Length~Petal.Width*Sepal.Width,data = iris) # Output call and coefficients for weighted least squares myLM(Petal.Length~Petal.Width*Sepal.Width, data = iris, weight = runif(nrow(iris))) # Output the summary lmod = myLM(Petal.Length~Petal.Width*Sepal.Width,data = iris) summary(lmod) # Output diagnostic plots par(mfrow=c(2,2)) par(mar=c(2,2,2,2)) plot(myLM(Petal.Length~Petal.Width*Sepal.Width,data = iris))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.