## VIP: The output of the whole set of the examples can be examined
## by executing demo(demo_lr_betas, package="spsur")
# \donttest{
#' #################################################
######## CROSS SECTION DATA (G>1; Tm=1) ########
#################################################
#### Example 1: Spatial Phillips-Curve. Anselin (1988, p. 203)
rm(list = ls()) # Clean memory
data(spc)
lwspc <- spdep::mat2listw(Wspc, style = "W")
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)
spcsur.slm <- spsurml(formula = Tformula, data = spc,
type = "slm", listw = lwspc)
summary(spcsur.slm)
lr_betas(spcsur.slm, R = R, b = b)
### Estimate restricted SUR-SLM model
spcsur.slmr <- spsurml(formula = Tformula, data = spc,
type = "slm", listw = lwspc,
R = R, b = b)
summary(spcsur.slmr)
# }
Run the code above in your browser using DataLab