foreach var of varlist * {
replace `var'=`var'[_n-1] if pid==pid[_n-1] & `var'==.
replace `var'=`var'[_n+1] if pid==pid[_n+1] & `var'==.
}
My problem is that I have a large number of variables in my dataset and I don't
want my commands to be applied to ALL variables. What commands can I use to
select all variables but a few?