get_se_func {OptimModel}R Documentation

Compute standard error for a function of model parameter estimates

Description

Compute standard error for a function of model parameter estimates via the delta method.

Usage

get_se_func(object, Func, ..., level=0.95)

Arguments

object

An optim_fit() object

Func

Function that returns a numeric value. See details.

...

Other arguments needed for Func.

level

Confidence level for confidence interval

Details

Func is of the form function(theta, ...). For example,

Func = function(theta, x){ exp(theta[1])*log(x)/theta[2] }

Value

Returns a data.frame with a single row for the estimated Func call (Est), its standard error (SE), and a confidence interval (lower, upper).

Author(s)

Steven Novick

See Also

optim_fit, rout_fitter

Examples

set.seed(123L)
x = rep( c(0, 2^(-4:4)), each =4 )
theta = c(0, 100, log(.5), 2)
y = hill_model(theta, x) + rnorm( length(x), sd=2 )
fit = optim_fit(theta, hill_model, x=x, y=y)
  
## Get SE for IC20 and IC40
ic.z = function(theta, z){  attr(hill_model, "backsolve")(theta, z)  }
get_se_func(object=fit, Func=ic.z, z=20)
get_se_func(object=fit, Func=ic.z, z=40)
  

[Package OptimModel version 2.0-1 Index]