compPlot: compPlot: data visualisation comparing observation and model...

Description Usage Arguments Author(s) Examples

Description

This function allows you to visualise different model predictions and observations by certain factors.

Usage

1
2
3
compPlot(x, act, pred, by = NULL, weights = NULL, exposure = NULL, 
   breaks = NULL, missing=TRUE, newGroupNum = 10,xlim=NULL, 
   xname = "x",yname="y",byname="by",legendPos=NULL)

Arguments

x

a vector indicates the dependent variable that you want to visulise on (i.e. Age)

act

a vector indicates the actual response variable (observation)

pred

a vector or data frame that provides model predictions. Each column must be from the same model predictions.

by

Optinal.A numerical vector to specify the <by> variable

weights

Optional. A numerical vector to specify the weights used for calculating weighted average of response. Normally this is the figures from over/down-samping.

exposure

Optional. A numerical vector to specify the exposure used for calculating weighted average of response.

breaks

Optional. A vector to specify the breaks for 'x'

missing

logical. whether to show the 'NA' as 'Missing' in plot. If a 'Missing' level is already existed, then 'NA' will combined

newGroupNum

An integer specifies number of new bands when levels of current plotting variable 'x' or 'by' is more than 100.

xlim

Optional. A vector provides the range of the variable e.g. xlim=c(0,100).

xname, yname, byname

Optional. Characters to be shown on plot.

legendPos

Optional. 2 numeric element vector specify the location of legend.

Author(s)

Sixiang.Hu

Examples

1
2
3
4
5
6
 
compPlot(mtcars$vs,
         act=rnorm(nrow(mtcars)),
         pred = data.frame(pred1=rnorm(nrow(mtcars)),
                           pred2=rnorm(nrow(mtcars))),
         by=mtcars$am)

SixiangHu/DataMan documentation built on May 9, 2019, 1:48 p.m.