1.
Code:
reg lncost ib6.iso_str i.var_str, eform(exp_coeff) baselevels
Code:
reg lncost ib6.iso_str shr i.var_str, eform(exp_coeff) baselevels
Then, I tried an alternative formulation of the above two regressions to see if this way I could compare their coefficients. Again, the only difference is the inclusion of the variable 'shr' in the second regression.
3.
Code:
reg lncost ib6.iso_str ibn.var_str, noconstant eform(exp_coeff) baselevels
Code:
reg lncost ib6.iso_str shr ibn.var_str, noconstant eform(exp_coeff) baselevels
How can I compare the 'iso_str' coefficients outputted by these two regressions, with and without the variable 'shr'? Perhaps there is a way around the collinearity issue I am facing, e.g. rearranging my data differently?
Thank you. An excerpt of my data is below.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str3 iso str5 var double(cost shr) long(iso_str var_str) float lncost "CIV" "x1105" 11458.3333333333 49.674 1 1 9.346473 "COD" "x1105" 44083.2888217523 56.12 2 1 10.693836 "MRT" "x1105" 540 47.176 3 1 6.291569 "NGA" "x1105" 16842.1052631579 50.481 4 1 9.731637 "TGO" "x1105" 5590.76923076923 58.838 5 1 8.628872 "TZA" "x1105" 48000 66.947 6 1 10.778956 "ZAF" "x1105" 904.655301204819 34.150000000000006 7 1 6.807554 "CIV" "x1106" 10441.1764705882 49.674 1 2 9.253512 "COD" "x1106" 39391.0340285401 56.12 2 2 10.581293 "MRT" "x1106" 520 47.176 3 2 6.253829 "NGA" "x1106" 11834.3195266272 50.481 4 2 9.378759 "TGO" "x1106" 4398.8603988604 58.838 5 2 8.389101 "TZA" "x1106" 45000 66.947 6 2 10.714417 "ZAF" "x1106" 608.84493902439 34.150000000000006 7 2 6.411563 "CIV" "x1107" 12032.0855614973 49.674 1 3 9.395332 "MRT" "x1107" 463.636363636364 47.176 3 3 6.139101 "NGA" "x1107" 17391.3043478261 50.481 4 3 9.763725 "TGO" "x1107" 5015.38461538462 58.838 5 3 8.520266 "TZA" "x1107" 43636.3636363636 66.947 6 3 10.683646 "ZAF" "x1107" 984.375 34.150000000000006 7 3 6.892007 end label values iso_str iso_str label def iso_str 1 "CIV", modify label def iso_str 2 "COD", modify label def iso_str 3 "MRT", modify label def iso_str 4 "NGA", modify label def iso_str 5 "TGO", modify label def iso_str 6 "TZA", modify label def iso_str 7 "ZAF", modify label values var_str var_str label def var_str 1 "x1105", modify label def var_str 2 "x1106", modify label def var_str 3 "x1107", modify
0 Response to Collinearity error when including continuous variable in dummy regression
Post a Comment