You are on page 1of 16

AndhikaSuryaputra(201137357197524)

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

Planned to vote for a particular proposition

:55%

Planned tovote agains it

: 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:

( E 1.96 X SE Margin Error )


(0.1 1.96 X 0.026)
( 0.1 0.0510 )
( 0.1+0.0510 ; 0.10.0510 )
( 0.05 ; 0.15 )
Program R:
Standart Error:
Differences <- c()
PossibleOutcome <- c("1","0") # 1 = Agree, 0 = Against

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.

Chapter 9 nomor 3,9,23,37,64


3. Diketahui:

x Bin ( 100, p )
H 0 : P=0.5
H A : P 0.5
Daerah penolakan: {Jika |x-50| 10 maka

H0

= {X: |X-50| 10}


={X 40 atau X 60}
Jawab:

= P{ H 0 ditolak | H 0

diterima}

= P{X 40 atau X 60| P=0.5 }

= P{X 40|P=0.5} +{X 60| P=0.5 }


E(X) = 100p
V[X] = 100pq
Z=

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

= P{X 40|P=0.5} +{X 60| P=0.5 }

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}

=P{ X 40 atau X 60| P=P }

40100 p
P=P
100 pq

9. Diketahui:

+ 1-

60100 p
P=P
100 pq

X 1 , . , X 25 adalah sampe dari distribusi normal dan memiliki variasi


dari100

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

0=0 a=1.5 n=25


25
exp

{
(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

Z > 1.282 untuk

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:

Power of the test:


=P {

=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

Menurut teori jika nilai


menerima

H0

terletak di confidence interval, kita akan

H 0 , jika terjadi sebaliknya maka H 0

akan ditolak.

Jika membandingkan acceptance region dari confidence interval,kita dapat melihat

=3

tidak terletak pada confidence interval, sehingga dapat disimpulkan

bahwa hipotesis berada di luar interval.


Sehingga kita menolak

H0

berdasarkan confidence intervalnya.

37. Pertama-tama kita perlu menentukan

H 0 . Dibawah

H 0 , expected

frequencies dari jumlah kematian di dalam 12 bulan akan menjadi:

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

Jumlah dari derajat kebebasan

= 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.

Chapter 10 nomor 26 a-g dan i


Data:
Iridium <- c(136.6, 145.2, 151.5, 162.7, 159.1, 159.8, 160.8, 173.9,
160.1, 160.4, 161.1, 160.6, 160.2, 159.5, 160.3, 159.2,
159.3, 159.6, 160.0, 160.2, 160.1, 160.0, 159.7, 159.5,
159.5, 159.6, 159.5)
Iridium
Rhodium <- c(126.4, 135.7, 132.9, 131.5, 131.1, 131.1, 131.9, 132.7,
133.3, 132.5, 133.0, 133.0, 132.4, 131.6, 132.6, 132.2,
131.3, 131.2, 132.1, 131.1, 131.4, 131.2, 131.1, 131.1,
134.2, 133.8, 133.3, 133.5, 133.4, 133.5, 133.0, 132.8,
132.6, 133.3, 133.5, 133.5, 132.3, 132.7, 132.9, 134.1)
Rhodium

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

The decimal point is at the |

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?

f.Mean, 10% dan 20%trimmed means,dan median, lalu bandingkan


Mean Iridium

: 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

10% trimmed mean Rhodium

: 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

20% trimmed mean Rhodium

: 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)

g.Standart error dari sample dan corresponding approximate 90%


confidence interval
Standart Error Iridium

: 6.108204

Standart Error Rhodium

: 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)

CI Rhodium : (146.8430; 170.7867)


Program R:
alpha <- 0.1
#CI Iridium
CII <- c(MeanI - qnorm(alpha/2, 0, 1, lower.tail=F)*Standard.errorI,

MeanI + qnorm(alpha/2, 0, 1, lower.tail=F)*Standard.errorI)


CII
#CI Rhodium
CIR <- c(MeanR - qnorm(alpha/2, 0, 1, lower.tail=F)*Standard.errorR,
MeanR + qnorm(alpha/2, 0, 1, lower.tail=F)*Standard.errorR)
CII

i.Gunakan bootstrap untuk mengira-ngirasampling distribution dari median dan


standart error. Bandingkan hasil corresponding untuk mean diatas.
Bootstrap Iridium

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

boot <- numeric(9999)


for (i in 1:length(boot)) boot[i] <- mean(sample(SortI, replace=TRUE), trim=.20)
mean(boot)
hist(boot)
sd(boot) # Standard error for 20% trimmed mean
Bootstrap Rhodium

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

boot <- numeric(9999)


for (i in 1:length(boot)) boot[i] <- mean(sample(SortR, replace=TRUE), trim=.20)
mean(boot)
hist(boot)
sd(boot) # Standard error for 20% trimmed mean

You might also like