When working with panel data, I need to create the cwc (centered within cluster) variables
quickly. Although there is "add time mean.." will do exaclty this job in
creating L2 variable, I have to do one more step to create the cwc variable. Can we have
some function to do the both? I am using the terminology used in multi-level models.
series Q_output_L2 = pmean(Q_output)
series Q_output_cwc = Q_output - Q_output_L2
series PF_fuelprice_L2 = pmean(PF_fuelprice)
series PF_fuelprice_cwc = PF_fuelprice - PF_fuelprice_L2
series LF_loadfactor_L2 = pmean(LF_loadfactor)
series LF_loadfactor_cwc = LF_loadfactor - LF_loadfactor_L2