Skip to content
Prev 248608 / 398503 Next

normalizing prices to a specific year - how to?

On Jan 27, 2011, at 3:02 PM, Martin Hvidberg wrote:

            
? tapply

Maybe something like:

mn2010 <- head(dafP[which(dafP$Y==2010), "Yav"], 1) # get just first  
2010 value
with(dafP,   tapply(P, Y, scale, center=mn2010) )

aggregate can be used with scale and may be better in some instances.  
Testing is not done here because you failed to provide a useful example.