Skip to content
Prev 324965 / 398503 Next

matched samples, dataframe, panel data

HI,
Do you want to impose this on 'res' on 'final3'?
If it is on `res`:
res1<-do.call(rbind,lapply(split(res,(1:nrow(res)-1)%/%2+1),function(x) x[abs(diff(x$dimension))<200,]))
row.names(res1)<-1:nrow(res1)
nrow(subset(res1,dummy==0))
#[1] 14
?nrow(subset(res1,dummy==1))
#[1] 14

?head(res1)
#? firm year industry dummy dimension
#1??? 1 2000?????? 20???? 0????? 2120
#2??? 5 2000?????? 20???? 1????? 2189
#3??? 4 2000?????? 20???? 0????? 3178
#4??? 7 2000?????? 20???? 1????? 3245
#5??? 4 2001?????? 20???? 0????? 2678
#6 ?? 2 2001?????? 20???? 1????? 2789
A.K.



----- Original Message -----
From: Cecilia Carmo <cecilia.carmo at ua.pt>
To: R help <r-help at r-project.org>
Cc: arun <smartpink111 at yahoo.com>
Sent: Friday, June 7, 2013 5:51 PM
Subject: RE: [R] matched samples, dataframe, panel data

Thank you very much.

I apologize but I want to ask only one more thing:

How to do if I want in addition to impose that the diffence between 
dimensions doesn't exced an absolute value, for example, 200.

Firm 1 continues matching with firm 5 in year 2000 because 
2189-2120=69, and 69 is < 10%x2120=212, and 69 is also < 200

But firm 20 doesn't match with firm 17 in year 2001
because 6754-6438=316, and 316 is < 10%x6438=643.8, but 316 is > 200


Thank you

Cec?lia