| Title: | Spatial Panel Data Models |
|---|---|
| Description: | Fit the spatial panel data models: the fixed effects, random effects and between models. Compatibility updates by Renova. |
| Authors: | Taha Zaghdoudi [aut, cre] |
| Maintainer: | Taha Zaghdoudi <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.9001 |
| Built: | 2026-11-15 20:39:12 UTC |
| Source: | https://github.com/renova-r/spanel |
Fit the spatial panel data models: the fixed effect model, between model and the random effect model.
| Package: | spanel |
| Type: | Package |
| Version: | 1.0 |
| Date: | 2015-06-01 |
| License: | GPL-3 |
In this package, we apply the instrumental variables two stage estimation to fit the fixed effects, random effects and between spatial models.
Taha Zaghdoudi
Taha Zaghdoudi <[email protected]>
Amemiyia T. (1971), The estimation of the variances in a variance–components model, International Economic Review, 12, pp.1–13.
Baltagi B.H. (1981), Simultaneous equations with error components, Journal of econometrics, 17, pp.21–49.
Baltagi B.H. (2001), Econometric Analysis of Panel Data. John Wiley and sons. ltd.
Baltagi B, Egger P, Pfa???ermayr M (2006), A Generalized Spatial Panel Data Model with Random Effects, woking paper, Center For Policy Research, Syracuse University.
Munnell AH (1990). Why has Productivity Growth Declined? Productivity and Public Investment, New England Economic Review, pp. 3-22.
# Load data data(Produc) data("usaww") # fit the fixed function fx<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="fe") # fit the random function summary(fx) #fit the between function be<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="be") summary(be) # fit the random function ran<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="re") summary(ran)# Load data data(Produc) data("usaww") # fit the fixed function fx<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="fe") # fit the random function summary(fx) #fit the between function be<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="be") summary(be) # fit the random function ran<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="re") summary(ran)
Hausman test
hausman(fixed, random)hausman(fixed, random)
fixed |
is the fixed effect object function |
random |
is the random effect object function |
Chisq the hausman statistic
P-value the probability value
df the degree of freedom
data(Produc) data("usaww") #fit the fixed function fx<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="fe") # fit the random function ran<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="re") # the Hausman test hausman(fx,ran)data(Produc) data("usaww") #fit the fixed function fx<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="fe") # fit the random function ran<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="re") # the Hausman test hausman(fx,ran)
the state
the year
private capital stock
highway and streets
water and sewer facilities
other public buildings and structures
public capital
gross state products
labor input measured by the employement in non–agricultural payrolls
state unemployment rate
data(Produc)data(Produc)
A data frame with 816 rows and 10 variables
method
span(y, ...)span(y, ...)
y |
the object used for method dispatch (a formula, or the response vector). |
... |
further arguments passed to methods |
Zaghdoudi Taha
formula
## S3 method for class 'formula' span(formula, data = list(), w, n, t, model = c("fe", "be", "re"), ...)## S3 method for class 'formula' span(formula, data = list(), w, n, t, model = c("fe", "be", "re"), ...)
formula |
log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp |
data |
the dataframe |
w |
is the contiguity matrix |
n |
the number of section |
t |
the time per section |
model |
"fe" for fixed effect "be" for between and "re" for random effect |
... |
not used |
Summary
## S3 method for class 'span' summary(object, ...)## S3 method for class 'span' summary(object, ...)
object |
is the object of the function |
... |
not used |