Announcement

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

  • Categorical Variable Types: Ordinal Independent Variable (as opposed to Nominal Independent Variable)

    I am new to Stata.

    One of the packages I have prior experience with is SPSS.

    In SPSS, one can define an Independent Variable as Scale, or Ordinal, or Nominal (the last 2 are each a type of Categorical Variable).

    ---------------------

    An example of an Ordinal Categorical Variable could be:

    What is the highest level of Formal Education you have completed:

    1 Less than high school (Grades 1-8 or no formal schooling)
    2 High school incomplete (Grades 9-11 or Grade 12 with NO diploma)
    3 High school graduate (Grade 12 with diploma or GED certificate)
    4 Some college, no degree (includes community college)
    5 Two year associate degree from a college or university
    6 Four year college or university degree/Bachelor’s degree (e.g., BS, BA, AB)
    7 Some postgraduate or professional schooling, no postgraduate degree
    8 Postgraduate or professional degree, including master’s, doctorate, medical or law degree (e.g., MA, MS, PhD, MD, JD)

    ---------------------

    An example of a Nominal Categorical Variable could be:

    What is your Marital Status:

    1 Married
    2 Living with a partner
    3 Divorced
    4 Separated
    5 Widowed
    6 Never been married
    7 Single

    ---------------------


    I've googled around for the phrases like "ordinal stata", and all that seems to come up is examples of Ordinal Logistic Regression where the Dependent Variable (not an Independent Variable) is Ordinal.


    My questions:
    a) does Stata differentiate between Ordinal and Nominal Categorical Independent Variables (when doing something like, say, Linear Regression or Logistic Regression)?
    b) if the answer to (a) is "Yes", then how does one tell Stata whether an Independent Variable is Ordinal or Nominal?
    Last edited by Lear Jett; 05 Oct 2019, 05:20.

  • #2
    Stata doesn't automatically recognize a level of variable measurement, so It is necessary for you to use prefix "i.", for example: -reg "DV" "IV1_continuous" i."IV_nominal"-.

    Also see this: https://www.stata.com/features/overv...tor-variables/
    Last edited by Karel Novak; 05 Oct 2019, 06:30.

    Comment


    • #3
      Lear:
      welcome to this forum.
      As an aside to Karel's helpful advice, see -fvvarlist- for a full explanation on how to create categorical variables and interactions.
      That said, as far as I know there's no way to tell Stata that a categorical variable is nominal or ordinal (admittedly, I do not know whether any difference would ever exist in terms of coefficiient estimates).
      Kind regards,
      Carlo
      (Stata 18.0 SE)

      Comment


      • #4
        It has been a while since I used SPSS but when I used it you could specify the type of variable, but there was no difference between the way nominal and ordinal independent variables were treated. In that sence there is no difference between SPSS and Stata. If you think SPSS does something different, can you tell us or give link what it is, so we can see if that is implemented in Stata?
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Some years ago, someone on StataList cited an technique and lit. references for an indicator ("dummy") coding scheme for ordinal variables (cumulative, I think), which could be found with some searching. However, I'd also bet that SPSS does not implement it, and I also don't think I've ever seen it used.

          Comment


          • #6
            I think Mike is referring to a program I wrote, and published in STB-6 many years ago (1992), called -cascade-; in modern Stata, what it does can easily be emulated with post-hoc procedures such as -contrast-; to find and download -cascade-, type -search cascade-

            Comment


            • #7
              Originally posted by Maarten Buis View Post
              It has been a while since I used SPSS but when I used it you could specify the type of variable, but there was no difference between the way nominal and ordinal independent variables were treated. In that sence there is no difference between SPSS and Stata. If you think SPSS does something different, can you tell us or give link what it is, so we can see if that is implemented in Stata?
              That's a great point. I don't know for sure if SPSS gives different outputs when it's ordinal vs. nominal (I will run some analyses a little later and get back).

              There's some information here that indicates that SPSS expects the variable types to be indicated correctly (ordinal vs. nominal): https://www.google.com/search?q=spss+ordinal+vs+nominal

              I would imagine that the information (whether the data is ordinal or nominal) would be useful for certain tests such as the Spearman Ranked Correlation test.

              Comment


              • #8
                I'm not sure what SPSS does with the info once it has got it. If you use a nominal variable as one of your regressors, does it automatically create dummy variables out of it? In PLUM, if you specify a nominal or continuous variable as dependent, does it give an error because the DV needs to be ordinal? Or are variable types specified mostly for documentation purposes and it is still your obligation to use the variables correctly?

                Nominal independent variables are handled easily enough with factor variable notation. There are different viewpoints on to handle ordinal independent variables. I discuss some of them at

                https://www3.nd.edu/~rwilliam/xsoc73...ndependent.pdf
                -------------------------------------------
                Richard Williams, Notre Dame Dept of Sociology
                Stata Version: 17.0 MP (2 processor)

                EMAIL: [email protected]
                WWW: https://www3.nd.edu/~rwilliam

                Comment


                • #9
                  Thank you for all your answers everyone. I can confirm it that classifying a variable as "ordinal vs nominal" in the case of SPSS regression analysis does not make a difference.

                  In the case of regression, when choosing the independent variables (SPSS sometimes calls them covariates), there's an additional option available where one can identify a variable as a categorical (and SPSS then offers contrast coding options). If one selects categorical here, it doesn't matter whether the variable was earlier identified (in the SPSS "variables" tab) as "ordinal or nominal".

                  So... to cut a long story short, SPSS doesn't offer a special feature in this case that Stata lacks. Whew!
                  Last edited by Lear Jett; 08 Oct 2019, 15:39.

                  Comment


                  • #10
                    It seems like the only purpose is documentation -- just like adding value labels or variable labels helps provide documentation. I might get a little annoyed if I went to the trouble of classifying every variable only to find out that it really didn't make any difference. If you have entered the info it seems like the program could do something with, e.g warn you if a nominal variable is going to be treated as continuous they way the model is currently specified.
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    Stata Version: 17.0 MP (2 processor)

                    EMAIL: [email protected]
                    WWW: https://www3.nd.edu/~rwilliam

                    Comment


                    • #11
                      https://libguides.library.kent.edu/SPSS/DefineVariables

                      This page claims

                      It is vital that you correctly define each variable's measurement level. This setting affects everything from graphs to internal algorithms for statistical analysis. Incorrectly specifying measurement level can have unintended and potentially disastrous effects on your results.
                      I haven't used SPSS in years so I can't verify the dire claims. Bruce Weaver , do you know?

                      I guess Stata users don't care what SPSS does. Although if you are switching from SPSS, you might have to be careful that you are telling STATA the correct way to handle your variables.
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      Stata Version: 17.0 MP (2 processor)

                      EMAIL: [email protected]
                      WWW: https://www3.nd.edu/~rwilliam

                      Comment


                      • #12
                        Richard, thanks for bringing this thread to my attention. The short answer is that some of the newer commands in SPSS do make use of the "variable level" meta-data. IIRC, GENLINMIXED is one such command. The older commands that have been around forever (e.g., REGRESSION, ONEWAY, etc.) do not. HTH.
                        --
                        Bruce Weaver
                        Email: [email protected]
                        Web: http://sites.google.com/a/lakeheadu.ca/bweaver/
                        Version: Stata/MP 18.0 (Windows)

                        Comment

                        Working...
                        X