Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nick_artin
committed
Sep 22, 2015
1 parent
c6b9680
commit 5e3ac3c
Showing
8 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
% Generated by roxygen2 (4.1.1): do not edit by hand | ||
% Please edit documentation in R/methods.R | ||
\name{as.data.frame.linreg} | ||
\alias{as.data.frame.linreg} | ||
\title{A function that creates a data frame from an object of class linreg.} | ||
\usage{ | ||
\method{as.data.frame}{linreg}(x, ...) | ||
} | ||
\arguments{ | ||
\item{x}{linreg object} | ||
} | ||
\value{ | ||
data.frame contains fitted values and residuals. | ||
} | ||
\description{ | ||
A function that creates a data frame from an object of class linreg. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
% Generated by roxygen2 (4.1.1): do not edit by hand | ||
% Please edit documentation in R/methods.R | ||
\name{coef.linreg} | ||
\alias{coef.linreg} | ||
\title{A method that returns the coefficients as a named vector.} | ||
\usage{ | ||
\method{coef}{linreg}(object, ...) | ||
} | ||
\arguments{ | ||
\item{x}{linreg object} | ||
} | ||
\value{ | ||
named vector of coefficients. | ||
} | ||
\description{ | ||
A method that returns the coefficients as a named vector. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
% Generated by roxygen2 (4.1.1): do not edit by hand | ||
% Please edit documentation in R/methods.R | ||
\name{plot.linreg} | ||
\alias{plot.linreg} | ||
\title{The plot-method that creates two plots.} | ||
\usage{ | ||
\method{plot}{linreg}(x, ...) | ||
} | ||
\arguments{ | ||
\item{x}{linreg object} | ||
} | ||
\description{ | ||
The plot-method that creates two plots. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
% Generated by roxygen2 (4.1.1): do not edit by hand | ||
% Please edit documentation in R/methods.R | ||
\name{predict.linreg} | ||
\alias{predict.linreg} | ||
\title{A method that returns the predicted values y.} | ||
\usage{ | ||
\method{predict}{linreg}(object, ...) | ||
} | ||
\arguments{ | ||
\item{x}{linreg object} | ||
} | ||
\value{ | ||
vector of predictions. | ||
} | ||
\description{ | ||
A method that returns the predicted values y. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
% Generated by roxygen2 (4.1.1): do not edit by hand | ||
% Please edit documentation in R/methods.R | ||
\name{print.linreg} | ||
\alias{print.linreg} | ||
\title{Method for printing the coefficients and coefficient names.} | ||
\usage{ | ||
\method{print}{linreg}(x, ...) | ||
} | ||
\arguments{ | ||
\item{x}{linreg object} | ||
} | ||
\description{ | ||
Method for printing the coefficients and coefficient names. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
% Generated by roxygen2 (4.1.1): do not edit by hand | ||
% Please edit documentation in R/methods.R | ||
\name{residuals.linreg} | ||
\alias{residuals.linreg} | ||
\title{A method that returns the vector of residuals e.} | ||
\usage{ | ||
\method{residuals}{linreg}(object, ...) | ||
} | ||
\arguments{ | ||
\item{x}{linreg object} | ||
} | ||
\value{ | ||
vector of residuals. | ||
} | ||
\description{ | ||
A method that returns the vector of residuals e. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
% Generated by roxygen2 (4.1.1): do not edit by hand | ||
% Please edit documentation in R/methods.R | ||
\name{summary.linreg} | ||
\alias{summary.linreg} | ||
\title{A method that prints a summary of the linreg-function.} | ||
\usage{ | ||
\method{summary}{linreg}(object, ...) | ||
} | ||
\arguments{ | ||
\item{x}{linreg object} | ||
} | ||
\value{ | ||
linreg_summary object, can be printed. | ||
} | ||
\description{ | ||
A method that prints a summary of the linreg-function. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## ------------------------------------------------------------------------ | ||
library(linregpackage) | ||
library(ggplot2) | ||
|
||
data(iris) | ||
attach(iris) | ||
head(iris, 5) | ||
|
||
## ------------------------------------------------------------------------ | ||
formula = Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width | ||
m = linreg(formula, iris) | ||
summary(m) | ||
|
||
## ----fig.width = 6, fig.height = 3, fig.align='center'------------------- | ||
plot(m) | ||
|
||
## ------------------------------------------------------------------------ | ||
summary(residuals(m)) | ||
|
||
## ------------------------------------------------------------------------ | ||
summary(predict(m)) | ||
|