I want to do a collpase per year to get the mean the the total number of observations for all my numeric variables. The problem is that I need to give names for these variables once they are used for (mean) and (count) and so stata cannot keep the same name for both. Is there a smart way of giving vames (like m_variable c_variable) for all of them, without having to write collapse (mean) m_idade = idade m_d_bra = d_bra .....?
Code:
collapse (mean) idade d_bra d_fem loc_obit d_asmed d_exa d_cir viol_obit d_tbobit d_graobit puer_obit /// d_mat d_fet d_inf m_idad m_escol m_gra m_gest m_d_pn m_qtfv m_qtfm racacor1 racacor2 racacor3 /// escol1 escol2 escol3 escol4 loc_obit1 loc_obit2 m_pes1 m_pes2 m_pes3 m_obpar1 m_obpar2 /// m_obpar3 tpcid_cau1 tpcid_cau2 tpcid_cau3 tpcid_cau4 tpcid_cau5 tpcid_ori1 tpcid_ori2 /// tpcid_ori3 tpcid_ori4 tpcid_ori5 (count) idade d_bra d_fem loc_obit d_asmed d_exa d_cir viol_obit d_tbobit d_graobit puer_obit /// d_mat d_fet d_inf m_idad m_escol m_gra m_gest m_d_pn m_qtfv m_qtfm racacor1 racacor2 racacor3 /// escol1 escol2 escol3 escol4 loc_obit1 loc_obit2 m_pes1 m_pes2 m_pes3 m_obpar1 m_obpar2 /// m_obpar3 tpcid_cau1 tpcid_cau2 tpcid_cau3 tpcid_cau4 tpcid_cau5 tpcid_ori1 tpcid_ori2 /// tpcid_ori3 tpcid_ori4 tpcid_ori5, by (anom_obit)
Comment