Announcement

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

  • Linear Combination of Coefficient

    Dear Statalists,

    I'm trying to check if the beta coefficients retrieved from two separate regressions are significantly different. I'm using the `lincom' command and it works perfectly. But I couldn't save the degree of freedom (df). The manual shows that the df is stored in r(df), but I couldn't save it. Following is my code. I want to save it in Mata as I need to do the further computation in Mata later.

    Code:
    lincom [R5]SN - [R1]SN 
    mata: a = st_numscalar("r(df)")
    I would be very grateful if anyone could help me on this.

    Thanks, Janys

  • #2
    You might try putting r(df) into a local and then using that local in your mata statement. While this is probably inefficient, it sometimes works for me.

    Comment


    • #3
      Hi Phil Bromiley, many thanks for your solution!

      Best, Janys

      Comment

      Working...
      X