#' Get the prediction formula for a for a regression.
#' @param object ; A regression object.
#' @return function ; A function that gives the response values for a given explanatory variable.
#' @export
my.regression.prediction.formula <- function(object) {
UseMethod("my.regression.prediction.formula")
}
#' Get the Y-intercept for a regression.
#' @param object ; A regression object.
#' @return numeric ; The Y-intercept for the regression.
#' @export
my.intercept <- function(object) {
UseMethod("my.intercept")
}
#' Get the slope for a regression.
#' (Only available for a linear regression.)
#' @param object ; A regression object.
#' @return numeric ; The slope of a given regression.
#' @export
my.slope <- function(object) {
UseMethod("my.slope")
}
#' Get the covariance for a regression.
#' (Only useful for classifying a corelation/regression as positive/negative or no relationship.)
#' (Only available for a linear regression.)
#' @param object ; A regression object.
#' @return numeric ; The covariance of a given regression.
#' @export
my.covariance <- function(object) {
UseMethod("my.covariance")
}
#' Calculate the errors of the Y values of a linear regression.
#' @param object ; An object to calculate the error for.
#' @return numeric vector ; The errors of the response values compared to the regression line.
#' @export
my.errors <- function(object) {
UseMethod("my.errors")
}
#' Calculate the correlation of the regression.
#' @param object ; A regression object.
#' @return numeric ; The correlation of the regression.
#' @export
my.correlation <- function(object) {
UseMethod("my.correlation")
}
#' Calculate the coefficient of determination of a regression (also called the R(correlation) squared).
#' @param object ; A regression object.
#' @return numeric ; The coefficient of determination of the regression line. '1' Means a perfect correlation, '0' Means no correlation.
#' @export
my.coefficient.of.determination <- function(object) {
UseMethod("my.coefficient.of.determination")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.