Good day everybody,
with my data set I would like to check whether the tax rate (*_PIT) for countries has changed depending on how they participated in the world wars (1) neutral, 2) joined later, 3) from the beginning).
Now I have assigned a war status (variable _WAR) to each country/year (0=not at war, 1=participant in war). For example, for the USA this would mean:
The USA would therefore be considered as category 2 "joined later".
In the first step, I would like to assign the countries to the categories. I think the code could look like this:
I would then like to use an average variable to examine, by category (0,1,2), how taxes have developed in each country, including beyond the period after the First World War till 1933
I have separated the First and Second World Wars from each other because I can't think of anything at the moment to represent this in code. So this becomes two steps.
Apart from the fact that the code does not work.
Have I made a mistake somewhere in my thinking about how it could be better designed?
with my data set I would like to check whether the tax rate (*_PIT) for countries has changed depending on how they participated in the world wars (1) neutral, 2) joined later, 3) from the beginning).
Now I have assigned a war status (variable _WAR) to each country/year (0=not at war, 1=participant in war). For example, for the USA this would mean:
Code:
1914 0 1915 0 1916 0 1917 1 1918 1
In the first step, I would like to assign the countries to the categories. I think the code could look like this:
Code:
*Neutral, late entry, belligerent unab prefix : *_WAR local prefix : subinstr local prefix "_WAR" "", all foreach p of local prefix { gen `p'_NEU = 0 if sum(`p'_WAR) == 0 & `p'_WAR !=. & year > 1914 & year < 1918 gen `p'_LAT = 1 if sum(`p'_WAR) >= 1 & sum(`p'_WAR) <= 4 & `p'_WAR !=. & year > 1914 & year < 1918 gen `p'_BEL = 2 if sum(`p'_WAR) == 5 & `p'_WAR !=. & year > 1914 & year < 1918 }
Code:
*Average Variables egen AVG_NEU = rowmean(*_PIT) if *_NEU == 0 & year > 1910 & year < 1933
Apart from the fact that the code does not work.
Have I made a mistake somewhere in my thinking about how it could be better designed?
Comment