marginal_effects | R Documentation |
Returns the estimated effect of a variable.
shortage_marginal(fit, variable, model, parameters) shortage_probability_marginal( fit, variable, aggregate = "mean", model, parameters ) ## S4 method for signature 'missing,ANY,market_model,ANY' shortage_marginal(variable, model, parameters) ## S4 method for signature 'missing,ANY,ANY,market_model,ANY' shortage_probability_marginal(variable, aggregate, model, parameters) ## S4 method for signature 'missing,ANY,market_model,ANY' shortage_marginal(variable, model, parameters) ## S4 method for signature 'market_fit,ANY,missing,missing' shortage_marginal(fit, variable) ## S4 method for signature 'market_fit,ANY,ANY,missing,missing' shortage_probability_marginal(fit, variable, aggregate)
fit |
A fitted market model. |
variable |
Variable name for which the effect is calculated. |
model |
A market model object. |
parameters |
A vector of parameters. |
aggregate |
Mode of aggregation. Valid options are "mean" (the default) and "at_the_mean". |
The estimated effect of the passed variable.
shortage_marginal
: Marginal effect on market system
Returns the estimated marginal effect of a variable on the market system. For a system variable x with demand coefficient β_{d, x} and supply coefficient β_{s, x}, the marginal effect on the market system is given by
M_{x} = \frac{β_{d, x} - β_{s, x}}{√{σ_{d}^{2} + σ_{s}^{2} - 2 ρ_{ds} σ_{d} σ_{s}}}.
shortage_probability_marginal
: Marginal effect on shortage probabilities
Returns the estimated marginal effect of a variable on the probability of observing a shortage state. The mean marginal effect on the shortage probability is given by
M_{x} \mathrm{E} φ≤ft(\frac{D - S}{√{σ_{d}^2 + σ_{s}^2 - 2 rho σ_{d} σ_{s}}}\right)
and the marginal effect at the mean by
M_{x} φ≤ft(\mathrm{E}\frac{D - S}{√{σ_{d}^2 + σ_{s}^2 - 2 rho σ_{d} σ_{s}}}\right)
where M_{x} is the marginal effect on the system, D is the demanded quantity, S the supplied quantity, and φ is the standard normal density.
# estimate a model using the houses dataset fit <- diseq_deterministic_adjustment( HS | RM | ID | TREND ~ RM + TREND + W + CSHS + L1RM + L2RM + MONTH | RM + TREND + W + L1RM + MA6DSF + MA3DHF + MONTH, fair_houses(), correlated_shocks = FALSE, estimation_options = list(control = list(maxit = 1e+5))) # mean marginal effect of variable "RM" on the shortage probabilities #' shortage_probability_marginal(fit, "RM") # marginal effect at the mean of variable "RM" on the shortage probabilities shortage_probability_marginal(fit, "CSHS", aggregate = "at_the_mean") # marginal effect of variable "RM" on the system shortage_marginal(fit, "RM")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.