Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/accruedErrors.R
Returns the error between final data values and partially accruing values, by accrual lag.
1 | accruedErrors(x, y=NULL, func=NULL)
|
x |
Object of the |
y |
Optional second object of the |
func |
Error function to calcuate errors. Default behavior depends on whether one or two objects are included in the call. The first argument is the final value of the indicator and the second argument is the lagged value of the indicator. |
If only x
is specified, calculates the error between each lag value and the final value for each encounter date.
If both x
and y
are specified, then the error is calculated for the ratio y
/x
(except in that X/0 is set to NA
for all X). The deault error function in only x
is specified is the difference between the lag value and the corresponding final value. The default error function if both are specified is the difference in logs of the two values.
An object of the accruedErrors
class which consists of a matrix with columns "EncounterDate", "Lag" and "Error".
Julie Eaton and Ian Painter
data.accrued
,
plot.accruedErrors
,
summary.accruedErrors
1 2 3 4 5 6 7 8 9 10 11 | data(accruedDataExample) # simulated accrued data
testData <- data.accrued(accruedDataExample)
errors <- accruedErrors(testData)
plot(errors)
errors <- accruedErrors(testData, func = function(a,b) {sqrt(a) - sqrt(b)} )
plot(errors)
data(accruedDataILIExample) # simulated accrued data - ILI counts
testData2 = data.accrued(accruedDataILIExample)
errors <- accruedErrors(testData, testData2)
plot(errors)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.