Skip to contents

This function will compute normality on entire data set. Sometime in dlookr package p values turns out to be null thus failing to test normality of the data set. This is a good alternative of dlookr function. Here normality is tested using shapiro.test from base stats.

Usage

normality.loop(df, bonf = TRUE, alpha = 0.05)

Arguments

df

A data frame.

bonf

If TRUE a bonferonni correction will be conducted.

alpha

Desired alpha.

Value

Provides normality tests results for all columns in a wide data frame in a list format.

Examples

data <- tabledown::Rotter[, 11:31]
normality.loop(data)
#> $statistic
#>   item2.W   item3.W   item4.W   item5.W   item6.W   item7.W   item9.W  item10.W 
#> 0.4687783 0.3984029 0.6346962 0.4389197 0.6054954 0.4115381 0.5840242 0.3173180 
#>  item11.W  item12.W  item13.W  item15.W  item16.W  item17.W  item18.W  item20.W 
#> 0.6362266 0.6342364 0.6349068 0.6342364 0.5789720 0.5018625 0.4835846 0.6364813 
#>  item21.W  item22.W  item23.W  item25.W  item26.W 
#> 0.5375357 0.5708925 0.3509070 0.6016894 0.5621908 
#> 
#> $p.value
#>        item2        item3        item4        item5        item6        item7 
#> 2.653088e-35 6.227311e-37 1.248056e-30 5.155272e-36 1.462305e-31 1.219678e-36 
#>        item9       item10       item11       item12       item13       item15 
#> 3.271646e-32 1.255529e-38 1.401678e-30 1.205368e-30 1.268128e-30 1.205368e-30 
#>       item16       item17       item18       item20       item21       item22 
#> 2.320927e-32 1.781982e-34 6.146609e-35 1.429076e-30 1.562937e-33 1.349463e-32 
#>       item23       item25       item26 
#> 6.027334e-38 1.116209e-31 7.593841e-33 
#> 
#> $significance
#>  item2  item3  item4  item5  item6  item7  item9 item10 item11 item12 item13 
#>    "*"    "*"    "*"    "*"    "*"    "*"    "*"    "*"    "*"    "*"    "*" 
#> item15 item16 item17 item18 item20 item21 item22 item23 item25 item26 
#>    "*"    "*"    "*"    "*"    "*"    "*"    "*"    "*"    "*"    "*" 
#> 
#> $method
#> [1] "Shapiro-Wilks test with Bonferroni Correction"
#>