Announcement

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

  • Comparison of a variable to a known value when there are several factors, anova / mixed?

    I have some preliminary data where two observers, b1 and b2, have measured 5 separate items within 3 units:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int index byte(unit item) double(b1 b2)
     91 1 1             .51141             .50781
     92 1 2             .52398             .49874
     93 1 3             .52274 .48599000000000003
     94 1 4  .5357799999999999             .51203
     95 1 5             .50126             .52739
     96 2 1 .47135000000000005             .43428
     97 2 2 .49545999999999996             .49432
     98 2 3 .45694999999999997             .51216
     99 2 4 .49063999999999997 .49387000000000003
    100 2 5             .46132 .43951999999999997
    101 3 1              .3817             .39603
    102 3 2 .36210000000000003             .36173
    103 3 3 .45926999999999996             .45946
    104 3 4             .36511             .42478
    105 3 5             .36238             .39148
    end
    All iems are different. The theoretical value is 0.559 and I can test this with a t-test:
    Code:
    Sorted by:
    
    . reshape long b, i(index) j(operator)
    (j = 1 2)
    
    Data                               Wide   ->   Long
    -----------------------------------------------------------------------------
    Number of observations               15   ->   30          
    Number of variables                   5   ->   5           
    j variable (2 values)                     ->   operator
    xij variables:
                                      b1 b2   ->   b
    -----------------------------------------------------------------------------
    
    . ttest b = 0.559
    
    One-sample t test
    ------------------------------------------------------------------------------
    Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
    ---------+--------------------------------------------------------------------
           b |      30     .461368    .0102928     .056376    .4403168    .4824192
    ------------------------------------------------------------------------------
        mean = mean(b)                                                t =  -9.4855
    H0: mean = 0.559                                 Degrees of freedom =       29
    
      Ha: mean < 0.559             Ha: mean != 0.559             Ha: mean > 0.559
     Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000
    Howver this loses any information about the possible effects of operator and unit.

    My question is how can I do this comparison allowing for operator and unit? I have considered using mixed but I cannot work out how to do it, even if it is possible.

    Any advice gratefully received.

    Janet

  • #2
    I'm not sure exactly what question you are trying to answer conceptually here. You have something that is being observed, and you have several sources of observed variation: unit, item, and observer. You could look at the expected values in each unit, or for each item (it isn't clear to me whether items are crossed with or nested within units, or perhaps the other way around), or by observer. Do you wish to compare each of those to 0.559? I don't grasp what single comparison using all the data you would do here, other than the one you have already done that simply overlooks the particular known sources of variation.

    I will also add that unless there is some nesting of units within items (or the other way around), I don't see using a mixed effects model here because the numbers of units, models, and observers are very small. You would not be effectively sampling any unit or model space with these. So if there is no nesting involved, I would just do it as a simple -regress b i.operator i.unit i.item-. But, again, I'm not clear on what you then want to do with those results?

    Comment


    • #3
      Thank you for your reply Clyde, sorry I have not explained myself very well.Yes, all the values should be 0.559 which they are not, and ignoring the effect of operator and unit the t-test shows this. The object was simply to show if the values are 0.559 or not, there are some tolerances.

      My previous attempt was to run a regression, predict the outcome and then test this against the theoretical value of 0.559:
      Code:
      . reg b i.operator i.unit
      
            Source |       SS           df       MS      Number of obs   =        30
      -------------+----------------------------------   F(3, 26)        =     28.14
             Model |  .070469563         3  .023489854   Prob > F        =    0.0000
          Residual |  .021699859        26   .00083461   R-squared       =    0.7646
      -------------+----------------------------------   Adj R-squared   =    0.7374
             Total |  .092169422        29  .003178256   Root MSE        =    .02889
      
      ------------------------------------------------------------------------------
                 b | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
          operator |
                1  |      0.000  (base)
                2  |      0.003      0.011    0.241   0.811       -0.019       0.024
                   |
              unit |
                1  |      0.000  (base)
                2  |     -0.038      0.013   -2.920   0.007       -0.064      -0.011
                3  |     -0.116      0.013   -9.002   0.000       -0.143      -0.090
                   |
             _cons |      0.511      0.011   48.482   0.000        0.490       0.533
      ------------------------------------------------------------------------------
      
      predict pred, xb
      ttest pred = 0.559
      
      . ttest pred = 0.559
      
      One-sample t test
      ------------------------------------------------------------------------------
      Variable |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
      ---------+--------------------------------------------------------------------
          pred |      30     .461368        .009    .0492949     .442961     .479775
      ------------------------------------------------------------------------------
          mean = mean(pred)                                             t = -10.8480
      H0: mean = 0.559                                 Degrees of freedom =       29
      
        Ha: mean < 0.559             Ha: mean != 0.559             Ha: mean > 0.559
       Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000
      I thought that this would allow for the effect of unit and operator but as this gave the same results as the ttest ignoring unit / observer I assumed that I was doing something wrong - or misunderstanding what I was trying to do.
      This is the start of a larger study so the sample size will increase.

      Janet

      Comment


      • #4
        If they are all supposed to be 0.559, and any departure from that is error, and if you don't need to partition the error into sources (operator, unit, observer), then the t-test is all you need.

        Comment


        • #5
          Thank you very much.
          Janet

          Comment

          Working...
          X