normalityTest-methods: It creates a 'data.frame' of boolean indicating if the...

Description Usage Arguments Value See Also Examples

Description

This functions uses shapiro.test to test the normality of the exposures and returns a data.frame with a boolean value and a p-value for each exposure.

Usage

1
2
3
4
5
6
7
8
normalityTest(
  object,
  exposure,
  th = 0.05,
  min.val = 5,
  na.rm = TRUE,
  warnings = TRUE
)

Arguments

object

ExposomeSet with the exposome to be tested.

exposure

Name of the exposure to be tested, if missing all the exposures will be tested.

th

(by default 0.05) Threshold to considere an exposure to follow a normal distribution.

min.val

(by default 5) Minimum number of values not missings to test the exposures.

na.rm

(by default TRUE) Removes the NA values to test the normality on the exposure.

warnings

(by default: TRUE) Show warnings if required.

Value

A data.frame with three columns: exposure, normality and p.value. "exposure" column contains the name of each exposure. "normalty" column contains a logical value indicating if the obtained p-value is under the given threshold. "p.value" column contains the obtained p-value from shapiro.test.

See Also

plotHistogram to draw the shape of an exposure, plotMissings to draw a plot with the missing data an ExposomeSet, imputation to impute missing data on the exposures of an ExposomeSet

Examples

1
2
data("exposome")
normalityTest(expo)

rexposome documentation built on March 13, 2021, 2:01 a.m.