Replace for by lapply in stata2ddi