PlotMetricBySplit.RdProduces plots of a METRIC variables by a SPLIT factor. Available TYPEs are Ecdf, Dens, Boxplot, Stripchart.
PlotMetricBySplit(METRIC, SPLIT = NULL, TYPE = "Ecdf", SCALE = "ID", MLAB = NULL, MLIM = NULL, UNIT = NULL, MAIN = NULL, COL = NULL, DRAW_STEPS = F, ECDF_POINTS = T, NVALID = T, ADJ = 1, METHOD = "jitter", NPRETTY = 8, ...)
| METRIC | is the metric variable to be plotted |
|---|---|
| SPLIT | =NULL is a factor or convertable to a factor. If NULL a single group ALL is assumed. |
| TYPE | ="Ecdf chooses between "Ecdf", "Dens", "Boxplot", "Stripchart" |
| SCALE | ="ID" chooses a ScaleTransformation ID, POWER_Z, LOG10, LOGIT |
| MLAB | =NULL optional label for METRIC, otherwise derived from call METRIC |
| MLIM | =NULL optional ON THE ORIGINAL SCALE, otherwise derived from pretty |
| UNIT | =NULL if SCALE ="ID" AND diff(LIM) divisable by UNIT plot interval will have UNIT based ticks |
| MAIN | =NULL, specifiy title, if MAIN = NULL type of plot |
| COL | =NULL colours for the levels of Split - otherwise 2:(G+1) |
| DRAW_STEPS | =F Set to TRUE for drawing the ecdf steps in full |
| ECDF_POINTS | =T Set to FALSE to suppress plotting points in ecdf |
| NVALID | =T logical switch whether to show number of valid observations per SPLIT group |
| ADJ | =1 Density smoothing parameter relative to density standard |
| METHOD | ="jitter" METHOD for stripchart. Options: "jitter", "stack", "overplot" |
| NPRETTY | =6 influences approximate number of labels when using ID or POWER_Z (cf. base pretty) |
| ... | further parameters for scale transformations can be provided via ... Z specifies the power to use with POWER_Z when using POWER_Z PERCENT =F Use percent instead of proportions in LOGIT when using LOGIT |
Generates a plot.
if (FALSE) { METRIC<-c(rnorm(100,10,2),rnorm(200,12,4)) SPLIT<-c(rep("Good",100),rep("Bad",100),rep("DEVELISH",100)) PlotMetricBySplit(METRIC,SPLIT,MLAB="test variable",COL=c(2,3,4),TYPE="Ecdf") PlotMetricBySplit(METRIC,SPLIT, COL=c(2,3,4),TYPE="Ecdf",NPRETTY=4,SCALE="ID",DRAW_STEPS = T) PlotMetricBySplit(METRIC,SPLIT, COL=c(2,3,4),TYPE="Ecdf",NPRETTY=4,SCALE="ID",DRAW_STEPS = T,ECDF_POINTS = F) PlotMetricBySplit(METRIC,SPLIT,MLAB="test variable",COL=c(2,3,4), TYPE="Dens",ADJ=c(1,.5,2)) PlotMetricBySplit(METRIC,SPLIT,MLAB="test variable",COL=c(2,3,4),TYPE="Boxplot") PlotMetricBySplit(METRIC,SPLIT,MLAB="test variable",COL=c(2,3,4), TYPE="Stripchart",METHOD="jitter") }