Displaying 15 results from an estimated 15 matches for "grunfeld".
2012 Mar 20
1
MA process in panels
Dear R users,
I have an unbalanced panel with an average of I=100 individuals and a total
of T=1370 time intervals, i.e. T>>I. So far, I have been using the plm
package.
I wish to estimate a FE model like:
res<-plm(x~c+v, data=pdata_frame, effect="twoways", model="within",
na.action=na.omit)
?where c varies over i and t, and v represents an exogenous impact on x
2011 Jun 18
0
Unexpected result with lag() et diff() in plm package.
..., BUT then it does work
properly when it is run a second time. (This is demonstrated in the code
below.
diff() does not work at all if it is run before lag(). It works properly if
it is run after lag(). The problem occurs only inside a transform
statement. lag() and diff() work correctly with Grunfeld.p$l.value <-
lag(Grunfeld.p$value,1)
Grunfeld.p$d.value <- diff(Grunfeld.p$value,1)
Here is code to reproduce the error:
library(plm)
data(Grunfeld)
Grunfeld.p <- pdata.frame(Grunfeld,c("firm","year"))
Grunfeld.p <- transform(Grunfeld.p, l.value = lag(value,1))
h...
2013 Jan 11
0
Manual two-way demeaning of unbalanced panel data (Wansbeek/Kapteyn transformation)
...balanced panel, I receive results which
differ (even though being close).
I guess I am missing something. Every comment pointing me to the right
solution would be of great value to me. Also, comments on how to increase
the efficiency of my function would help!
Please find an example based on the Grunfeld data below.
Thank you very much!
Philipp Grueber
##########################
library(MASS)
getQ<-function(object,t.index,i.index){
t.ind<-object[,t.index]
i.ind<-object[,i.index]
nam<-unique(i.ind)
tim<-unique(t.ind)
n<-nrow(object)
N<-length(nam)
T<-length(tim)...
2013 Apr 08
2
How can I extract part of the data in a panel dataset?
Taking the Grunfeld data, which is built-in in R, for example,
(1)How can I construct a dataset (or dataframe) that consists of the data
of all firms in 1951?
(2)How can I calculate the average capital in each form over the period
1951-1954?
What I can imagine is to categorize the data by firm, and then select the
d...
2009 Mar 08
1
singular matrices in plm::pgmm()
...using pgmm() on any dataset besides
Arellano/Bond's EmplUK, as shown in the vignette?
Whatever I try, I eventually get a runtime error because of a singular
matrix at various points in pgmm.diff() (which gets called by pgmm()).
For example, when estimating a "dynamic" version of the Grunfeld data:
data(Grunfeld, package="Ecdat")
grun <- pgmm(dynformula(inv ~ value + capital, lag=list(1,1,1),
log=T), data=Grunfeld, gmm.inst=~log(inv), lag.gmm=list(c(2,5)),
model="twosteps")
Error in solve.default(suml(A2)) :
system is computationally singular: reciprocal condit...
2007 May 24
1
lme with corAR1 errors - can't find AR coefficient in output
Dear List,
I am using the output of a ML estimation on a random effects model with
first-order autocorrelation to make a further conditional test. My model
is much like this (which reproduces the method on the famous Grunfeld
data, for the econometricians out there it is Table 5.2 in Baltagi):
library(Ecdat)
library(nlme)
data(Grunfeld)
mymod<-lme(inv~value+capital,data=Grunfeld,random=~1|firm,correlation=co
rAR1(0,~year|firm))
Embarrassing as it may be, I can find the autoregressive parameter
('Phi', if I...
2011 Nov 22
0
Unexpected result with lag() et diff() in plm package.
I didn't see you got an answer posted to this question:
You can't modify a pdata.frame object. Your transforms turn it back to a normal data frame and diff and lag won't work as expected.
Try:
Grunfeld.p <- pdata.frame(Grunfeld,c("firm","year"))
tmp <- transform(Grunfeld.p, d.value = diff(Grunfeld.p$value,1))
tmp <- cbind(tmp, l.value = lag(Grunfeld.p$value,1))
...
When everything is in shape, convert it back to a pdata.frame for further analysis:
Grunfeld.p <-...
2010 Apr 09
0
panel regression with twoways random effects, on unbalanced data?
...implementing this be particularly difficult?
Where should one look in the source?
- perform the regressions manually as suggested in ?Econometrics in R?
[1]. But what would be the correct lme() syntax for a twoways RE
model? For example,
library("AER")
library("plm")
data("Grunfeld", package = "AER")
pgr <- plm.data(Grunfeld, index = c("firm", "year"))
gr_re <- plm(invest ~ value + capital, data = pgr,
model = "random", effect="individual")
gr_lme <- lme(invest ~ value + capital, Grunfeld, random=~1|firm)
summa...
2010 Mar 16
2
plm "within" models: is the correct F-statistic reported?
...; model, when using
"time" or "twoways" effects in plm() [1] and when manually specifying
the time control dummies [2].
[1] vignette("plm")
[2] http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf
Two examples below:
library("AER")
data("Grunfeld", package = "AER")
library("plm")
gr <- subset(Grunfeld, firm %in% c("General Electric",
"General Motors", "IBM"))
pgr <- plm.data(gr, index = c("firm", "year"))
> dim(pgr)
[1] 60 5
## the first example is actu...
2011 Feb 22
1
Adjusting for autocorrelation in a panel model
I am working with panel data. I am using the plm package to do this.
I would like to do be able to adjust for autocorrelation, as one does with
glm models and correlation structures (eg corr=corARMA(q=4)) . In
particular, I want to employ MA(4) error structure.
Is there a way of doing this with the plm package?
(Note: I do not really want to use the pggls function for various
2009 Apr 19
2
importing spreadsheet data - linera regression - panel data
Hi everyone and thank you for the help you could give me.
My data is in a spreadsheet. The 1st column identifies the
firm (with the fiscal number), the columns 2 to 11 have
the variable value for 11 years. I have many variables
(files like this). Each file has about 40.000 firms
(rows). I transformed all the files in txt files. The data
is a panel data, like this:
firm revenu2007 revenue2006
2010 Feb 25
2
error using pvcm() on unbalanced panel data
Dear all
I am trying to fit Variable Coefficients Models on Unbalanced Panel
Data. I managed to fit such models on balanced panel data (the example
from the "plm" vignette), but I failed to do so on my real, unbalanced
panel data.
I can reproduce the error on a modified example from the vignette:
> require(plm)
> data("Hedonic")
> Hed <- pvcm(mv ~ crim + zn + indus
2009 Dec 10
0
plm ? tests of poolability ? error: insufficient number
...nice hearing from you again. I must restate a couple of my old hints,
though ;^)
1) please always put the authors c/c, as we are not guaranteed to browse
through the r-help every day
2) please provide reproducible examples.
As example(pooltest) keeps working fine, as do some other cases I tried
(Grunfeld data etc.), I don't know what the problem is but evidently
your data are peculiar in exposing it.
Sure the data numerosity must be enough, but maybe you have something
which doesn't vary along some dimension, and gets dropped? or some
groups which are all-NA? Do the "random" and...
2009 Mar 30
0
pgmm (Blundell-Bond) sample needed)
...Roodman's tutorial,
2.6). This looks theoretically ok. Whether this is meaningful in
applied practice is an issue I will discuss with the package
maintainer. IMHO it is not, apart maybe for illustrative purposes, and
it might well encourage bad habits (see the discussion about (not)
fitting the Grunfeld model by GMM on this list, some weeks ago).
2) fitting the simple models
Simplest possible model: AR(1) with individual effects
x(i,t)= a*(x(i,t-1)) + bi + c
This is what Ivo asked for in the first place. As the usual example is on data from the Arellano and Bond paper,
available in package ...
2009 Apr 01
0
回复: R-help Digest, Vol 73, Issue 32
...Roodman's tutorial,
2.6). This looks theoretically ok. Whether this is meaningful in
applied practice is an issue I will discuss with the package
maintainer. IMHO it is not, apart maybe for illustrative purposes, and
it might well encourage bad habits (see the discussion about (not)
fitting the Grunfeld model by GMM on this list, some weeks ago).
2) fitting the simple models
Simplest possible model: AR(1) with individual effects
x(i,t)= a*(x(i,t-1)) + bi + c
This is what Ivo asked for in the first place. As the usual example is on data from the Arellano and Bond paper,
available in package ...