Starting from an initial table which provides at the time period t=0 the GDP by region (i) and industry (j), i.e., GDP0i,j.
At the time period t=1, I have just the GDP by region (GDP1i), on the one hand, and the GDP by industry (GDP1j), on the other hand.
My aim is to estimate the GDP by all combinations of region and industry, i.e., GDP1i,j.
Using mstdize from SSC, which is an iterative procedure of biproportional adjustment of rows and columns (developed by Nicholas Cox), I was able to achieve my goal:
clear*
input RGN IND GDP0
1 1 20900
1 2 10100
1 3 23700
2 1 15100
2 2 12600
2 3 42600
3 1 1600
3 2 2100
3 3 13800
4 1 10600
4 2 12100
4 3 18300
end
bysort RGN: egen TotGDP0_RGN = total(GDP0)
bysort IND: egen TotGDP0_IND = total(GDP0)
sort RGN IND
qui gen TotGDP1_RGN = .
tokenize 56700 68300 19000 38500
qui forval i = 1/4 {
replace TotGDP1_RGN = ``i'' if RGN == `i'
}
gen TotGDP1_IND = .
tokenize 58200 41900 82400
qui forval j = 1/3 {
replace TotGDP1_IND = ``j'' if IND == `j'
}
mstdize GDP0 TotGDP1_RGN TotGDP1_IND, by(RGN IND) gen(GDP1)
However, mstdize does not offer the possibility of minimizing an objective function while producing the target new table such as the Entropy function or the minimum square deviation function. Further, in many instance, we may have (from historical data) some lower band of GDP for different combinations (i, j). Thus, I am wondering whether there is a way with STATA to minimize an objective function conditional on (1) the target new row totals; (2) the target new column totals, and (3) the lower band of each component we may know.
Many thanks in advance for your help!
At the time period t=1, I have just the GDP by region (GDP1i), on the one hand, and the GDP by industry (GDP1j), on the other hand.
My aim is to estimate the GDP by all combinations of region and industry, i.e., GDP1i,j.
Using mstdize from SSC, which is an iterative procedure of biproportional adjustment of rows and columns (developed by Nicholas Cox), I was able to achieve my goal:
clear*
input RGN IND GDP0
1 1 20900
1 2 10100
1 3 23700
2 1 15100
2 2 12600
2 3 42600
3 1 1600
3 2 2100
3 3 13800
4 1 10600
4 2 12100
4 3 18300
end
bysort RGN: egen TotGDP0_RGN = total(GDP0)
bysort IND: egen TotGDP0_IND = total(GDP0)
sort RGN IND
qui gen TotGDP1_RGN = .
tokenize 56700 68300 19000 38500
qui forval i = 1/4 {
replace TotGDP1_RGN = ``i'' if RGN == `i'
}
gen TotGDP1_IND = .
tokenize 58200 41900 82400
qui forval j = 1/3 {
replace TotGDP1_IND = ``j'' if IND == `j'
}
mstdize GDP0 TotGDP1_RGN TotGDP1_IND, by(RGN IND) gen(GDP1)
However, mstdize does not offer the possibility of minimizing an objective function while producing the target new table such as the Entropy function or the minimum square deviation function. Further, in many instance, we may have (from historical data) some lower band of GDP for different combinations (i, j). Thus, I am wondering whether there is a way with STATA to minimize an objective function conditional on (1) the target new row totals; (2) the target new column totals, and (3) the lower band of each component we may know.
Many thanks in advance for your help!