Hello, I was wondering if there was an easy way to calculate the rate of change in a variable for an unbalanced panel data set. Below is a detailed description in R of what I am asking. Thank you. Geoff
#Suppose I have the following unbalanced panel data; Person <- c(rep('Frank',5), rep('Tony',4), rep('Edward',4)); Year <- c(2005,2006,2007,2008,2009,2005,2006,2008,2009,2006,2007,2008,2009); Score <- c(55,58,63,23,34,38,56,87,44,32,98,45,56); Data <- data.frame(Person=Person, Year=Year, Score=Score); Data; #Is there a simple way to calculate the Year-to-Year percentage change in Score that accounts for the missing data?; #Notice that Tony is missing data for the Year 2007 and Edward is missing the Year 2005; #Note as well that we will need to end up losing the Year 2005 in the calculation; -- Geoffrey Smith Visiting Assistant Professor Department of Finance W. P. Carey School of Business Arizona State University [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.