pctDiff {ssExtra}R Documentation

Utility to Calculate Percent Difference in Two Quantities

Description

This is a very simple little function to calculate the percentage difference between an ‘estimate’ and the ‘true’ value.

Usage

pctDiff(est,
        true,
        ...)

Arguments

est

The ‘estimate’ value, which can be a vector, to test against the true value(s) below.

true

The ‘true’ value, which can be a vector, to test against the estimate value(s) above.

...

Details

The simple percent difference: (est-true)/true*100.

Value

The result of the above computation, which can be a vector or scalar.

Author(s)

Jeffrey H. Gove

Examples

pctDiff(8, 10)
pctDiff(c(8, 12), 10)
pctDiff(c(8, 12), c(10, 6))

[Package ssExtra version 0.1-2 Index]