Announcement

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

  • STATA mle function for Mcfadden MNL model

    I am estimating the covariates for an aggregate market data set. I am aware of the pre-existing STATA packages out there like mlogit, clogit etc.., however they do not fit my case as I am working with aggregate and not individual level data. I have tried writing out a MLE function but it does not seem to be working

    Code:
    program define mcfadden
              args lnf Xb
              quietly replace `lnf' = `Xb' - ln(1+sum(exp(`Xb'))) 
         end

    My dependant variable is market shares and my independant are product characteristics like price and product attributes. So I am estimating the likelihood as given below



    I need help on knowing what's wrong with my code.

  • #2
    Cross-posted at https://stackoverflow.com/questions/...dden-mnl-model

    sum() is for cumulative or running sums across observations, which is not what you seek here. Other people will be more familiar with this model and may be able to advise further. You may need to define your terms however.

    Comment


    • #3
      See ssc desc fmlogit
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment

      Working...
      X