09W-Project-R-Example

# 09W-Project-R-Example - p 4 Performance Evaluation In...

This preview shows page 1. Sign up to view the full content.

STAT 454/854 Winter 2009 A Sample R Program for Simulation Studies 1. Objectives: To evaluate ﬁnite sample performances of ¯ y and ˆ p and the related normal theory conﬁdence intervals on the population mean μ y and the population proportion p under SRSWOR. 2. Simulation Settings: Need to set the population size, N , the desired sample size, n , the number of repeated simulation runs, and generate a ﬁnite population from certain distributions. Once the population is generated, it remains ﬁxed and the true values of the population parameters such as μ y or p are determined (you can do this in the simulation but you cannot do this in practice!). 3. Simulation Procedures: For each simulation run, take a sample, s , using SR- SWOR, obtain the sample data { y i ,i s } ; calculate the point estimator ¯ y as well as the lower and upper bounds of the 95% conﬁdence intervals (¯ y - 1 . 96 q 1 - n/Ns/ n, ¯ y + 1 . 96 q 1 - n/Ns/ n ) for μ y , where s 2 is sample variance; do this similarly for p . Repeat the process a large number of times. Similarly, do this for the proportion,
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: p . 4. Performance Evaluation: In general, suppose θ is the population parameter, ˆ θ [ k ] is point estimator and ( ˆ θ [ k ] 1 , ˆ θ [ k ] 2 ) is conﬁdence interval computed from the k th simulated sample, k = 1 , 2 , ··· ,K . The simulated Relative Bias ( RB ) of ˆ θ is computed as RB = 1 K K X k =1 ˆ θ [ k ]-θ θ , the simulated Mean Squared Error ( MSE ) is computed as MSE = 1 K K X k =1 ( ˆ θ [ k ]-θ ) 2 . The simulated average length ( AL ) of the conﬁdence interval is computed as AL = 1 K K X k =1 ( ˆ θ [ k ] 2-ˆ θ [ k ] 1 ) , and the lower tail error rate ( L ), upper tail error rate ( U ) and coverage probability ( CP ) are computed respectively as L = 1 K K X k =1 I ( θ ≤ ˆ θ [ k ] 1 ) , U = 1 K K X k =1 I ( θ ≥ ˆ θ [ k ] 2 ) and CP = 1 K K X k =1 I ( ˆ θ [ k ] 1 < θ < ˆ θ [ k ] 2 ) , where I ( · ) is the indicator function, i.e., I ( A ) = 1 if A is true and I ( A ) = 0 otherwise....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online