See '?deltavar()' in package emdbook. Only change was to replace 'expr <- as.expression(substitute(fun))' with 'expr<-fun'. This was necessary b/c of problems that arose when invoking 'deltavar()' inside of another function. Specifically, I wanted to call 'deltavar()' each time an outer function was executed, but apply deltavar to a unique set of x-values upon each execution of the outer function. For reasons I don't entirely understand, this range of x-values defined within the outer function's environment was not being adequately passed to the internal environment of deltavar. There's probably a classier/more resilient way of fixing this, but in the short term, I patched it over by creating 'deltavar2()', and using parse/a custom string in 'get.nbcurve.tpc()' when 'deltavar2()' is called.
1 |
fun |
Function to calculate the variance of, given parameter estimates in meanvals |
meanval |
'possibly named vector of mean values of parameters' |
vars |
'list of variable names: needed if params does not have names, or if some of the values specified in params should be treated as constant' |
Sigma |
'numeric vector of variances or variance-covariance matrix' |
verbose |
'print details?' |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.