Displaying 20 results from an estimated 2000 matches similar to: "GMM, panel data, functions lag() and diff()"
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
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
2011 Sep 05
1
plm package, R squared, dummies in panel data
Hi R-helpers,
I have two questions I hope you could help me with them:
In the plm package how can I calculate the R2 within, R2 between and R2
overall? Is there any special reason to not display these values?
When using first differences do I need to have some special care with
dummies (both year dummies and industry dummies)?
(A friend who works with Stata told me that there is
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)
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
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
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 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 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
2009 Jun 16
2
save the output of summary(lmList(x)) into a dataframe
Hi r-helpers!
I need to save the output of summary() function that I?ve
runned like this:
z<- lmList(y~x1+x2| x3,
na.action=na.omit,data1,subset=year==1999)
w<-summary(z)
The output (w) is something like this:
Call:
Model: y ~ x1 + x2 | x3
Data: data1
Coefficients:
(Intercept)
Estimate Std. Error t value Pr(>|t|)
1 0.081110514 1.141352e-01
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
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
2009 Jun 02
1
R: subset dataframe/list
Thank you all!!!
The problem was the decimal symbol! My data was saved in a
txt file, so I?ve introduced the dec="," in ?read.table?
and it worked. What I?ve done was
coeficientes<-read.table("coeficientes.txt",sep="\t",header=T,dec=",")
Then, subset worked fine
coeficientesWanted<-subset(coeficientes,b1>0)
Thanks again,
Cec?lia Carmo
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>
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
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
2010 Aug 21
3
problems with merge() - the output has many repeated lines
Hi everyone,
I have been merging many big dataframes (about 80000 rows
each) and I never had this problem, but now it happened to
me and I want to know if someone knows what could be
happening.
The final dataframe has many rows, an impossible number! I
have done edit(dataframe) and I saw that there are many
repeated rows (all equal).
Thanks for any help,
Cec?lia Carmo
Universidade de
2013 Jun 08
0
data
Hi,
Try this:
final3New<-read.table(file="real_data_cecilia.txt",sep="\t")
dim(final3New)
#[1] 5369??? 5
#Inside the split within split, dummy==1 for the first row.? For lists that have many rows, I selected the row with dummy==0 (from the rest) using the #condition that the absolute difference between the dimensions of those rows and the first row dimension was minimum
2009 Jan 21
0
trouble switching to 'plm' from 'xtabond' and Stata
Hello,
I am switching to R from Stata and I am having particular trouble with
the transition from Stata's 'xtabond' and 'ivreg' commands to the
"plm" package. I am trying to replicate some of the dynamic panel data
work using the UK Employment data in Arellano and Bond (1991) and
available as 'EmplUK' under the 'plm' package.
I have been