homoscedasticity: homoscedasticity

Description Usage Arguments Value Examples

View source: R/homoscedasticity.R

Description

This function recieves a linear regression model and outputs a scatter plot figure of residuals plotted against fitted values. It prints a statement indicating the results of the homoscedasticity test and outputs a dataframe containing spearman correlation coefficients between the absolute residuals and the fitted y values.

Usage

1
homoscedasticity(data, formula, threshold = 0.05)

Arguments

data

a dataframe containing regression data

formula

a formula in the format "y ~ x1 + x2 + ..." indicating regression variables

threshold

a float indicating rejection threshold of correlation coefficient

Value

a plot of predicted values vs residuals and the correlation p value

Examples

1
2
3
4
library(tibble)
data <- tibble(X = c(1,2,3,4,5), y=c(1,2,4,4,6))
formula <- "y ~ X"
homoscedasticity(data, formula)

UBC-MDS/linregasm documentation built on Feb. 6, 2022, 7 a.m.