plotPredVsObs: A function for comparing observed vs predicted histograms

View source: R/Plotting_with_ggplot.R

plotPredVsObsR Documentation

A function for comparing observed vs predicted histograms

Description

This function allows the representation of observed vs predicted histograms. It can be used as a tool for interpreting preditive methods (for exampe, the regression of histogrma data)

Usage

plotPredVsObs(PRED, OBS, type = "HISTO", ncolu = 2)

Arguments

PRED

a MatH object with one column, the predicted data

OBS

a MatH object with one column, the observed data

type

a string. "HISTO" (default), if ones want to compare histograms
"CDF", if ones want to compare cumulative distribution functions;
"DENS" if ones want to compare approximated densities (using KDE);

ncolu

number of columns in which is arranged the plot, default is 2. If you have a lot of data consider to choose higher values.

Value

A plot with compared histogram-valued data.

Examples

## do a regression
pars <- WH.regression.two.components(BLOOD, Yvar = 1, Xvars = c(2:3))
## predict data
PRED <- WH.regression.two.components.predict(data = BLOOD[, 2:3], parameters = pars)
## define observed data
## Not run: 
OBS <- BLOOD[, 1]
plotPredVsObs(PRED, OBS, "HISTO")
plotPredVsObs(PRED, OBS, "CDF")
plotPredVsObs(PRED, OBS, "DENS")

## End(Not run)

HistDAWass documentation built on Sept. 26, 2022, 5:06 p.m.