For a model whose inefficiency scale depends on covariates (the _Z
models), the marginal effects of those covariates on the mean and variance of
the inefficiency term, \(\partial E[u]/\partial z_k\) and
\(\partial \mathrm{Var}[u]/\partial z_k\).
marginal_effects(object, average = FALSE, component = c("u", "h"))With average = FALSE, a data frame with one row per observation:
sigma_u, E_u, Var_u, then one dE_u.d<z> and one
dVar_u.d<z> column per non-constant variance determinant. Attributes
"average" (the average marginal effects), "link" and
"family" record the convention used.
With average = TRUE, just the named vector of average marginal effects.
an object of class "sfareg" from sfm
("NHN_Z", "NE_Z") or psfm
("TRE_Z", "GTRE_Z"), fitted with a variance-determinant
formula such as y ~ x1 + x2 | z.
which inefficiency component to differentiate. "u"
(the default) is the only choice for every model except
psfm(model_name = "GTRE_Z"), where it is the transient
component; "h" selects that model's persistent component,
parameterized by the third formula segment y ~ x | z | zp. The
output columns are named after the component, so a table cannot be misread
once separated from the call that produced it.
if TRUE, return only the named vector of average
marginal effects. Default FALSE, which returns the full
per-observation table with that vector attached as the "average"
attribute.
A \(\delta\) coefficient is not interpretable on its own: it sits in a log link for a scale parameter, so its units are neither those of \(u\) nor those of \(z\), and its magnitude is not comparable across models whose link differs. The marginal effect is on the scale of \(u\), and is what applied work reports.
Writing \(s = \sigma_u(z)\), every derivative reduces to \(\partial s/\partial z_k\) times a constant that cancels back into the moment itself. For the half-normal and the exponential alike:
$$\textrm{SD link:} \quad \partial E[u]/\partial z_k = \delta_k E[u], \qquad \partial \mathrm{Var}[u]/\partial z_k = 2\delta_k \mathrm{Var}[u]$$ $$\textrm{variance link:} \quad \partial E[u]/\partial z_k = (\delta_k/2) E[u], \qquad \partial \mathrm{Var}[u]/\partial z_k = \delta_k \mathrm{Var}[u]$$
The factor of two matters. sfm()'s "NHN_Z" and
"NE_Z" place the linear predictor on the standard deviation,
\(\sigma_u = \exp(z'\delta)\), while psfm()'s "TRE_Z" and
"GTRE_Z" place it on the variance,
\(\sigma_u = \sqrt{\exp(z'\delta)}\). Reading a \(\delta\) from one family
with the other's convention in mind is wrong by exactly this factor. Reporting
the marginal effect instead of the coefficient removes the trap, since the
effect is on the scale of \(u\) either way.
The link is read from the fit rather than assumed, so a sfm
model fitted with z_link = "var" and a psfm model are
handled the same way and their effects are directly comparable.
psfm(model_name = "GTRE_Z") separates persistent inefficiency
\(h_i\) from transient \(u_{it}\) and gives each its own
determinant block, so both are available: component = "u" for the
transient effects and component = "h" for the persistent ones. Each
block is located by NAME rather than by position, because the \(\sigma_h\)
coefficients are the trailing ones and a positional rule would report them
under a \(\sigma_u\) label.
Effects are per observation, because \(\sigma_u\) varies with \(z\). Constant columns of the \(z\) design are dropped: the derivative with respect to an intercept is not a marginal effect.
Standard errors are deliberately not reported. The effect is a nonlinear function of both \(\delta\) and \(z\), so its sampling distribution requires the delta method through the full covariance matrix or a bootstrap; a number printed without one would be read as inference.
sfm, efficiency_ci
dat <- data_gen_cs(N = 300, rand = 1, sig_u = 1, sig_v = 0.3,
cons = 0.5, beta1 = 0.5, beta2 = 0.5, a = 5, mu = 0.5)
fit <- sfm(y_pcs_z ~ x1 + x2 | z, data = dat, model_name = "NHN_Z")
me <- marginal_effects(fit)
head(me)
## The conventional summary.
marginal_effects(fit, average = TRUE)
Run the code above in your browser using DataLab