Skip to content

matched samples, dataframe, panel data

2 messages · Cecilia Carmo, arun

#
Hi,
May be this helps:
?lst1<-split(final3,list(final3$year,final3$industry))
lst2<-lst1[lapply(lst1,nrow)>0]
lst3<-lapply(lst2,function(x) lapply(x$dimension,function(y) x[(y< (x$dimension+x$dimension*0.1)) & (y> (x$dimension-x$dimension*0.1)),]))
lst4<-lapply(lst3,function(x) x[lapply(x,nrow)==2])
lst5<-lapply(lst4,function(x)x[!duplicated(x)])
lst6<-lst5[lapply(lst5,length)>0]

names(lst6)
# [1] "2000.20" "2001.20" "2002.20" "2003.20" "2004.20" "2001.30" "2002.30"
?#[8] "2001.40" "2002.40" "2003.40" "2004.40"


lst6["2000.20"]
#$`2000.20`
#$`2000.20`[[1]]
?#? firm year industry dummy dimension
#1???? 1 2000?????? 20???? 0????? 2120
#21??? 5 2000?????? 20???? 1????? 2189
#
#$`2000.20`[[2]]
?#? firm year industry dummy dimension
#16??? 4 2000?????? 20???? 0????? 3178
#31??? 7 2000?????? 20???? 1????? 3245
#
#$`2000.20`[[3]]
?#? firm year industry dummy dimension
#11??? 3 2000?????? 20???? 1????? 4532
#6???? 2 2000?????? 20???? 0????? 4890
A.K.