You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Functions
library(dplyr)
library(glue)
# Sample Data
library(wooldridge)
G<-gpa2
Actual Code
Helper function. (Must be included. Do not edit.)
test.NormalityOutliers<-function(dataset_variable, variable.text, density_plot.remove_na=TRUE){
# Test of normality
shapiro.test(dataset_variable) %>% print()
hist(dataset_variable, main=glue::glue("Histogram to Assess if {variable.text} is Normally Distributed"))
plot(density(dataset_variable, na.rm=density_plot.remove_na), main=glue::glue("Scatterplot to Assess if {variable.text} is Normally Distributed"))
qqnorm(dataset_variable, main=glue::glue("qq-Plot to Assess if {variable.text} is Normally Distributed"))
qqline(dataset_variable, col=2)
# Outlier Identification
boxplot(dataset_variable, range=3, main=glue::glue("Boxplot to Examine Distribution of Extreme Outliers"))
boxplot(dataset_variable, range=1.5, main=glue::glue("Boxplot to Examine Distribution of Moderate Outliers"))}
Optional keyword arguments for fine-tuning of output. (If you wish to include some of these, edit the rhs of = and add them at the back of your input.)