PlotStepwise: Plotting function for stepwise results

Description Usage Arguments Value Author(s)

View source: R/Plotting_functions.R

Description

This function plots the results of a stepwise analyses with resampling to equal sample size. The function will plot the line connecting the means of each stepwise increment increase of K and will also plot the range around the mean. The default upper and lower limit is set to the 5th and 95th percentiles.

Usage

1
2
3
4
5
6
7
PlotStepwise(
  StepwiseResultsMat,
  Percentiles = c(0.05, 0.95),
  PlotCol = "darkblue",
  Add = FALSE,
  Xlabel = "K"
)

Arguments

StepwiseResultsMat

a matrix where the rows are the cross-validation percentage result for each iteration of resampling to equal sample size and the columns are the stepwise increase in k.

Percentiles

a vector of two values denoting the upper and lower limit of the resampling to be plotted. Values must be between 0 and 1. Default is .05 and .95.

PlotCol

is the colour of the line and the polygon representing the range of cross-validation percentage at the user defined percentiles.

Add

is a logical value to determine if the the plot should be added to a previous plot. For example if the StepwiseResultsMat is the weighted result and if the user would like to plot the results of an unweighted analysis on the same plot for comparison.

Xlabel

is the label to be used on the x axis. Default is 'K'; however, this function can be used for stepwise analysis of PCA and so the user may wish to change the x label.

Value

Plots a graph of mean CCV percentages with the percentiles plotted as a polygon range around the mean.

Author(s)

Ardern Hulme-Beaman


ArdernHB/KnnDist documentation built on Feb. 5, 2021, 5:09 a.m.