Question: Run a simulation study to see how randomization may average out confounding effects in experimental design. Consider a completely randomized design (CRD) with one factor

Run a simulation study to see how randomization may average out confounding effects in experimental design. Consider a completely randomized design (CRD) with one factor with t=2 treatment levels based on n=20 experimental units. Assume the underlying true model for the response is given by yi=+xi+zi+i, where i are random errors from N(0,2), the factor xi=1 if the unit receives treatment level 1 and xi=0 otherwise, and zi 's are from an unobserved confounding variable. Here, let's assume z1,,zn are i.i.d. from U(0,1). In a CRD, the value xi is decided by the random treatment allocation, and the confounding variable zi is not measured. Assume that each treatment level has the same number of experimental units. Then the difference between the two treatment means, i.e. , is estimated by the difference between the sample mean at the two treatment levels. (a) Complete the following R code to simulating 1000 experimental runs. Then draw a histogram of the simulated mean differences to show it is umbiased. (b) Next, repeat the above simulation except that assuming no confounding variables exist. That is, the true model is yi=+xi+i. (b) Next, repeat the above simulation except that assuming no confounding variables exist. That is, the true model is yi=+xi+i. 2 And show that the estimate under this situation is more accurate. So, even though randomization can average out the confounding effect, it is still better to rule out confounding effects
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
