apollo_deltaMethod {apollo} | R Documentation |
Delta method for Apollo models
Description
Applies the Delta method to calculate the standard errors of transformations of parameters.
Usage
apollo_deltaMethod(model, deltaMethod_settings)
Arguments
model |
Model object. Estimated model object as returned by function apollo_estimate. |
deltaMethod_settings |
List. Contains settings for this function. User input is required for all settings except those with a default or marked as optional.
|
Details
apollo_deltaMethod
can be used in two ways. The first and recommended way is to provide an
element called expression
inside its argument deltaMethod_settings
. expression
should contain the expression or expressions for which the standard error is/are to be calculated, as text. For
example, to calculate the ratio between parameters b1 and b2, expression=c(vtt="b1/b2")
should be used.
The second method is to provide the name of a specific operation inside deltaMethod_settings
.
The following five operations are supported.
-
sum
: Calculates the s.e. ofparName1
+parName2
-
diff
: Calculates the s.e. ofparName1
-parName2
andparName2
-parName1
-
prod
: Calculates the s.e. ofparName1
*parName2
-
ratio
: Calculates the s.e. ofparName1
/parName2
andparName2
/parName1
-
exp
: Calculates the s.e. ofexp(parName1)
-
logistic
: If onlyparName1
is provided, it calculates the s.e. ofexp(parName1)/(1+exp(parName1))
and1/(1+exp(parName1))
. IfparName1
andparName2
are provided, it calculatesexp(par_i)/(1+exp(parName1)+exp(parName2))
for i=1, 2, and 3 (par_3 = 1). -
lognormal
: Calculates the mean and s.d. of a lognormal distribution based on the mean (parName1
) and s.d. (parName2
) of the underlying normal.
By default, apollo_deltaMethod
uses the robust covariance matrix. However, the user can change this through the varcov
setting.
Value
Matrix containing value, s.e. and t-ratio resulting from the requested expression or operation. This is also printed to screen.