Announcement

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

  • Comparing three continuous measures over time. What is the command

    I apologize for my ignorance, but I have not done any statistical analysis for several years and am very rusty in my use of Stata 12. I have a dataset containing a unique id for each record and three continuous measures for each id. The measures were taken sequentially at different times. There are no missing data. Thus the variables are: id, base, t1, t2. What is the command in Stata 12 to compare the values of base vs t1 and t1 vs t2 and base vs t2.
    Many thanks for answering this

  • #2
    Don:
    if you want to compare:
    1) base vs t1;
    2) base vs t2;
    3) t1 vs t2,
    I would perform three -ttest- with alfa=.05/3.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Cario. Thanks for the advice. I thought about it a bit more and figured out what to do.

      Reshape long, then oneway and options does the job.

      Comment


      • #4
        Don:
        another approach that springs to my mind is:
        Code:
        . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
        (1978 automobile data)
        
        . mvreg headroom trunk turn = i.foreign
        
        Equation             Obs   Parms        RMSE    "R-sq"          F      P>F
        --------------------------------------------------------------------------
        headroom              74       2    .8142408    0.0863   6.804771   0.0110
        trunk                 74       2     4.01917    0.1292   10.68196   0.0017
        turn                  74       2    3.436215    0.3983   47.65754   0.0000
        
        ------------------------------------------------------------------------------
                     | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
        headroom     |
             foreign |
            Foreign  |  -.5402098   .2070884    -2.61   0.011    -.9530329   -.1273867
               _cons |   3.153846   .1129149    27.93   0.000     2.928754    3.378938
        -------------+----------------------------------------------------------------
        trunk        |
             foreign |
            Foreign  |  -3.340909   1.022208    -3.27   0.002    -5.378643   -1.303175
               _cons |      14.75   .5573585    26.46   0.000     13.63893    15.86107
        -------------+----------------------------------------------------------------
        turn         |
             foreign |
            Foreign  |  -6.033217    .873943    -6.90   0.000     -7.77539   -4.291043
               _cons |   41.44231   .4765172    86.97   0.000     40.49239    42.39223
        ------------------------------------------------------------------------------
        
        . test [headroom]
        
         ( 1)  [headroom]0b.foreign = 0
         ( 2)  [headroom]1.foreign = 0
               Constraint 1 dropped
        
               F(  1,    72) =    6.80
                    Prob > F =    0.0110
        
        .
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X