Announcement

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

  • [Help] Marginal effect on Stata

    Hi. My question is from Stata (15.1), but also requires some statistical knowledge, which is why I am calling on you.
    I'm doing a homework, and I have three different models.
    1: ln (y) = b0 + b1 * X + error
    2: y = b0 + b1 * ln (x) + error
    3: ln (y) = b0 + b1 * ln (x) + error

    I have a database with the variables x and y. I have to tell among the 3 models, which assumes a decreasing marginal relationship between Y and X.
    How can I do with Stata?

    When I use:
    Code:
    * 1: log-lin
    gen ln_y = ln (x)
    reg ln_y x
    mfx
    * 2: lin-log
    gen ln_x = ln (x)
    reg y ln_x
    mfx
    * 3: log
    reg ln_y ln_x
    mfx
    At the mfx command, I always get postives results >0 (but I should have a result <0 in order to have a decreasing marginal relationship, isnt it ?).

    Even when I derive the functions, I get positive results. Do you have an idea that can prevent from failing this assignement ?




    Click image for larger version

Name:	Graphique_Q7-(2).png
Views:	1
Size:	14.5 KB
ID:	1490068
    Click image for larger version

Name:	Graphique_Q7-(3).png
Views:	1
Size:	19.9 KB
ID:	1490069
    Click image for larger version

Name:	Graphique_Q7-(4).png
Views:	1
Size:	26.4 KB
ID:	1490070

  • #2
    As the FAQ notes, we are not here to help with homework. It is completely inappropriate to present our work as your's in a course which is what you obviously intend. It also means you won't learn what the assignment was intended to teach. Please don't try this again.

    Comment


    • #3
      I won't do your homework but I will suggest some readings that might help. For margins, see the 5 handouts (or at least the first one) that are at

      https://www3.nd.edu/~rwilliam/xsoc73994/index.html

      For a brief overview of modeling nonlinear relations, see

      https://www3.nd.edu/~rwilliam/stats2/l61.pdf

      As Phil says, it is not a good idea to ask people to do your homework, but asking for things to read (or maybe help with some substep where you've done a lot of work already but are now stuck) can be ok.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://academicweb.nd.edu/~rwilliam/

      Comment


      • #4
        I don't mean to pile on here, but the command mfx has long been superseded by the margins command. In any case, I don't think margins will get you what you want for that question, either, because you transformed the original variables. Think about what logging a variable does to the variable. For example, try

        Code:
        scatter y ln_y
        Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

        When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

        Comment

        Working...
        X