deltamethod {CatDyn} | R Documentation |
The delta method for approximating the standard error of a transformation g(X) of a random variable X = (x1, x2, ...), given estimates of the mean and covariance matrix of X.
deltamethod(g, mean, cov, ses = TRUE)
g |
A formula representing the transformation. The variables must be labelled x1, x2, ... For example, ~ 1 / (x1 + x2). If the transformation returns a vector, then a list of formulae representing (g1, g2, ...) can be provided, for example list( ~ x1 + x2, ~ x1 / (x1 + x2) ). |
mean |
The estimated mean of X. |
cov |
The estimated covariance matrix of X. |
ses |
If TRUE, then the standard errors of g1(X), g2(X), ... are returned. Otherwise the covariance matrix of g(X) is returned. |
This function was copied from package msm.
It is used in CatDyn to backtransform from the logarithm because CatDyn parameters are all estimated in the log scale to improve numerical performance.
For more details see the help pages for function deltamethod of package msm.
A vector containing the standard errors of g1(X), g2(X), ... or a matrix containing the covariance of g(X).
C. H. Jackson <chris.jackson@mrc-bsu.cam.ac.uk>
#See the examples in package msm.