lrtestspsur | R Documentation |
The function computes a set of Likelihood Ratio tests, LR,
that help the user to select the spatial structure of the SUR model.
To achieve this goal, lrtestspsur
needs to estimate the nested SUR models (options: "sim", "slx", "slm",
"sem", "sdm", "sdem", and "sarar"), using the function
spsurml
.
The nested models listed above are compared using ANOVA tables and LR tests.
lrtestspsur (objectr, objectu = NULL)
objectr |
An |
objectu |
An |
A fundamental result in maximum-likelihood estimation shows that if model A is nested in model B, by a set of n restrictions on the parameters of model B, then, as the sample size increases, the test statistic: -2log[l(H_{0}) / l(H_{A})] is a χ^{2}(n), being l(H_0 the estimated likelihood under the null hypothesis (model A) and l(H_A the estimated likelihood under the alternative hypothesis (model B).
The list of (spatial) models that can be estimated with the function
spsurml
includes the following (in addition to the
"slx" and "sdem"):
"sim": SUR model with no spatial effects
y_{tg} = X_{tg} β_{g} + ε_{tg}
"slm": SUR model with spatial lags of the explained variables
y_{tg} = ρ_{g} Wy_{tg} + X_{tg} β_{g} + ε_{tg}
"sem": SUR model with spatial errors
y_{tg} = X_{tg} β_{g} + u_{tg}
u_{tg} = λ_{g} Wu_{tg} + ε_{tg}
"sdm": SUR model of the Spatial Durbin type
y_{tg} = ρ_{g} Wy_{tg} + X_{tt} β_{g} + WX_{tg} θ_{g} + ε_{tg}
"sarar": SUR model with spatial lags of the explained variables and spatial errors
y_{tg} = ρ_{g} Wy_{tg} + X_{tg} β_{g} + u_{tg}
u_{tg} = λ_{g} W u_{tg} + ε_{tg}
This collection of models can be compared, on objective bases, using the LR principle and the following nesting relations:
"sim" vs either "slx", slm", "sem", "sdm", "sarar"
"slm" vs either "sdm", "sarar"
"sem" vs either "sdm", "sdem", "sarar"
"slx" vs either "sdm", "sdem"
Object of anova
class including, the list of models and,
for each model, the logLik, degrees of freedom and AIC.
If two nested models have been included as arguments,
the corresponding LR-test and its p-value associated.
Fernando Lopez | fernando.lopez@upct.es |
Roman Minguez | roman.minguez@uclm.es |
Jesus Mur | jmur@unizar.es |
Mur, J., Lopez, F., and Herrera, M. (2010). Testing for spatial effects in seemingly unrelated regressions. Spatial Economic Analysis, 5(4), 399-440.
Lopez, F.A., Mur, J., and Angulo, A. (2014). Spatial model selection strategies in a SUR framework. The case of regional productivity in EU. Annals of Regional Science, 53(1), 197-220.
spsurml
, lmtestspsur
################################################# ######## CROSS SECTION DATA (nG=1; nT>1) ######## ################################################# #### Example 1: Spatial Phillips-Curve. Anselin (1988, p. 203) rm(list = ls()) # Clean memory data("spc", package = "spsur") lwspc <- spdep::mat2listw(Wspc, style = "W") Tformula <- WAGE83 | WAGE81 ~ UN83 + NMR83 + SMSA | UN80 + NMR80 + SMSA spcsur.slm <- spsurml(formula = Tformula, data = spc, type = "slm", listw = lwspc) ## ANOVA Table SLM model lrtestspsur(spcsur.slm) ## Test ANOVA SIM versus SLM spcsur.sim <- spsurml(formula = Tformula, data = spc, type = "sim", listw = lwspc) lrtestspsur(spcsur.sim, spcsur.slm) ## VIP: If you want to examine a particular example eliminate '#' and ## execute the code of the example (they have been commented to ## pass the checking time in CRAN) ## VIP: The output of the whole set of the examples can be examined ## by executing demo(demo_lrtestspsur, package="spsur") ## Test ANOVA SLM vs SDM #spcsur.sdm <- spsurml(formula = Tformula, data = spc, # type = "sdm", listw = lwspc) #lrtestspsur(spcsur.slm, spcsur.sdm) ## Test ANOVA SEM vs SDM #spcsur.sem <- spsurml(formula = Tformula, data = spc, # type = "sem", listw = lwspc) #lrtestspsur(spcsur.sem, spcsur.sdm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.