Announcement

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

  • Local list with categorical variables

    I'm trying to run a regression with factor variables and when I create a local list with a whole bunch of categorical variables in i.var1 i.var2 format, I do not get any results. Is there any way to create a local macro with categorical variables in i.var1 i.var2 format, and use that variable list in a regression as factor variables?

    Ex.
    local group "i.agecat i.destination i.maristat i.contracttype"
    reg y `group'

    Thank you!

  • #2
    Your code looks good in principle.

    Make sure that the regress command can see the local, so don't execute lines one by one from the do-file editor. That's the main way that locals appear not to be recognised.

    Please don't refer to factor variable notation as a format. That word is already overloaded: display format, file format, data format (meaning layout), etc.

    Comment

    Working...
    X