numDeltaMethod | R Documentation |
Given a regression object and an independent prediction function (as a function of the coefficients), calculate the point estimate and standard errors
numDeltaMethod(object, fun, gd=NULL, ...)
object |
A regression object with methods |
fun |
An independent prediction function with signature
|
gd |
Specified gradients |
... |
Other arguments passed to |
A more user-friendly interface is provided by predictnl
.
Estimate |
Point estimates |
SE |
Standard errors |
See Also predictnl
.
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (object, fun, ...)
{
coef <- coef(object)
est <- fun(coef, ...)
Sigma <- vcov(object)
gd <- grad(fun, coef, ...)
se.est <- as.vector(sqrt(colSums(gd * (Sigma %*% gd))))
data.frame(Estimate = est, SE = se.est)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.