clear all set more off #d ; gl raw "D:\Impuestos\Data\Raw data"; gl working "D:\Impuestos\Data\Working data"; gl imputaciones "D:\Impuestos\Data\Imputation data"; gl standardized "D:\Impuestos\Data\Standardized datasets"; * We use the dataset that contains all the barcodes that ever appear in the household consumption; use "$working\Barcodes_FINAL_input.dta", clear; /* --------------------------------------------------------------------------------- PART 1: BEVERAGE TAX DEFINITION ---------------------------------------------------------------------------------*/; * Step 1: We define all the categories that are considered drinks and define them as subject to the tax; local drinks `" "AGUA EMBOTELLADA" "AGUAS MINERALES" "BEBIDAS EN POLVO" "BEBIDAS ENERGETICAS" "BEBIDAS GASEOSAS CON SABOR" "BEBIDAS ISOTONICAS" "BEBIDAS SABORIZADAS SIN GAS" "CAFE" "HARINA PARA ATOLE" "LECHE EN POLVO" "LECHE EVAPORADA" "LECHE LIQUIDA" "LECHE SABORIZADA" "TE HELADO" "'; gen id_drinks=0; foreach cat of local drinks {; replace id_drinks=1 if producto=="`cat'"; }; gen tax_beverage=1 if id_drinks==1; *Step 2: We define the product that are excluded because they have no added sugar or are considered dairy based; local drink_exc `" "AGUA EMBOTELLADA" "AGUAS MINERALES" "LECHE LIQUIDA" "LECHE EN POLVO" "LECHE EVAPORADA" "LECHE SABORIZADA" "HARINA PARA ATOLE" "'; foreach cat of local drink_exc {; replace tax_beverage=0 if producto=="`cat'"; }; * Step 3: We remove the drinks that are classified as light or without added sugar; replace tax_beverage=0 if producto=="BEBIDAS EN POLVO" & (clas02=="SIN AZUCAR" | clas02=="LIGHT"); replace tax_beverage=0 if producto=="BEBIDAS ENERGETICAS" & subproducto=="LIGHT"; replace tax_beverage=0 if producto=="BEBIDAS GASEOSAS CON SABOR" & subproducto=="DIET/LIGHT"; replace tax_beverage=0 if producto=="BEBIDAS SABORIZADAS SIN GAS" & (clas04=="LIGHT" | subproducto=="NECTAR" | subproducto=="JUGOS PUROS" | subproducto=="A BASE DE SOYA"); replace tax_beverage=0 if producto=="TE HELADO" & clas02=="LIGHT"; replace tax_beverage=0 if producto=="CAFE" & (azucar==0 | azucar==.); /* --------------------------------------------------------------------------------- PART 2: FOOD TAX DEFINITION ---------------------------------------------------------------------------------*/; *Step 1: We define all the categories that are considered food and define them as subject to the tax; local food `" "ACEITES Y ANTIADHERENTES" "ALIMENTOS INFANTILES" "ATUN ENVASADO" "BARRAS DE CEREAL" "BOTANAS" "CAJETAS" "CALDOS Y SAZONADORES" "CEREALES PARA EL DESAYUNO" "COCTEL DE TOMATE" "CONDIMENTOS LIQUIDOS" "CHOCOLATE DE MESA" "CREMADORES/SUBSTITUTOS DE CREM" "CREMAS COMESTIBLES" "CREMAS DULCES" "EMPANIZADORES" "GALLETAS" "HELADOS Y PALETAS" "JUGOS DE VERDURA" "LECHE CONDENSADA" "MODIFICADORES DE LECHE" "MARGARINA" "MAYONESA" "MERMELADAS" "MIEL" "PAN INDUSTRIALIZADO" "PASTAS PARA SOPA" "POSTRE REFRIGERADO" "POSTRES EN POLVO" "PURE DE TOMATE" "SALSA CATSUP" "SALSAS BOTANERAS" "SALSAS CASERAS ENVASADAS" "SALSAS PARA PASTA" "SOPAS" "YOGURT" "'; gen id_food=0; foreach cat of local food {; replace id_food=1 if producto=="`cat'"; }; gen tax_food=1 if id_food==1; *Step 2: Remove the products that are below 275kcal per 100g; foreach cat of local food {; replace tax_food=0 if producto=="`cat'" & kcal_100gr<275; }; * These food products are measured in ml; local food_ml `" "HELADOS Y PALETAS" "'; foreach v of local food_ml {; replace tax_food=0 if producto=="`v'" & kcal_100ml<275; }; *Step 3: Remove products that are excluded according to the law; local food_exc `" "ACEITES Y ANTIADHERENTES" "ALIMENTOS INFANTILES" "ATUN ENVASADO" "CALDOS Y SAZONADORES" "COCTEL DE TOMATE" "CONDIMENTOS LIQUIDOS" "CREMADORES/SUBSTITUTOS DE CREM" "CREMAS COMESTIBLES" "EMPANIZADORES" "JUGOS DE VERDURA" "LECHE CONDENSADA" "MARGARINA" "MAYONESA" "MIEL" "PASTAS PARA SOPA" "PURE DE TOMATE" "SALSA CATSUP" "SALSAS BOTANERAS" "SALSAS CASERAS ENVASADAS" "SALSAS PARA PASTA" "SOPAS" "YOGURT" "'; foreach cat of local food_exc {; replace tax_food=0 if producto=="`cat'"; }; replace tax_food=0 if producto=="PAN INDUSTRIALIZADO" & (clas01=="INTEGRAL GRANDE" | clas01=="INTEGRAL MEDIANO" | clas01=="PAN INTEGRAL" | clas01=="PAN INTEGRAL GRANDE" | clas01=="SELECT INTEGRAL"); replace tax_food=0 if producto=="PAN INDUSTRIALIZADO" & (clas01=="PAN TOSTADO" | clas01=="PAN TOSTADO BLANCO"); replace tax_food=0 if producto=="MODIFICADORES DE LECHE" & (clas02=="FRESA" | clas02=="MALTEADA DE FRESA" | clas02=="VAINILLA" | clas02=="MALTEADA DE VAINILLA"); /* -------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------- */; * We make a general tax dummy and verify how many barcode are taxed; gen tax_ID=(tax_beverage==1 | tax_food==1); replace tax_ID=. if tax_beverage==. & tax_food==.; tab tax_ID; * Save the dataset; save "$standardized\base_estandarizada_barcodes_FINAL.dta", replace; * Create summary stats by product class; tab producto tax_beverage; tab producto tax_food; collapse tax_beverage tax_food tax_ID, by(producto);