Announcement

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

  • Help to convert non-integer to integer for interaction?

    Hi all,

    I am pretty new to stata. I am running a probit regression and am trying to interact my Independent variables 'gini' with my other Independent categorical variable 'quintile' to find my binary outcome. However, when I attempt to run the command probit willtofight i.quintile#gini i get the error "gini: factor variables may not contain noninteger values". Gini coefficient ranges from 0-0.6 is there a way to convert them so their values contain integer values and work this interaction out? Thank you!

  • #2
    You want

    Code:
    probit willtofight i.quintile##c.gini
    Nota that I have added a #, which includes the (conditions) main effects in the model (you always want that!), and the c. operator, which tells Stata that gini is a continuous variable.
    Last edited by daniel klein; 06 Jan 2021, 11:37. Reason: Corrected typo; Thanks @Rich Goldstein

    Comment


    • #3
      just to correct small typo in #2; where he has ".cgini" after the double hash marks, it should be "c.gini"

      Comment


      • #4
        Thank you very much it worked!

        Comment

        Working...
        X