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 systemfit)

resid.est

the estimation methods for the residual covariance matrix (as in systemfit)

instruments

the intruments used to estimate the model via 3-SLS (as in systemfit)

sigma.in

the \Sigma matrix, if the user wants to simulate a particular structure at stochastic level. Overrides 3SLS estimation if specified.

Value

A list with components

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 \Gamma' matrix.

Sigma

the \Sigma matrix.

Value

A list with components


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 causal_decompose()

eq.id

the equation to be tested for feedback effects

lb

lower bound of the parameter space required for gosolnp

ub

upper bound of the parameter space required for gosolnp

nrestarts

number of solver restarts (as in gosolnp)

nsim

number of random parameters to generate for every restart of the solver (as in gosolnp)

seed.in

seed number for gosolnp routine

Value

A list with components

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

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 \Gamma' matrix

A

the A matrix

Sigma

the \Sigma matrix

Value

A list with components