Type: | Package |
Title: | Finding Feedback Effects in SEM and Testing for Their Significance |
Version: | 1.1.0 |
Maintainer: | Gianmarco Vacca <gianmarco.vacca@unicatt.it> |
Description: | Provides two main functionalities. 1 - Given a system of simultaneous equation, it decomposes the matrix of coefficients weighting the endogenous variables into three submatrices: one includes the subset of coefficients that have a causal nature in the model, two include the subset of coefficients that have a interdependent nature in the model, either at systematic level or induced by the correlation between error terms. 2 - Given a decomposed model, it tests for the significance of the interdependent relationships acting in the system, via Maximum likelihood and Wald test, which can be built starting from the function output. For theoretical reference see Faliva (1992) <doi:10.1007/BF02589085> and Faliva and Zoia (1994) <doi:10.1007/BF02589041>. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R (≥ 3.1.0) |
Imports: | systemfit, psych, igraph, matrixcalc, MASS, numDeriv, Matrix, stringr, Rsolnp, dplyr, magrittr |
RoxygenNote: | 6.0.1 |
NeedsCompilation: | no |
Packaged: | 2019-04-11 16:16:59 UTC; gianmarco.vacca |
Author: | Gianmarco Vacca [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2019-04-11 16:32:41 UTC |
Estimation and decomposition of simultaneous equation model
Description
Estimate and/or decompose a Simultaneous Equation Model into its recursive and Interdependent sub-systems
Usage
causal_decompose(data, eq.system, resid.est = "noDfCor", instruments,
sigma.in = NULL)
Arguments
data |
the data frame containing the data |
eq.system |
the system of equations (a list of formula objects, e.g. as in pkg |
resid.est |
the estimation methods for the residual covariance matrix (as in |
instruments |
the intruments used to estimate the model via 3-SLS (as in |
sigma.in |
the |
Value
A list with components
-
eq.system
: the system of equations given as input -
Gamma
: the 3-SLS estimate of\Gamma'
-
C
: the matrix highlighting the interdependent mechanisms at deterministic level. -
Psi1
: the matrix highlighting the interdependent mechanisms at stochastic level. -
Psi0
: the matrix highlighting the causal mechanisms. -
A
: the 3-SLS estimate ofA
-
Sigma
: the 3-SLS estimate ofSigma
-
systemfit
: the output from thesystemfit
function used to estimate the model -
all.graph
: the path diagram of the model, using the packageigraph
-
dec.graph
: the path diagram of the decomposed model, with color coding for each vertex -
type.out
: the type of analysis performed, either 'simulation' or 'empirical'
Examples
data("macroIT")
eq.system = list(
eq1 = C ~ CP + I + CP_1,
eq2 = I ~ K + CP_1,
eq3 = WP ~ I + GDP + GDP_1,
eq4 = GDP ~ C + I + GDP_1,
eq5 = CP ~ WP + T,
eq6 = K ~ I + K_1)
instruments = ~ T + CP_1 + GDP_1 + K_1
causal_decompose(data = macroIT,
eq.system = eq.system,
resid.est = "noDfCor",
instruments = instruments,
sigma.in = NULL)
Decomposition starting from Gamma and Sigma
Description
Function to decompose \Gamma'
into recursive and
interdependent sub-matrices (internal use)
Usage
dec_calc(Gamma, Sigma)
Arguments
Gamma |
the |
Sigma |
the |
Value
A list with components
-
C
: the matrix highlighting the interdependent mechanisms at deterministic level. -
Psi1
: the matrix highlighting the interdependent mechanisms at stochastic level. -
Psi0
: the matrix highlighting the causal mechanisms. -
powers
: a list containing the matrix powers of\Gamma'
.
Testing for Feedback Effects in a Simultaneous Equation Model
Description
Testing for Feedback Effects in a Simultaneous Equation Model
Usage
feedback_ml(data, out.decompose, eq.id, lb = -200, ub = 200,
nrestarts = 10, nsim = 20000, seed.in = 1)
Arguments
data |
the data frame containing the data |
out.decompose |
the decomposition object resulting from |
eq.id |
the equation to be tested for feedback effects |
lb |
lower bound of the parameter space required for |
ub |
upper bound of the parameter space required for |
nrestarts |
number of solver restarts (as in |
nsim |
number of random parameters to generate for every restart of the solver (as in |
seed.in |
seed number for gosolnp routine |
Value
A list with components
-
rho.est
: a data frame with the maximum likelihood estimate ofrho
and the equations with which each element is involved in feedback-like mechanisms -
loglik
: the value of the log-likelihood of the model -
theta.hessian
: the hessian matrix for the estimated parameters -
rho.jacobian
: the Jacobian matrix of\rho
with respect to the entire set of parameters -
wald
: the resulting Wald test statistic
Examples
data("macroIT")
eq.system = list(
eq1 = C ~ CP + I + CP_1,
eq2 = I ~ K + CP_1,
eq3 = WP ~ I + GDP + GDP_1,
eq4 = GDP ~ C + I + GDP_1,
eq5 = CP ~ WP + T,
eq6 = K ~ I + K_1)
instruments = ~ T + CP_1 + GDP_1 + K_1
c.dec = causal_decompose(data = macroIT,
eq.system = eq.system,
resid.est = "noDfCor",
instruments = instruments)
feedback_ml(data = macroIT,
out.decompose = c.dec,
eq.id = 5,
lb = -200,
ub = 200,
nrestarts = 10,
nsim = 20000,
seed.in = 1)
Italian Macroeconomic Data
Description
Italian macroeconomic variables from Q3-1996 to Q2-2011 (T = 60 observations). The variables are
-
QTR
: quarter and year of the observation -
C
: expenses for consumption for Italian families -
CP
: value added -
WP
: private wages from dependent employment -
I
: gross investment -
K
: gross capital stock -
GDP
: gross domestic product -
T
: taxes -
CP_1
: lagged value added -
K_1
: lagged gross capital stock -
GDP_1
: lagged gross domestic product
Usage
data(macroIT)
Format
An object of class tbl_df
(inherits from tbl
, data.frame
) with 60 rows and 11 columns.
Source
http://dati.istat.it/
Examples
data(macroIT)
Rho Calculation
Description
Function to calculate rho (internal use)
Usage
rho_calc(l, Gamma, A, Sigma)
Arguments
l |
the equation index for which to calculate rho |
Gamma |
the |
A |
the |
Sigma |
the |
Value
A list with components
-
S0
: the selection matrix forp_j
. -
S1
: the selection matrix for\Gamma'
. -
S2
: the selection matrix. forA