Announcement

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

  • Nested Logit regression. SOS!

    Hello everybody,

    I am curretly facing two main problems in my nested logit model for explaining the type of travel pass used for riding public transport. The tree structure of a user’s decision about how to pay might look like this:


    Click image for larger version

Name:	Nested tree structure.jpg
Views:	1
Size:	5.9 KB
ID:	1351535

    I had typed the following command:

    nlogit choice ctrips || type: incom_r age_r, base(1) || mtabp:, noconstant case(id)

    Firstly, I believe that INCOME, and AGE (an individual-specific variables) influence whether a user will travel without a travel card or with travel card (top level) and that the alternative-specific variable CTRIPS influence the choice of the type of travel pass at the bottom level (the 2 types of travel pass). MTABP is the variable identifying the bottom level alternatives (type=mtabp (cash:1, used pass: 2 3 )

    My questions are the following:

    1. How to allow an independent variable in more than one level equation. I believe that income influences in both levels. I have read that specifying the collinear option will allow execution to proceed in this case but I am not able to specify this option.

    2.How is the right syntax to include categorical variables as individual specific variables. For example, with regard to age, I already included it in the command but I can not see the beta coefficients for all the age categories in the results


    Click image for larger version

Name:	results.jpg
Views:	2
Size:	93.3 KB
ID:	1351537


    Thank you in advance for your valuable help!,

    Paola


    Attached Files

  • #2
    Carolina (or Paola):
    as far as your second question is concerned, you should include -i.- before -age_r-
    Code:
    i.age_r
    to inform Stata you have a polytomous variable.
    Otherwise, Stata considers it a continuous one.
    For more on categorical variables (and interactions), just type -help fvvarlist-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you, very much Carlo. 2nd Problem solved! I also had to use the xi prefix to the command for the version I am currently using.

      Comment

      Working...
      X