Dear Statalisters,

I am trying to generate a variable that measures how much the CPIA index for institutional quality has de- or increased per country. For some countries data is available for the entire time-frame of my research (2008-2016). However, for some countries the CPIA index is only available for, for example, 2011 and 2012 (the rest is missing). For all countries I would like to know the difference between the value for the last and first year of which data is available.

For answering this question, there are the following variables of interest:

Country
Year
CPIA

I hope my question is clear enough and someone can help me with answering.