Announcement

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

  • How to find the predicted Y given a specific X value after regression

    I know one method is that first I can write the regression equation by writing down the coefficients. Then I can use
    Code:
    display
    to calculate manually.

    But what's the smart methods? If I have a lot of Xs, above method looks silly.

  • #2
    help predict

    Comment


    • #3
      predict is for all of Xs of all observations in the data. I only want to know, say, what's the Y given X=15. Maybe there is no X=15 in the sample.

      Comment


      • #4
        Look up -margins-. E.g.,

        Code:
        clear *
        sysuse auto
        summarize length
        regress weight length
        margins, at(length = (140 240)) vsquish
        margins, at(length = (140(10)240)) vsquish
        --
        Bruce Weaver
        Email: [email protected]
        Version: Stata/MP 18.5 (Windows)

        Comment

        Working...
        X