Hello there,

Got a question. I am working on a panel data and I am trying to find the mean of some variables, by village groups. The data ranges from year 2008 to 2018 for each village group. I have tried to use -collapse- but I have not been successful. I have read the reason for this in one of the statalist posts on the same problem. Unfortunately, I am unable to figure out any other way of achieving my goal. Currently, the command is as follows:

xtset gpid year
local name3 "jcissue jc_sc jc_st jc_gen personwrk_allot hh_wrkd person_wrkd schh_wrkd sthh_wrkd persondgen_wrkd scpersond_wrkd stpersond_wrkd wpersond_wrkd persond labexp_disb matexp_disb labexp_dp matexp_dp"
foreach name3 in jcissue jc_sc jc_st jc_gen personwrk_allot hh_wrkd ///
person_wrkd schh_wrkd sthh_wrkd persondgen_wrkd scpersond_wrkd ///
stpersond_wrkd wpersond_wrkd persond labexp_disb matexp_disb ///
labexp_dp matexp_dp {
}

I really don't know how I should continue after this? Kindly help.