Announcement

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

  • Categorical variable conversion to continuous

    Hi all , I am working on a pooled cross-sectional data set. As of right now, my year variables are categorical and they range from 2002 to 2016. I am having trouble making these legitimate continuous variables (the c.year command returned " factor variable and time-series operators not allowed." I have made the years dummy variables for the other part of my project, this part must use continuous years. Thank you for your time.

  • #2
    Hi Zak. You'll be more likely to get help if you follow the instructions given in the FAQ. Pay particular attention to item 12.

    HTH.
    --
    Bruce Weaver
    Email: [email protected]
    Version: Stata/MP 18.5 (Windows)

    Comment


    • #3
      There is no separate c.year command. It may be used in some other command. But the statement as is doesn't make much sense. Maybe your year variable is fine but you are using a command that does not support factor variable notation. Like Bruce says, we need more to go on.

      If all you do have are year dummies something like this might work:

      gen year = 2000 + 16*year2016 + 15*2015 + ... + 2*2002.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

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

      Comment

      Working...
      X