clear * DATA on export transactions by product and destination country, year 2003 * use export_fpc.dta sum edit ********* OLS reg ln_export ln_VMUE, cluster(id) reg ln_export ln_VMUE, cluster(sh6) ********* PANEL MODELS: * try usual tsset, and see the error: tsset id year * so xt-commands not usable here, due to the data structure where time and id do not identify a unit of analysis ! * Solution: build your unobserved heterogeneity dummies (fixed effects) by hand, at different levels, and use areg! ************* Firm-FE, as usual controlling for firm-invariant characteristics areg ln_export ln_VMUE, abs(id) areg ln_export ln_VMUE, abs(id) cluster(id) areg ln_export ln_VMUE, abs(id) cluster(sh6) * Try to put a firm-variable with abs(id), and see that this is omitted: areg ln_export ln_VMUE ln_emplM1, abs(id) ************ Country-FE (country dummies) implicitly controlling for characteristics of each country, which are constant across the other dimensions (product and firms), like GDP. *** Exploit variation of the data within a country (deviations from the average of the values of each country) *** So, variation is across firms and products: repeated values even if one firm export to a particular country, but more than one product. *** OR even if only one product is exported to a specific country, but more firms export that product in that country areg ln_export ln_VMUE, abs(country) areg ln_export ln_VMUE, abs(country) cluster(id) areg ln_export ln_VMUE, abs(country) cluster(sh6) * Try to put a firm-variable with abs(country), and see that you now get an estimate: the point is what does that coeff means ?? areg ln_export ln_VMUE ln_emplM1, abs(country) * If you had data on country-variables (like GDP), could you estimate an effect of that variable in the specification here above? ************* Product-FE (product dummies) implicitly controlling for characteristics of products, which are constant across the other dimensions (country and firms), like business cycle in that product market, or some technical characteristic. *** Exploit variation of the data within a product (deviations from the average of the values appearing for each product) *** So, variation is across firms and countries: repeated values even if one firm exports only one specific product, but in more than one country. *** OR even if only one country is the destination for a particular product, but more firms export that product in that country areg ln_export ln_VMUE, abs(sh6) areg ln_export ln_VMUE, abs(sh6) cluster(id) areg ln_export ln_VMUE, abs(sh6) cluster(sh6) * Try to put a firm-variable with abs(sh6), and see that you now get an estimate: the point is what does that coeff means ?? areg ln_export ln_VMUE ln_emplM1, abs(sh6) * If you had data on country-variables (like GDP), could you estimate an effect ? * If you had data on product characteristics, could you estimate an effect ************* Try know to fix multiple panel dimensions at the same time *********** Firm-Product FE: variation within the values of the same firm exporting the same product *** So, variation is only across the destinations: repeated values only if the same product is exported by the firm to different destinations * Try this below, and see the error areg ln_export ln_VMUE, abs(id sh6) * Only one var is allowed in abs(): You need to build the product-Firm FE egen FP_FE=group(id sh6) * Look at data to see what has been created: sort FP_FE edit * Run your regression: areg ln_export ln_VMUE, abs(FP_FE) areg ln_export ln_VMUE, abs(FP_FE) cluster(id) areg ln_export ln_VMUE , abs(FP_FE) cluster(sh6) * Try to put a firm-variable with abs(FP_FE), and see: areg ln_export ln_VMUE ln_emplM1, abs(FP_FE) cluster(id) * you do not get an estimate, as employment is fixed within firm-product combinations ! ************ Firm-Country FE: variation within the values of the same firm exporting in the same product *** So, variation is only across products: repeated values only if the same firm exports more than one product in the same country * Generate your fixed effects egen FC_FE=group(id country) * Run your regression: areg ln_export ln_VMUE, abs(FC_FE) cluster(id) areg ln_export ln_VMUE, abs(FC_FE) cluster(country) * Add firm-variable with abs(FC_FE), and see areg ln_export ln_VMUE ln_emplM1, abs(FC_FE) cluster(id) * you do not get an estimate, since employmetn is fixed within firm-country combinations! ************* Product-Country FE: variation within the values of the same product exported in the same product *** So, variation is only across firms: repeated values only if more than one firm export a specific product in a specific country * Generate your fixed effects egen PC_FE=group(sh6 country) * Run your regression: areg ln_export ln_VMUE, abs(PC_FE) cluster(id) areg ln_export ln_VMUE, abs(PC_FE) cluster(country) * Add firm-variable with abs(PC_FE): areg ln_export ln_VMUE ln_emplM1, abs(PC_FE) cluster(id) * This time you get an estimate: the point is what does that coeff means ?? It is estimated across firms exporting in that product-country market !