plot_regr: compstatslib plot_regr() function

View source: R/regression_plot.R

plot_regrR Documentation

compstatslib plot_regr() function

Description

Non-interactive visualization function that plots given points, regression line and relevant statistics.

Usage

plot_regr(points, ...)

Arguments

points

A dataframe of *x* and *y* coordinates to plot.

regression

A logical parameter that plots a regression line when set to TRUE and hides it when set to FALSE. It is set to TRUE by default.

stats

A logical parameter that displays the relevant statistics on the plot area when set to TRUE; it hides them when set to FALSE. It is set to TRUE by default.

Value

A dataframe containing the points coordinates. Additionally, the following parameters are provided on the plot area:

Raw intercept

The y-coordinate at which the regression line crosses the y-axis.

Raw slope

The value of the slope parameter.

Correlation

The strength of the linear relationship.

SSR

The sum of squares regression.

SSE

The sum of squares error.

SST

The sum of squares total.

R-squared

The multiple coefficient of determination.

See Also

interactive_regression

Examples

points <- data.frame(x = c(1, 3, 5, 8), y = c(2, 4, 6 ,8))

plot_regr(points)


soumyaray/compstatslib documentation built on March 11, 2023, 8:39 p.m.