script.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# verify that the alternative estimator is unbiased
n
<-
100
w
<-
c
(
rep
((
1
+
0.5
)
/
n
,
n
/
2
)
,
rep
((
1
-
0.5
)
/
n
,
n
/
2
))
# define the alternative estimator mu_tilde
# compute repeatedly estimates for both estimators and
store the results in est_bar and est_tilde
set.seed
(
123
)
# compute the sample variances for est_bar and
est_tilde
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
R Console
1
>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX