Displaying 20 results from an estimated 9000 matches similar to: "Unexpected result with lag() et diff() in plm package."
2011 Jun 18
0
Unexpected result with lag() et diff() in plm package.
I have an unexpected result with the functions lag() and diff() in the plm
(panel data) package when used with transform(). These plm-specific
functions are supposed to generate lags and first differences within each
panel.
lag() does not work properly the first time (it reproduces the same
series--this is a common time series pitfall), BUT then it does work
properly when it is run a second
2009 Dec 29
0
Problems when using lag() in plm package
Hi,
I've been trying out the plm package, which seems like a great boon to
those who want to analyze panel data in R. I haven't started to use the
estimation functions themselves - for now I am just interested in having
a robust way to deal with lags in unbalanced panel data, since it is
such a royal pain to deal with all the special cases.
However, In my tests, I found behavior that
2013 Jan 11
0
Manual two-way demeaning of unbalanced panel data (Wansbeek/Kapteyn transformation)
Dear R users,
I wish to manually demean a panel over time and entities. I tried to code
the Wansbeek and Kapteyn (1989) transformation (from Baltagi's book Ch. 9).
As a benchmark I use both the pmodel.response() and model.matrix() functions
in package plm and the results from using dummy variables. As far as I
understood the transformation (Ch.3), Q%*%y (with y being the dependent
variable)
2010 Mar 16
2
plm "within" models: is the correct F-statistic reported?
Dear R users
I get different F-statistic results for a "within" 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 =
2009 Mar 08
1
singular matrices in plm::pgmm()
Hi list,
has anyone succeeded in 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
2011 Sep 27
0
Keep consecutive year observations (remove gap's) in panel data (dataframes). Difficulties in using lag(). Package plm.
Hi everyone.
I have two questions. I’ve found some other questions and answers similar to
these but they didn’t solve my problem.
I’m working with a panel of firm/years observations (see my reproducible
example). I’m using the plm package.
My panel not only is unbalanced but also have some gap’s in years.
#reproducible example
2010 Apr 09
0
panel regression with twoways random effects, on unbalanced data?
Dear R users
What would be the best way to approach estimating a panel regression
with twoways random effects, on unbalanced data? Unfortunately, the
"plm" package has no implementation of twoways random effects for
unbalanced data. Currently I'm considering two approaches:
- extend "plm" to cover this type of panel regression. (For the
authors, cc'ed:) Would
2009 May 08
1
plm: plm.data vs pdata.frame
Hello,
I am trying to use the plm package for panel econometrics. I am just
trying to get started and load my data. It seems from most of the
sample documentation that I need to use the pdata.frame function to
get my data loaded. However, even after installing the "plm" package,
my R installation cannot find the function. I am trying to follow the
example in plmEN.pdf (
2012 Mar 08
1
Panel models: Fixed effects & random coefficients in plm
Hello,
I am using {plm} to estimate panel models. I want to estimate a model that
includes fixed effects for time and individual, but has a random individual
effect for the coefficient on the independent variable.
That is, I would like to estimate the model:
Y_it = a_i + a_t + B_i * X_it + e_it
Where i denotes individuals, t denotes time, X is my independent variable,
and B (beta) is the
2017 Jun 05
0
issues in plm using random effect model
Dear Sir,
Thank you for accepting my request for registration on this site.
I am trying to solve panel data problems using plm package , but while
suing random effect model i am getting following messege saying
"
Warning message:In sqrt(sigma2) : NaNs produced
"
In some other cases i am getting message saying where TSS = NA , that I am
not understanding
I am sending you my code along
2010 May 17
0
plm(..., model="within", effect="twoways") is very slow on unablanaced data (was: Re: Regressions with fixed-effect in R)
Hello Giovanni
I made a minor modification to your function, which now allows to
compute the within R-sq in Twoways Within models (see below).
However I ran into an issue that I have already encountered before:
whenever I try to fit Twoways Within models on my unbalanced data, the
process is strangely slow and I usually terminate it either after
~15min or when my CPU hits 100C. This is similar to
2017 Jun 12
0
issues in plm using random effect model
Dear Kailas Gokhale,
The negative individual variance is not a problem with your code or plm.
It a property of your data. Please check the posts of Giovanni Millo on
this topic:
[R] R: plm random effect: the estimated variance of the individual
effect is negative
Millo Giovanni Giovanni_Millo at Generali.com
Sat Jan 5 10:10:01 CET 2013
You can find the posts in the archive by rseek.org.
2008 Mar 13
0
Need help with plm, cannot load pdata.frame
Hi all,
I installed all required packages for plm, but pdata.frame is not a
recognized function on R to start with.
I followed the first page of "introduction to plm" by Croissant&Millo, Here
are the messages:
*
> library(plm)
Loading required package: kinship
Loading required package: survival
Loading required package: splines
Loading required package: nlme
Loading required
2009 Dec 10
0
plm ? tests of poolability ? error: insufficient number
Hello Cecilia,
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
2011 Jun 12
3
Running a GMM Estimation on dynamic Panel Model using plm-Package
Hello,
although I searched for a solution related to my problem I didn?t find one,
yet. My skills in R aren?t very large, however.
For my Diploma thesis I need to run a GMM estimation on a dynamic panel
model using the "pgmm" - function in the plm-Package.
The model I want to estimate is: "Y(t) = Y(t-1) + X1(t) + X2(t) + X3(t)" .
There are no "normal" instruments
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)
2011 Sep 22
2
the opposite of lag() in panel data
Hi R-helpers
I want a function that performs the opposite of lag() with panel data.
I have transformed my data before with pdata.frame(mydata,
index=c("groupindex", “timeindex"))
And then I’ve done lag(mydata, -1) but it doesn’t work.
The error message was:
Error in rep(1, ak) : invalid ''times'' argument
Thank you in advance,
Cecília Carmo
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
data between 1951 and 1954 for each firm, but how can I do it?
Thanks,
Miao
2012 Jul 09
0
Problem in plm package
Hello everyone,
I am working with plm package and I have problem with random and within
models, which are giving errors which says "empty model". However, the model
is not empty. In the source code for plm.fit, where the error originates it
says something like (writing from the top of my head...)
X <- model.matrix(formula,data, lhs=1,...)
if (ncol(X) == 0) stop("empty
2010 Sep 16
0
improvements to plm fitting
In the course of some work I have been doing for Revolution Analytics I have
had the necessity of modifying the plm function so that it would not die
halfway through fitting. In particular, I was able to more than halve the
runtime (for my particular run) and improve its memory usage with three
small modifications:
1.) Replacing throughout apply(X, 2, mean) with colMeans, similarly with