Announcement

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

  • Name variable

    Hello,

    I have a dataset with a variable called "Country". I would like to know the code to know the name of the countries included in this variable?
    Thank you in advance.
    Last edited by Ana Vasconcelos; 25 Mar 2019, 18:21.

  • #2
    Perhaps the ISO Standard 3166 country codes described on this Wikipedia page are what you are seeing.

    https://en.wikipedia.org/wiki/List_o..._country_codes

    Comment


    • #3
      I would like to know the code that I need to use to have the names of the countries included in the dataset. The variable "countries" includes several countries..
      Thank you

      Comment


      • #4
        Code:
        tabulate countries
        or
        Code:
        contract countries, freq(count)
        list, noobs separator(0)

        Comment


        • #5
          I am sorry. Without your having showed us an example of your data, I assumed your variable "Country" has "country codes" like "BEL" and you were looking to convert those to country names like "Belgium". Apparently that is not what you want. What you want is the "Stata code" to tell you what values Country takes in your dataset.

          If you want to know all the values that a variable - suppose its name is "Country" but it could be anything - has in your dataset, then the command
          Code:
          tabulate Country, missing
          will tell you all the values for the variable, and as a bonus tell you how many observations each appears in, and whether any observations have missing values for the variable.

          Added in edit: the answer to this question given when you asked it in September 2016 will also work.

          https://www.statalist.org/forums/for...n-a-panel-data
          Last edited by William Lisowski; 25 Mar 2019, 18:36.

          Comment


          • #6
            It worked with "tabulate". Thank you!

            Comment

            Working...
            X