Announcement

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

  • Changing the reference country in country dummies

    Hello everyone,

    I'm currently working on a dataset regarding regional data. I'm applying SEM, SLM and SARAR models and, of course, I've added country dummies in the independent variables using the option "i.VARIABLENAME". This is an example of the command I'm using for an OLS regression:

    xi: regress Unemployment Education Young Manufacturing Services i.CNTR_CODE

    CNTR_CODE is a variable that describe which country is a region part of and is not numeric, so for example it has AT to refer to Austria, DE to refer to Germany, etc.

    This command works well but, by default, it puts AT(Austria) as the reference country, so I'd like to see how the models change if I change the base country. So, I ask you if there are any options I can add to this command to change the base country. If not, please suggest me some other ways to arrive at the same result I'm pursuing. Thank you.
    Last edited by Massimo Pinto; 22 Jan 2024, 10:33. Reason: country, dummy, SARAR, SLM, SEM, regional, spatial

  • #2
    Your variable CNTR_CODE must be numeric. You would get an error message from Stata if you use the i. prefix with a string variable. What you have is a numeric variable with value labels attached. That means that interally, it is a numeric variable, probably with values like 1, 2, 3, 4, ..., and there is a value label attached to the variable that tells Stata to display AT instead of 1 in listings and displays of the data.

    You can change the reference category of a variable with the ib#. notation. See -help fvvarlist- for more details. But if you, for example, use ib5.CNTR_CODE instead of i.CNTR_CODE, you will get whichever country has numeric code 5 as the reference category in your outputs. In order to see what the numeric value associated with each country is, first run -des CNTR_CODE- and in the Value label column of the output you will see the name of the value label that is attached to CNTR_CODE. Then run -label list value_label-, replacing the italicized part with the actual name of the value label you found in the output of -des CNTR_CODE-.

    Comment

    Working...
    X