Announcement

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

  • Saving WTP estimates to conduct Poe Test

    Dear all

    I have run a clogit model and have estimated wtp via wtp, krisnky command. I now want to save the wtp estimates so I can perform a Poe test to compare with wtp estimates for another clogit model. However I do not see any option for saving these wtp estimates. The saving function is only available with the wtpcikr function which I do not think can be used with a clogit model.

    Can anyone help me with this please
    ​​​​

  • #2
    All results of estimation commands are either stored in e() or r(). To view these, type

    Code:
    return list
    *or
    ereturn list
    So you can initially store these in a matrix, and once you have all the estimates, create variables from the elements of these matrices.

    Code:
    mat wtp1= r(wtp)
    mat list r(wtp)
    See -help svmat- for the latter.

    Comment


    • #3
      Dear Hannan,

      I have the same issue you experienced and I do not know how to solve. I do not know how to save these wtp estimates. How have you solved it?

      Thanks

      Daniele

      Comment


      • #4
        The wtp command (SSC) does not have an option for saving the generated draws, but you can alternatively implement the Krinsky-Robb (parametric bootstrap) approach using drawnorm. See the example below:

        Code:
        use http://fmwww.bc.edu/repec/bocode/t/traindata.dta
        
        clogit y price contract local wknown seasonal, group(gid)
        matrix b = e(b)
        matrix V = e(V)
        drawnorm price contract local wknown seasonal, mean(b) cov(V) n(10000) seed(12345)
        gen wtp_seasonal = -seasonal/price
        * The lower and upper limits of the CI are given in the centile column
        centile wtp_seasonal, c(2.5 97.5)
        
        * Results are similar, but not identical, to those from wtp as the draws form the multivariate normal distribution are generated differently
        wtp price seasonal, krinsky reps(10000)

        Comment


        • #5
          Thanks Arne. I used clogit with my choice data and all works fine, but when I use mixlogit and run the same commands:
          matrix b = e(b) matrix V = e(V) drawnorm price contract local wknown seasonal, mean(b) cov(V) n(10000) seed(12345) gen wtp_seasonal = -seasonal/price it does not work, reporting (note in my choice data have 4 attributes):
          4 variables specified but specified means(b) is 1 x 8
          expected a 4-vector

          Any suggestions to solve this?

          Thanks

          Daniele

          Comment


          • #6
            The names following drawnorm should correspond to the coefficients in the e(b) matrix. In the case of mixlogit (SSC) you can do something like:

            Code:
            use http://fmwww.bc.edu/repec/bocode/t/traindata.dta
            mixlogit y price, group(gid) id(pid) rand(contract local wknown seasonal)
            matrix b = e(b)
            matrix V = e(V)
            drawnorm price mean_contract mean_local mean_wknown mean_seasonal ///
            sd_contract sd_local sd_wknown sd_seasonal, mean(b) cov(V) n(10000) seed(12345)
            gen wtp_seasonal = -mean_seasonal/price
            centile wtp_seasonal, c(2.5 97.5)

            Comment

            Working...
            X