knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Installation:

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)

Usage

linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris)

Methods

resid()

the resid method returns the vector of residuals e.

linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris)
resid(linreg_mod)

coef()

the Coef method returns the coefficients.

linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris)
coef(linreg_mod)

Plot

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.

```r

linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris)

plot(linreg_mod)

```

Print()

prints the coefficients and coefficient names.

linreg_mod <- linreg(Petal.Length~Sepal.Width+Sepal.Length, data=iris)
print(linreg_mod)

summary()

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)


Suhani8884/Lab4 documentation built on Sept. 23, 2020, 12:44 a.m.