clear import delimited C:\Users\Fermin\Downloads\asg-2022-09-30.csv, delimiter("|") **Cáclulo para Veracruz sort cve_entidad by cve_entidad: egen asimssestado=total(ta) if ta>0 drop if asimssestado==. format %15.0g asimssestado egen totastrabajo=total(ta_sal) format %15.0g totastrabajo by cve_entidad: egen astrabajo=total(ta_sal) gen perma=tpu+tpc gen tperma=sum(perma) format %15.0g tperma by cve_entidad: egen permaestado=total(perma) format %15.0g permaestado gen event=teu+tec gen tevent=sum(event) format %15.0g tevent gen porcperma=(sum(perma)/sum(ta))*100 gen porcevent=(sum(event)/sum(ta))*100 sum egen totalmasasalarial= sum(masa_sal_ta) egen totalasasalariados= sum(ta_sal) gen sbc= totalmasasalarial/totalasasalariados format %15.0g totalmasasalarial totalasasalariados sort cve_municipio by cve_municipio: egen totmasasalarail=sum(masa_sal_ta) by cve_municipio: egen totasalariado=sum(ta_sal) by cve_municipio: gen sbc_municipio= totmasasalarail/totasalariado format %15.0g totmasasalarail totasalariado duplicates drop cve_municipio, force merge 1:1 cve_municipio using "C:\Users\Fermin\Desktop\Municipios.dta" drop if _merge==2 sort sbc_municipio keep if cve_delegacion==29 |cve_delegacion==31 | cve_delegacion==32 keep if cve_entidad==30 keep descripciónmunicipio totmasasalarail totasalariado sbc_municipio save "C:\Users\Fermin\Desktop\OLV\Veracruz.dta", replace