Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

numDeltaMethod

Calculate numerical delta method for non-linear predictions.


Description

Given a regression object and an independent prediction function (as a function of the coefficients), calculate the point estimate and standard errors

Usage

numDeltaMethod(object, fun, gd=NULL, ...)

Arguments

object

A regression object with methods coef and vcov.

fun

An independent prediction function with signature function(coef, ...).

gd

Specified gradients

...

Other arguments passed to fun.

Details

A more user-friendly interface is provided by predictnl.

Value

Estimate

Point estimates

SE

Standard errors

See Also

See Also predictnl.

Examples

##---- 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)
  }

rstpm2

Smooth Survival Models, Including Generalized Survival Models

v1.5.2
GPL-2 | GPL-3
Authors
Mark Clements [aut, cre], Xing-Rong Liu [aut], Benjamin Christoffersen [aut], Paul Lambert [ctb], Lasse Hjort Jakobsen [ctb], Alessandro Gasparini [ctb], Gordon Smyth [cph], Patrick Alken [cph], Simon Wood [cph], Rhys Ulerich [cph]
Initial release
2021-02-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.