Learn R Programming

spsur (version 1.0.0.2)

lr_betas_spsur: Likelihood ratio for testing homogeneity constraints on beta coefficients of the SUR equations.

Description

Function lr_betas_spsur obtains a Likelihood Ratio test, LR in what follows, with the purpose of testing if some of the \(\beta\) coefficients in the G equations of the SUR model are equal. This function has a straightforward application, especially when \(G=1\), to the case of testing for the existence of structural breaks in the \(\beta\) parameters.

The function can test for the homogeneity of only one coefficient, of a few of them or even the homogeneity of all the slope terms. The testing procedure implies, first, the estimation of both a constrained and a unconstrained model and, second, the comparison of the log-likelihoods to compute the LR statistics.

Usage

lr_betas_spsur(Form = NULL, data = NULL, R = NULL, b = NULL,
  W = NULL, time = NULL, X = NULL, Y = NULL, G = NULL,
  N = NULL, Tm = NULL, p = NULL, type = "sim",
  printmodels = FALSE, cov = FALSE, trace = FALSE)

Arguments

Form

An object created with the package Formula that describes the model to be estimated. This model may contain several responses (explained variables) and a varying number of regressors in each equation.

data

An object of class data.frame or a matrix.

R

A row vector of order (1xpr) with the set of r linear constraints on the beta parameters. The first restriction appears in the first p terms, the second restriction in the next p terms and so on. Default = NULL.

b

A column vector of order (rx1) with the values of the linear restrictions on the beta parameters. Default = NULL.

W

A spatial weighting matrix of order (NxN), assumed to be the same for all equations and time periods.

time

Time variable.

X

A data matrix of order (NTmGxp) with the observations of the regressors The number of covariates in the SUR model is p = \(sum(p_{g})\) where \(p_{g}\) is the number of regressors (including the intercept) in the g-th equation, g = 1,...,G). The specification of X is only necessary if not available a Formula and a data frame. Default = NULL.

Y

A column vector of order (NTmGx1), with the observations of the explained variables. The ordering of the data must be (first) equation, (second) time dimension and (third) Cross-sectional/spatial units. The specification of Y is only necessary if not available a Formula and a data frame. Default = NULL.

G

Number of equations.

N

Number of cross-section or spatial units

Tm

Number of time periods.

p

Number of regressors by equation, including the intercept. p can be a row vector of order (1xG), if the number of regressors is not the same for all the equations, or a scalar, if the G equations have the same number of regressors. The specification of p is only necessary if not available a Formula and a data frame.

type

Type of spatial model specification: "sim","slx", "slm", "sem", "sdm", "sdem" or "sarar". Default = "sim".

printmodels

Logical value: prints constrained and unconstrained models. Default = FALSE. models. Default = FALSE.

cov

Logical value to show the covariance matrix of the beta coefficients. Default = TRUE.

trace

Logical value to show intermediate results during estimation. Default = FALSE.

Value

The function estimates two variants of the same SUR model, namely, a restricted and a unrestricted version. The purpose, as indicated above, is testing homogeneity constraints between the \(\beta\) parameters of the different equations of the SUR. The output of lr_betas_spsur shows, in first place, the iteration sequence of the maximum-likelihood algorithm. Then appears the Likelihood Ratio, LR, test. The output also includes the maximum-likelihood estimation of the two models.

statistic The Values of the LR test.
p_val The p-value of the LR test.
df Degrees of freedom.
llik_unr The Log-likelihood of the unrestricted model.
llik_res The Log-likelihood of the restricted model.

References

  • Mur, J., L<U+00F3>pez, F., and Herrera, M. (2010). Testing for spatial effects in seemingly unrelated regressions. Spatial Economic Analysis, 5(4), 399-440.

See Also

spsurml, spsurtime, wald_betas

Examples

Run this code
# NOT RUN {
#################################################
######## CROSS SECTION DATA (G>1; Tm=1) ########
#################################################

#### Example 1: Spatial Phillips-Curve. Anselin (1988, p. 203)
rm(list = ls()) # Clean memory
data(spc)
Tformula <- WAGE83 | WAGE81 ~ UN83 + NMR83 + SMSA | UN80 + NMR80 + SMSA
## H0: equal beta for SMSA in both equations.
R <- matrix(c(0,0,0,1,0,0,0,-1),nrow=1)
b <- matrix(0,ncol=1)
LR_SMSA <-  lr_betas_spsur(Form = Tformula, data = spc, W = Wspc,
                           type = "sim", R = R, b = b, trace = TRUE,
                           printmodels = TRUE)

# }

Run the code above in your browser using DataLab