Announcement

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

  • A series of problem

    (a) Run the regression with all years
    (c) Test if the coefficients on on-base percentage and slugging are equal. (d) Rerun the regression for each year separately saving the coefficients on OBP and SLG for each year.
    I am little confused about the regress command, is it can only regress one variable at a time? It doesn't work when I tried to regress (all variable names isolated with space) but it doesn't work.

  • #2
    Please read the FAQs carefully; especially #7, #12, and perhaps, first of all, #4 here.

    Best
    Daniel

    Comment


    • #3
      Originally posted by daniel klein View Post
      Please read the FAQs carefully; especially #7, #12, and perhaps, first of all, #4 here.

      Best
      Daniel
      This is an assignment but it is not required to be completed by one's own.

      Comment


      • #4
        Originally posted by Lielz Wu View Post

        This is an assignment but it is not required to be completed by one's own.
        Thank you for your information.

        Comment


        • #5
          Originally posted by Lielz Wu View Post
          This is an assignment but it is not required to be completed by one's own.
          I recommend that you read the help file and user's manual entry for each example of syntax illustrated below, and prepare yourself to describe to your instructor how each is used in the assignment. (The last is not exactly in accordance with your instructor's assignment, but is how I would approach the objective.)
          Code:
          version 15.1
          
          clear *
          
          set seed `=strreverse("1488467")'
          
          quietly set obs 3
          generate byte year = _n
          
          quietly expand 4
          generate double whatever = rnormal()
          
          generate double obp = runiform()
          generate double slg = runiform()
          
          *
          * Begin here
          *
          // "Run the regression with all years"
          regress whatever c.(obp slg) i.year
          
          // What happened 2B?
          
          // "Test if the coefficients on on-base percentage and slugging are equal"
          test _b[obp] = _b[slg]
          
          // "Rerun the regression for each year separately saving the coefficients on OBP and SLG for each year"
          regress whatever c.(obp slg)##i.year
          margins , dydx(obp slg) over(year) post
          
          exit
          It will help to familiarize yourself with each syntax element on other datasets and with variations on the problem on your own.
          Code:
          help regress
          help factor variables
          help test
          help margins

          Comment

          Working...
          X