knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "inst/doc/README-",
  out.width = "70%",
  fig.align='center'
)
rm(list=ls())
library("LMWiRe")

R-CMD-check

Installation

remotes::install_github("ManonMartin/LMWiRe", dependencies = TRUE)
library("LMWiRe")

Short application on the UCH dataset

Data object

str(UCH)

Data visualisation

# design
plotDesign(design = UCH$design, x = "Hippurate", 
           y = "Citrate", rows = "Time",
           title = "Design of the UCH dataset")

# row 3 of outcomes
plotLine(Y = UCH$outcomes,
         title = "H-NMR spectrum",
         rows = c(3),
         xlab = "ppm",
         ylab = "Intensity")

PCA

ResPCA = pcaBySvd(UCH$outcomes)
pcaScreePlot(ResPCA, nPC = 6)
pcaScorePlot(resPcaBySvd = ResPCA, axes = c(1,2), 
             title = "PCA scores plot: PC1 and PC2", 
             design = UCH$design,
             color = "Hippurate", shape = "Citrate",
             points_labs_rn = FALSE)

Model estimation and effect matrix decomposition

# Model matrix generation
resMM = lmwModelMatrix(UCH)

# Model estimation and effect matrices decomposition
resEM = lmwEffectMatrices(resMM)

Effect matrix test of significance and importance measure

# Effects importance
resEM$varPercentagesPlot

# Bootstrap tests
resBT = lmwBootstrapTests(resLmwEffectMatrices = resEM, nboot=100)
resBT$resultsTable

ASCA-E decomposition

# ASCA-E decomposition
resASCAE = lmwPcaEffects(resLmwEffectMatrices = resEM, method="ASCA-E")

# Scores Plot for the hippurate
lmwScorePlot(resASCAE, effectNames = "Hippurate", 
             color = "Hippurate", shape = "Hippurate")

# Loadings Plot for the hippurate
lmwLoading1dPlot(resASCAE, effectNames = c("Hippurate"), 
                              axes = 1, xlab = "ppm")

# Scores ScatterPlot matrix
lmwScoreScatterPlotM(resASCAE,PCdim=c(1,1,1,1,1,1,1,2),
                     modelAbbrev = TRUE,
                     varname.colorup = "Citrate",
                     varname.colordown  = "Time",
                     varname.pchup="Hippurate",
                     varname.pchdown="Time",
                     title = "ASCA scores scatterplot matrix")


bgovaerts/LMWiRe documentation built on Sept. 17, 2022, 12:32 a.m.