Announcement

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

  • Mean value

    I am trying to work out the mean WTP value from my probit model,

    I am trying to get a non negative mean value: using the below method:

    Mean WTP=ln(1+exp B0 )/B1
    where B0 is the intercept and B1 BID COEFFICENT


    Output table:

    answer1_cntl | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    --------------+----------------------------------------------------------------
    bid1_cntl_wtp | -,1609968 ,0435804 -3,69 0,000 -,2464128 -,0755807
    _cons | -,1494844 ,1110473 -1,35 0,178 -,3671331 ,0681642

    I think it should look like WTP = ln(1+exp -0.149 / -0.169)

    However when I attempt to recreate this in stata,

    gen lnt = ln(1+exp[_b[_cons]] / _b[bid1_cntl_wtp])
    or
    nlcom (WTP_cntl:- ln(1+exp_b[_cons]/_b[bid1_123_wtp]), noheader


    I am getting an error message.



    Last edited by Eileen Mitchell; 17 Jan 2018, 03:27.

  • #2
    Eilleen:
    unfortunately, we cannot see the error message that Stata gives you back.
    For the future, please use CODE delimiters to post what you typed and what Stata gave you back (as per FAQ). Thanks.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Hi Carlo, thanks for responding.

      Stata is showing : parentheses unbalanced r(132) when I run nlcom (WTP_cntl:- ln(1+exp_b[_cons]/_b[bid1_123_wtp]), noheader

      and r(111) exp not found when I attempt gen lnt = ln(1+exp[_b[_cons]] / _b[bid1_cntl_wtp])

      I suspect I might be doing something incorrect with regards to the (1+exp) part of the equation.

      Comment


      • #4
        Eileen:
        when this error creeps up, I usually break the code in multiple parts and check where the culprit lurks.
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. With precisely what you've done and some data, folks will have a chance to replicate your problem and potentially solve it.

          By the way, you're a new user so let me suggest that you think about using the standard routines (i.e., probit) and the margins command rather than doing a probit with nlcom.

          I don't know if this is the problem, but you have exp_b[_cons] in the nlcom statement and exp[_b[_cons]] in the gen statement. I also suspect exp in the gen would normally go with a () rather than a [] bracket.

          Comment

          Working...
          X