Learn R Programming

econet (version 1.0.0.1)

quantify: quantify: quantification of marginal effects in linear-in-means models.

Description

quantify: quantification of marginal effects in linear-in-means models.

Usage

# S3 method for econet
quantify(object, ...)

Value

an object of class data.frame listing direct and indirect variable effects (mean, standard deviation, max, min).

Arguments

object

first object in the list of outcomes returned by net_dep (available only if the argument model is set to "model_B").

...

other arguments

Details

quantify returns marginal effects for net_dep objects when model = "model_B" and hypothesis = "lim". For additional details, see the vignette (doi:10.18637/jss.v102.i08).

See Also

net_dep

Examples

Run this code
# \donttest{
# Load data
data("db_cosponsor")
data("G_alumni_111")
db_model_B <- db_cosponsor
G_model_B <- G_cosponsor_111
G_exclusion_restriction <- G_alumni_111
are_factors <- c("party", "gender", "nchair")
db_model_B[are_factors] <- lapply(db_model_B[are_factors], factor)

# Specify formula
f_model_B <- formula("les ~gender + party + nchair")

# Specify starting values
starting <- c(alpha = 0.23952,
              beta_gender1 = -0.22024,
              beta_party1 = 0.42947,
              beta_nchair1 = 3.09615,
              phi = 0.40038,
              unobservables = 0.07714)

# Fit Linear-in-means model
lim_model_B <- net_dep(formula = f_model_B, data = db_model_B,
                       G = G_model_B, model = "model_B", estimation = "NLLS",
                       hypothesis = "lim", endogeneity = TRUE, correction = "heckman",
                       first_step = "standard",
                       exclusion_restriction = G_exclusion_restriction,
                       start.val = starting)
quantify(lim_model_B)
# }
# WARNING, This toy example is provided only for runtime execution.
# Please refer to previous examples for sensible calculations.
data("db_alumni_test")
data("G_model_A_test")
db_model <- db_alumni_test
G_model <- G_model_A_test
f_model <- formula("les ~ dw")
lim_model_test <- net_dep(formula = f_model, data = db_model,
                       G = G_model, model = "model_B", estimation = "NLLS",
                       hypothesis = "lim", start.val = c(alpha = 0.4553039,
                                                         beta_dw = -0.7514903,
                                                         phi = 1.6170539))
quantify(lim_model_test)

Run the code above in your browser using DataLab