Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to create a matrix with the weighted average of a variable?

    Hi all,

    For my thesis I want to explore the impact of a weighted average of the corporate tax rates abroad on the corporate tax base in country i. So my dependent variable is a proxy of the tax base of country i and my explanatory variables are the domestic tax rate, a weighted average of the tax rates abroad, and some controls. Since the tax rate variables are endogenous and I include the lagged dependent variable I employ system GMM. My data is an unbalanced panel of 45 countries covering most of the period 1988-2016.

    Now I want to weigh the tax rates abroad in several ways. One way is to weigh the tax rate in each country j by its GDP as a share of total GDP in all countries other than i. More formally, the weight will look something like the following:

    Click image for larger version

Name:	Knipsel.PNG
Views:	1
Size:	3.9 KB
ID:	1449225


    Anyone who has an idea how to construct such a weight with my data in Stata/IC 15? Which commands to use? Do I have to construct a weighting matrix?

  • #2
    Code:
    webuse grunfeld, clear
    ren company country
    ren invest GDP
    ren mvalue taxrate
    drop kstock time
    
    bysort year (country): egen globalgdp=total(GDP)
    gen globalgdp_exdomestic=globalgdp-GDP
    gen weight=GDP/globalgdp_exdomestic
    Edit: I think this is what you want. I dont understand entirely the mechanics of your weights here.
    Last edited by Jorrit Gosens; 16 Jun 2018, 02:59.

    Comment

    Working...
    X