search for: dfbonds

Displaying 1 result from an estimated 1 matches for "dfbonds".

Did you mean: fbonds
2012 Jul 11
1
do I need plyr, apply or something else?
...over 1 year and append some statistics to each row ( sd(Var1), cor(Var1,Var2) over that year etc) a. It seems I might be able to use ddply for this, but I can't work out how to code the stats function to only look back over one year, rather than the full data range b. For example: dfBondsWithCorr<-ddply(dfBonds, .(BondID), transform,corr=cor(Var1,Var2),.progress="text") returns a dataframe where for each bond it has same corr for each date 2) On each date, subset dfBondsWithCorr by certain qualification criteria, then to the qualifiers fit a regression through a V...