Page 77 - Applied Statistics with R
P. 77

5.3. SIMULATION                                                    77


                      We’ll look at two very simple examples here, however simulation will be a topic
                      we revisit several times throughout the course.


                      5.3.1   Paired Differences


                      Consider the model:


                                                                    2
                                               ,    , … ,    1    ∼   (   ,    )
                                                                 1
                                             11
                                                  12
                                                                    2
                                               ,    , … ,    2    ∼   (   ,    )
                                             21
                                                  22
                                                                 2
                                                 2
                      Assume that    = 6,    = 5,    = 4 and    = 25.
                                          2
                                   1
                      Let
                                                        1    
                                                    ̄
                                                     =   ∑    1  
                                                    1
                                                         
                                                           =1
                                                        1    
                                                    ̄
                                                     =   ∑    2  
                                                    2
                                                         
                                                           =1
                                                         ̄
                                                              ̄
                                                      =    −    .
                                                              2
                                                         1
                      Suppose we would like to calculate   (0 <    < 2). First we will need to obtain
                      the distribution of   .
                      Recall,
                                                                2
                                                  ̄
                                                    ∼    (   ,      )
                                                  1
                                                           1
                      and
                                                               2
                                                  ̄
                                                   ∼    (   ,      ) .
                                                  2
                                                          2
                      Then,
                                                          2     2           4    4
                                   ̄
                                        ̄
                                =    −    ∼    (   −    ,  +  ) =    (6 − 5,  +   ) .
                                   1
                                                1
                                        2
                                                     2
                                                                           25   25
                      So,
                                                           2
                                                 ∼   (   = 1,    = 0.32).
   72   73   74   75   76   77   78   79   80   81   82