predictnl-methods | R Documentation |
A simple, yet exceedingly useful, approach to estimate the variance of a function using the numerical delta method. A number of packages provide functions that analytically calculate the gradients; we use numerical derivatives, which generalises to models that do not offer analytical derivatives (e.g. ordinary differential equations, integration), or to examples that are tedious or error-prone to calculate (e.g. sums of predictions from GLMs).
## S4 method for signature 'mle2'
predictnl(object, fun, newdata=NULL, gd=NULL, ...)
## S4 method for signature 'stpm2'
predictnl(object, fun, newdata=NULL,
link = c("I", "log", "cloglog", "logit"), gd=NULL, ...)
## S4 method for signature 'pstpm2'
predictnl(object, fun, newdata=NULL,
link = c("I", "log", "cloglog", "logit"), gd=NULL, ...)
## S4 method for signature 'aft'
predictnl(object, fun, newdata=NULL,
link = c("I", "log", "cloglog", "logit"), gd=NULL, ...)
object |
An object with |
fun |
A function that takes |
newdata |
An optional argument that defines newdata to be passed to |
link |
A character string to represent the link on which to calculate the variance and confidence intervals. |
gd |
An optional matrix of gradients. If this is not specified, then the gradients are calculated using finite differences. |
... |
Other arguments that are passed to |
The confidence interval estimation is based on the delta method using numerical differentiation.
A data-frame with components Estimate
, lower
and
upper
, with an attribute "newdata" for the newdata
data-frame.
an stpm2
fit
stpm2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.