Displaying 20 results from an estimated 2000 matches similar to: "plm package, R squared, dummies in panel data"
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
2009 May 29
1
error message in plm
Hi everyone,
Could anyone tell me what means the follow error message
Error in xj[i] : invalid subscript type 'closure'
It happens when I run the function plm, like this:
>ff<-totaccz~lactivoz+varvolnegz
>ss<-plm(ff,data=regaccdis,na.omit)
Error in xj[i] : invalid subscript type 'closure'
> coef(ss)
(Intercept) lactivoz varvolnegz
0.02571212 6.94227541
2009 Aug 21
1
Panel Data Analysis (PLM) - Fixed Effects - "cannot allocate vector of length"
Hello to all on the list,
I'm trying to estimate a fixed effects model from a large (unbalanced) panel
data set.
I have no problems when using only an individual effect or only a time
effect, but I get an error message when I try for a "twoways" effect. Here
is some of the code:
paneldata27 is the entire panel data set:
> dim(paneldata27)
[1] 1178831 8
>
2009 May 29
1
save plm coefficients
Hi R-helpers,
I want to determine the coefficients of the following
regression for several subsets, and I want to save it in a
dataframe:
The data is in ?regaccdis?, ?regaccdis$caedois? is the
column that defines the subsets and the function I have
runned is
coef(plm(ff,data=regaccdis,na.action=na.omit,model="pooling",subset=(regaccdis$caedois==i)))
I?ve created a dataframe named
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
2011 Sep 26
0
how to handle with gap's in panel data (plm package)
Hi everyone,
I’m working with a panel of firm/years observations. My panel not only is
unbalanced but also have some gap’s in years.
For example, firm 1 has 1999, 2000, 2001, 2004, 2005, firm 2 has 2000, 2001,
2003, 2005, and so on.
I’m using the plm package and what I’m asking is how can I handle with this
gap’s ?
Thank you very much,
Cecília Carmo
Universidade de Aveiro
2011 May 19
2
balanced panel data
I have a dataframe with many firm-year observations and many variables.
Not all firms have information for all the years.
I want another dataframe with only those firms that have information all
years.
This is, I want a balanced panel data, but with the maximum number of years.
In my reprocucible example I want to keep firms 1,2 and 3 (period 2000 to
2004).
I need your help to create a
2010 Nov 18
1
how do I build panel data/longitudinal data models with AR terms using the plm package or any other package
Hi All,
I am doing econometric modeling of panel data (fixed effects). We currently use Eviews to do this, but I have discovered a bug in Eviews 7 and am exploring the use of R to build panel data models / longitudinal data models. I looked at the plm package but do not see how I can incorporate AR terms in the model using the plm package. I have an Eviews model with two AR terms, AR(1) and
2011 Sep 22
0
corrigendum on fixed effects and R2 in within models
Dear list, dear Cecilia and Daniel,
sorry for coming in ten days late, I've been very busy lately so I came
across this email only today.
This is just to make some points clearer re: fixed effects and r2 in
package 'plm', to both you and the list. In particular, to make you
aware of some additional features.
Please see my comments below, with '##'.
Best,
Giovanni
2011 May 19
1
Problems with unsplit()
Hi everyone,
I have already used split() and unsplit() in data frames without problems,
but now I’m applying these functions to other data and when using unsplit()
I have received the following message:
Error in `row.names<-.data.frame`(`*tmp*`, value = c("1", "2", "3", "4", :
duplicate ''row.names'' are not allowed
In
2011 Oct 02
2
subset in dataframes
I need help in subseting a dataframe:
data1<-data.frame(year=c(2001,2002,2003,2004,2001,2002,2003,2004,
2001,2002,2003,2004,2001,2002,2003,2004),
firm=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4),x=c(11,22,-32,25,-26,47,85,98,
101,14,87,56,12,43,67,54),
y=c(110,220,302,250,260,470,850,980,1010,140,870,560,120,430,670,540))
data1
I want to keep the firms where all x>0 (where there are
2012 Apr 26
1
PLM package PGGLS strange behavior
When using the PLM package (version 1.2-8), I encounter the probem that
calling the FGLS estimator evokes strange behavior, when choosing the
"random" effects model. After calling the PGGLS function to estimate FGLS,
PLM gives me a warning, stating that the "random" model has been replaced
with the "pooling" model. I would, however, really like to estimate the
random
2013 Apr 03
1
linear model coefficients by year and industry, fitted values, residuals, panel data
Hi R-helpers,
My real data is a panel (unbalanced and with gaps in years) of thousands of firms, by year and industry, and with financial information (variables X, Y, Z, for example), the number of firms by year and industry is not always equal, the number of years by industry is not always equal.
#reproducible example
firm1<-sort(rep(1:10,5),decreasing=F)
year1<-rep(2000:2004,10)
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 =
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers
#I have a data panel of thousands of firms, by year and industry and
#one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not
#and another variable the represents the firm dimension (total assets in thousand of euros)
#I need to create two separated samples with the same number os firms where
#one firm in the first have a corresponding
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
2013 Jun 10
2
please check this
Hi,
Try this:
which(duplicated(res10Percent))
# [1] 117 125 157 189 213 235 267 275 278 293 301 327 331 335 339 367 369 371 379
#[20] 413 415 417 441 459 461 477 479 505
res10PercentSub1<-subset(res10Percent[which(duplicated(res10Percent)),],dummy==1)? #most of the duplicated are dummy==1
res10PercentSub0<-subset(res10Percent[which(duplicated(res10Percent)),],dummy==0)
2009 Jun 01
1
Fwd: subset dataframe/list
--- the forwarded message follows ---
-------------- next part --------------
An embedded message was scrubbed...
From: "Cecilia Carmo" <cecilia.carmo at ua.pt>
Subject: Re: [R] subset dataframe/list
Date: Mon, 01 Jun 2009 21:33:15 +0100
Size: 3657
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090601/921f7638/attachment-0002.mht>
2009 Jun 01
2
subset dataframe/list
Hi R-helpers!
I have the following object:
> head(coeficientes)
caedois b1 b2 b3
1 1 0,033120395 -20,29478338 -0,274638864
2 2 -0,040629634 74,54239889 -0,069958424
3 5 -0,001116816 35,2398622 0,214327185
4 10 0,171875
5 14 0,007288399 40,06560548 -0,081828338
6 15 0,027530346 0,969969409 0,102775555
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