knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
To install the package it's necessary to download it from github.
Enter the following line in your console:
```devtools::install_github("Suhani8884/Lab4.git")
<!--
devtools::install_github("Suhani8884/Lab4.git")``` --> ## Usage: This package allows the user to create objects in S3, called `linreg`, that consists in an alternative way to implement the linear regression. In order to create the objects, you need to input the formula specified by the user and the dataset to which it refers as parameters. ```r library(Lab4Assign) library(ggplot2)
linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris)
the resid method returns the vector of residuals e.
linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris) resid(linreg_mod)
the Coef method returns the coefficients.
linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris) coef(linreg_mod)
The plot method returns two plots.One plot with Residuals vs Fitted Values and the other one the Square of Standartized residuals vs Fitted values.
prints the coefficients and coefficient names.
linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris) print(linreg_mod)
returns the coefficients and standard error, t-value and p-value as well as the std Error and the degrees of freedom.
linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris) summary(linreg_mod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.