Announcement

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

  • comparing two linear regression lines

    I am comparing the glomerular filtration rate (continuous) measured by creatinine clearance (gold standard, x) and by two other methods (new methods, y)
    I have a linear regression line x against y1 and another model x agains y2
    I dont really know how to compare model 1 (x and alternative method 1) against model 2 (x and alternative model 2)
    I know we should compare beta (intercept) and slope (r) and bias, but not sure how to do it in stata
    looked for other posts about it but could not find a good answer, hope this is not a duplicate
    thanks for your help
    francois

  • #2
    Francois:
    welcome to this forum.
    The following toy-example heavily draws upon an old reply to a similar issue posted by Maarten Buis (as always helpful) some years ago (see, if interested, https://www.stata.com/statalist/arch...sg00837.html):
    Code:
    use "C:\Program Files\Stata16\ado\base\a\auto.dta"
    . reg price mpg
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(1, 72)        =     20.26
           Model |   139449474         1   139449474   Prob > F        =    0.0000
        Residual |   495615923        72  6883554.48   R-squared       =    0.2196
    -------------+----------------------------------   Adj R-squared   =    0.2087
           Total |   635065396        73  8699525.97   Root MSE        =    2623.7
    
    ------------------------------------------------------------------------------
           price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             mpg |  -238.8943   53.07669    -4.50   0.000    -344.7008   -133.0879
           _cons |   11253.06   1170.813     9.61   0.000     8919.088    13587.03
    ------------------------------------------------------------------------------
    
    . est store first
    
    . reg price trunk
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(1, 72)        =      7.89
           Model |  62747229.9         1  62747229.9   Prob > F        =    0.0064
        Residual |   572318166        72  7948863.42   R-squared       =    0.0988
    -------------+----------------------------------   Adj R-squared   =    0.0863
           Total |   635065396        73  8699525.97   Root MSE        =    2819.4
    
    ------------------------------------------------------------------------------
           price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           trunk |   216.7482   77.14554     2.81   0.006     62.96142     370.535
           _cons |   3183.504   1110.728     2.87   0.005     969.3088    5397.699
    ------------------------------------------------------------------------------
    
    . est store second
    
    . suest first second
    
    Simultaneous results for first, second
    
                                                    Number of obs     =         74
    
    ------------------------------------------------------------------------------
                 |               Robust
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    first_mean   |
             mpg |  -238.8943   57.08197    -4.19   0.000     -350.773   -127.0157
           _cons |   11253.06   1366.933     8.23   0.000     8573.922     13932.2
    -------------+----------------------------------------------------------------
    first_lnvar  |
           _cons |   15.74465   .2176038    72.35   0.000     15.31815    16.17114
    -------------+----------------------------------------------------------------
    second_mean  |
           trunk |   216.7482   57.53296     3.77   0.000     103.9857    329.5108
           _cons |   3183.504   723.6459     4.40   0.000     1765.184    4601.824
    -------------+----------------------------------------------------------------
    second_lnvar |
           _cons |   15.88854   .2315864    68.61   0.000     15.43464    16.34244
    ------------------------------------------------------------------------------
    
    . test [first_mean]mpg=[second_mean]trunk
    
     ( 1)  [first_mean]mpg - [second_mean]trunk = 0
    
               chi2(  1) =   20.60
             Prob > chi2 =    0.0000
    
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      thank you so much for your help
      have a nice week
      francois

      Comment

      Working...
      X