Most of the test done in exposome analysis requires that the exposures must follow a normal distribution. The function ds.normalityTest
performs a test on each exposure for normality behaviour. The result is a data.frame
with the exposures’ names, a flag TRUE
/FALSE
for normality and the p-value obtained from the Shapiro-Wilk Normality Test (if the p-value is under the threshold, then the exposure is not normal).
nm <- ds.normalityTest("exposome_object") table(nm$server1$normality)
So, the exposures that do not follow a normal distribution are:
nm$server1$exposure[!nm$server1$normality]
The ds.normalityTest
function has some extra input arguments to tune the normality test, check the function documentation for further information.
The exposures can be visualized using non-disclosive histograms to see their distribution along their Shapiro-Wilk Normality Test p-value.
ds.exposure_histogram("exposome_object", "AbsPM25")
If the selected exposure is not following a normal distribution, the function ds.exposure_histogram
accepts the argument show.trans
to visualize the raw data histogram plus three typical transformations (exp
, log
and sqrt
), the Shapiro-Wilk Normality Test p-value is shown for all the transformations.
ds.exposure_histogram("exposome_object", "AbsPM25", TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.