calculate a comparison distribution and associated descriptive statisics.

1 | ```
compdist(a, b, model, output, lambda1, lambda2, trim, strat1, strat2)
``` |

`a` |
a vector containing the sum of square errors or -2 * log likelihood estimates derived using modelling strategy 1. |

`b` |
a vector containing the sum of square errors or -2 * log likelihood estimates derived using modelling strategy 2. |

`model` |
type of regression model. Either "linear" or "logistic". |

`output` |
logical. If output is TRUE the function will return two graphical representations of the comparison distribution. |

`lambda1` |
a vector or matrix containing the estimated shrinkage factors derived using strategy 1 |

`lambda2` |
a vector or matrix containing the estimated shrinkage factors derived using strategy 2 |

`trim` |
logical. If trim is TRUE a "trimmed" comparison distribution will be returned, along with a victory rate and median precision ratio derived using the trimmed distribution. The trimmed distribution only contains precision ratios within a range of plus or minus two times the interquartile range around the median precision ratio. |

`strat1` |
a list containing the strategy name and strategy-specific parameter values. |

`strat2` |
a list containing the strategy name and strategy-specific parameter values. |

This function works within `compare`

to calculate the comparison
distribution of strategy 2 against strategy 1. If `trim == TRUE`

, a
truncated distribution consisting of +/- 2 * interquartile range around the
median precision ratio.

The victory rate for linear regression is the left tail probability with a cut-off of 1. The victory rate for logistic regression instead taken at a cut-off of 0. For more details, refer to the accompanying PDF document.

If `output == TRUE`

the function will plot a histogram of the distribution
and a scatterplot of the precision (SSE or -2 log likelihood) of strategy 2 against
strategy 1. Points that lie below the red or blue line represent trials in which
strategy 2 outperformed strategy 1 (the victory rate).

For details of returned values and examples see `compare`

.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.