Professional Documents
Culture Documents
Chapter 8 no 3,9,15
3. Jawab:
d. The sample mean
e. The variance of the sample mean
f. The largest value in the sample
9. Diketahui:
Simple random sample
: 1500
:55%
: 45%
Margin victory
: 10%
Jawab:
a.Menghitung standart error:
p+ q( pq)2
SE=
n
2
0.55+ 0.45(0.550.45)
SE=
1500
SE=
SE=
1(0.1)2
1500
2
1(0.1)
1500
SE=0.02569
SE=0.026
b. Margin interval untuk 95% confidence:
for (i in 1:10000) {
sample1 <- sample(PossibleOutcome, 1500, replace=TRUE, prob=c(.55,.45))
Setuju <- length(which(sample1==1)); Setuju
Tolak <- length(which(sample1==0)); Tolak
Differences <- c(Differences, (Setuju-Tolak))
}
Differences
Table1 <- table(Differences)
Table1
barplot(Table1)
mean.sample <- mean(Differences)/1500
mean.sample
sd(Differences)*(1500/(1500-1))/1500
standard.error
alpha = 0.05
CI <- c(mean.sample - qnorm(alpha/2,0,1,lower.tail=F)*standard.error,
mean.sample + qnorm(alpha/2,0,1,lower.tail=F)*standard.errorEstimate)
CI
15.
x Bin ( 100, p )
H 0 : P=0.5
H A : P 0.5
Daerah penolakan: {Jika |x-50| 10 maka
H0
= P{ H 0 ditolak | H 0
diterima}
x100 p
N (0,1)
100 pq
ditolak}
x100 p 40100 p
<
100 pq
P[X<40]=p 100 pq
40100 p
=P[Z< 100 pq
40100 p
100 pq
P[X>60]=1-
60100 p
100 pq
40100 p
P=0.5
100 pq
+ 1-
60100 p
P=0.5
100 pq
= [ 2 ] +1[2]
= 2-2 (2)
=2-2(0.9772)
=0.0456
b.Power=1-
H 0 ditolak | H A
=P{
benar}
40100 p
P=P
100 pq
9. Diketahui:
+ 1-
60100 p
P=P
100 pq
H 0 : =0
H A : =1.5
=0.10
25
f 0 ( x )=
2
25
f 0 ( x )=
25
i=1
exp {
25
1
2
x 0 )
2 ( i
2 i=1
]}
1
exp { 2
2
2
( x i A )
2n
a ) + n A2n02
2( 0
}
2
{
(1.5 ) +25. ( 1.5 )20 }
=
100
X0
P ]=
Untuk
X 0 X 0 0
>
n
n
P [ Z>Z( =
X 00
Z( =
n
X0
2
Test menolak
H0
jika Z> Z(
= 0.10
X0
=1.282
2
X 0 =2.564
[ >2.564]=0.10
Penolakan:S ={X:
2.564 }
Power test:
=P {
H 0 ditolak | H 1 benar}
=P [
2.564|H 1 ]
untuk
=0.10
=P
1.5 2.5641.5
>
10
10
25
25
=P(Z>0.532)
= 1-P(Z
0.532)
=1-0.7019
Power=0.2981
X0
0.01
P ]=
0 X 00
>
10
10
25 25
=0.01
P=[Z>Z( =
=0.01 Z( =2.330
Z(
X0
2
X 0 =4.66
4.652 }
Penolakan:S ={X:
=P
H 0 ditolak | H 1 benar}
1.5 4.661.5
>
10
10
25
25
dan P[ >4.66|
H 0 =0.01
=P(Z>1.58)
= 1-P(Z
1.58)
=1-0.9429
Power=0.0571
23. Diketahui:Confidence Interval untuk 99% adalah(-2;3)
H 0 : =3
H A : 3
Kita perlu menguji apakah hipotesis akan ditolak pada significance level 0.01 atau
tidak
dibawah
H0
akan ditolak.
=3
H0
H 0 . Dibawah
H 0 , expected
1
(1668+ 1407+1370+1309+1341+1338+1406+1446+1332+1363+1410+1526 )
12
=1409.67
Bulan
Januari
Februari
Maret
April
May
Juni
Observed (
1668
1407
1371
1309
1341
1338
Oi
Expected(
Ei
4109.67
4109.67
4109.67
4109.67
4109.67
4109.67
(O iEi )2
Ei
47.3418
0.005
1.1162
7.1888
3.3448
3.6435
Juli
Agustus
September
Oktober
November
Desember
1406
1446
1332
1363
1410
1526
4109.67
4109.67
4109.67
4109.67
4109.67
4109.67
0.0095
0.9365
4.2791
1.5449
0.00008
9.6005
(O iE i)2
x =
=79.0107
Ei
2
= 12-1
= 11
Nilai dari P kurang lebih sama dengan 0
Sehingga dapat kita simpulkan bahwa kecelakaan tidak terdistribusi secara uniform.
Jumlah kecelakaan tersebut rupanya bersifat musiman dengan angka paling tinggi
pada November-Januari dan paling sedikit pada Maret-Juni. Ada peningkatan jumlah
kecelakaan pada Juli-Agustus.
a. Histogram
Program R:
par(mfrow = c(1,2))
hist(Iridium, breaks=10); hist(Rhodium,breaks=10)
b.stem and leaf plot
The decimal point is 1 digit(s) to the right of the |
13 | 7
14 |
14 | 5
15 | 2
15 | 999
16 | 00000000000000001113
16 |
17 | 4
126 | 4
127 |
128 |
129 |
130 |
131 | 111112234569
132 | 123456677899
133 | 000333455558
134 | 12
135 | 7
Program R:
stem(Iridium); stem(Rhodium)
c. Boxplot
Program R:
par(mfrow = c(1,2))
boxplot(Iridium); boxplot(Rhodium)
d. Plot the observations in the order of the experiment
Program R:
par(mfrow = c(1,2))
plot(Iridium, pch='.'); lines(Iridium, pch='.')
plot(Rhodium, pch='.'); lines(Rhodium, pch='.')
e.Does that statistical model of independent and identically distributed
measurement error seem reasonable?
: 158.8148
Mean Rhodium
: 132.42
Program R:
MeanI <- mean(Iridium); MeanI
MeanR <- mean(Rhodium); MeanR
10% dan 20% trimmed mean
10% trimmed mean Iridium
: 159.5478
: 132.4781
Program R:
SortI <- sort(Iridium); SortR <- sort(Rhodium)
trim10I <- mean(SortI, trim=.10); trim10R <- mean(SortR, trim=.10)
trim10 <- c(trim10I, trim10R); trim10
20% trimmed mean Iridium
: 159.8412
: 132.5292
Program R:
SortI <- sort(Iridium); SortR <- sort(Rhodium)
trim20I <- mean(SortI, trim=.20); trim20R <- mean(SortR, trim=.20)
trim20 <- c(trim20I, trim20R); trim20
Median
Median Iridium
Median Rhodium
: 159.8
: 132.65
Program R:
median(SortI); median(SortR)
: 6.108204
: 1.419718
Program R:
Standard.errorI <- var(Iridium)^.5 * ((length(Iridium) - 1)/length(Iridium))^.5
Standard.errorI
Standard.errorR <- var(Rhodium)^.5 * ((length(Rhodium) - 1)/length(Rhodium))^.5
Standard.errorR
90% confidence interval
CI Iridium
: (146.8430; 170.7867)
10% Trimmed
Mean
: 159.3752
Standart Error
: 0.846591
20% Trimmed
Mean
: 159.7955
Standart Error
: 0.3067801
Program R:
#Bootstrapping Iridium
boot <- numeric(9999)
for (i in 1:length(boot)) boot[i] <- mean(sample(SortI, replace=TRUE), trim=.10)
mean(boot)
hist(boot)
sd(boot) # Standard error for 10% trimmed mean
10% Trimmed
Mean
: 132.4873
Standart Error
: 0.1817512
20% Trimmed
Mean
: 132.526
Standart Error
: 0.2128587
Program R:
#Bootstrapping Rhodium
boot <- numeric(9999)
for (i in 1:length(boot)) boot[i] <- mean(sample(SortR, replace=TRUE), trim=.10)
mean(boot)
hist(boot)
sd(boot) # Standard error for 10% trimmed mean