You are on page 1of 19

TUGAS KELOMPOK

ANALISIS DATA KATEGORI


Exercise : Chapter I – Introduction to Categorical Data Analysis
Tugas ini disusun untuk memenuhi tugas dari mata kuliah Analisis Data Kategori

Dosen Pengampu :
Anna Chadidjah, Dra., M.T.

Disusun Oleh :
Anis Khoirunnisa (140610160001)
Khodijah (140610160007)
Altriani Efendi (140610160039)
Eva Noer Cholis R (140610160041)
Alika Mlattipurnami (140610160093)

Kelas A

PROGRAM STUDI STATISTIKA


FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM
UNIVERSITAS PADJADJARAN
JATINANGOR
2019
1. In the following examples, identify the response variable and the explanatory variables.
a. Attitude toward gun control (favor, oppose), Gender (female, male), Mother’s
education (high school, college).
Answer :
Variabel Respon Variabel Explanatory
Attitude toward gun control (favor, Gender (female, male),
oppose) Mother’s education (high school, college)
b. Heart disease (yes, no), Blood pressure, Cholesterol level.
Answer :
Variabel Respon Variabel Explanatory
Blood pressure,
Heart disease (yes, no)
Cholesterol level.
c. Race (white, nonwhite), Religion (Catholic, Jewish, Protestant), Vote for president
(Democrat, Republican, Other), Annual income.
Answer :
Variabel Respon Variabel Explanatory
Annual income,
Vote for president (Democrat, Republican,
Race (white, nonwhite),
Other)
Religion (Catholic, Jewish, Protestant
d. Marital status (married, single, divorced, widowed), Quality of life (excellent, good,
fair, poor).
Answer :
Variabel Respon Variabel Explanatory
Marital status (married, single, divorced, Quality of life (excellent, good, fair,
widowed) poor).

2. Which scale of measurement is most appropriate for the following variables–nominal, or


ordinal?
a. Political party affiliation (Democrat, Republican, unaffiliated)
Answer : Nominal, karena klasifikasinya tidak menunjukkan rank atau peringkat.
b. Highest degree obtained (none, high school, bachelor’s, master’s, doctorate)
Answer : Ordinal, karena klasifikasinya menunjukkan rank atau peringkat.
c. Patient condition (good, fair, serious, critical)
Answer : Ordinal, karena klasifikasinya menunjukkan rank atau peringkat.
d. Hospital location (London, Boston, Madison, Rochester, Toronto)
Answer : Nominal, karena klasifikasinya tidak menunjukkan rank atau peringkat.
e. Favorite beverage (beer, juice, milk, soft drink, wine, other)
Answer : Nominal, karena klasifikasinya tidak menunjukkan rank atau peringkat.
f. How often feel depressed (never, occasionally, often, always)
Answer : Ordinal, karena klasifikasinya menunjukkan rank atau peringkat.

3. Each of 100 multiple-choice questions on an exam has four possible answers but one
correct response. For each question, a student randomly selects one response as the
answer.
a. Specify the distribution of the student’s number of correct answers on the exam.
Answer :
Distribusi yang cocok berdasarkan persoalan di atas adalah Distribusi Binomial,
karena peristiwa untuk memilih jawaban memiliki dua kategori yaitu correct or
uncorrect dari beberapa soal dengan n = 100 pertanyaan pilihan ganda dan p (peluang
menjawab benar) = ¼ = 0,25.
b. Based on the mean and standard deviation of that distribution, would it be surprising
if the student made at least 50 correct responses? Explain your reasoning.
Answer :
Mean= n x p = 100 x 0,25 = 25 and
standard deviation = √𝑛𝑝(1 − 𝑝) = √100(0.25)(1 − 0.25) = 4,33
Untuk mengetahui apakah mungkin terdapat siswa yang menjawab 50 soal dengan
benar maka perlu dihitung standar deviasi dari 50 soal yang benar :
𝑋−𝜇 50−25
z= = = 5.8
𝜎 4.33

Dari hasil perhitungan tersebut dapat disimpulkan bahwa akan mengejutkan apabila
terdapat siswa yang menjawab 50 soal dengan benar karena rata-rata jawaban benar
hanya sebanyak 25 dari 100 soal serta dilihat dari standar deviasi untuk 50 jawaban
benar lebih besar daripada standar deviasi untuk rata-rata 25 jawaban benar.

4. A coin is flipped twice. Let Y = number of heads obtained, when the probability of a head
for a flip equals π.
a. Assuming π = 0.50, specify the probabilities for the possible values for Y and find the
distribution’s mean and standard deviation.
Answer :
Y menyatakan kejadian munculnya gambar (head), dimana Y berdistribusi Binomial
Y~B(n,π)
n (frekuensi kejadian) = 2
π (peluang muncul gambar) = 0.50
𝑛
𝑃(𝑌 = 𝑦) = (𝑦) 𝜋 𝑦 (1 − 𝜋)𝑛−𝑦

2
𝑃(𝑌 = 0) = ( ) 0.500 (1 − 0.50)2−0 = 0.25
0
2
𝑃(𝑌 = 1) = ( ) 0.501 (1 − 0.50)2−1 = 0.50
1
2
𝑃(𝑌 = 2) = ( ) 0.502 (1 − 0.50)2−2 = 0.25
2

Rata-rata dari Y adalah nπ = 2 x 0.50 = 1, dan

Standar deviasi √𝑛π (1 − π) = √2(0.50) (1 − 0.50) = 0.707

b. Find the binomial probabilities for Y when π equals (i) 0.60 , (ii) 0.40
(i) When π =0.60
Answer :
𝑛
π =0.60 ; n = 2 ; 𝑃(𝑌 = 𝑦) = (𝑦) 𝜋 𝑦 (1 − 𝜋)𝑛−𝑦

2
Y={AA}  𝑃(𝑌 = 0) = ( ) 0.600 (1 − 0.60)2−0 = 0.16
0
2
Y={AG,GA} 𝑃(𝑌 = 1) = ( ) 0.601 (1 − 0.60)2−1 = 0.48
1
2
Y={GG}  𝑃(𝑌 = 2) = ( ) 0.602 (1 − 0.60)2−2 = 0.36
2
(ii) When π =0.40
Answer :
𝑛
π =0.40 ; n = 2 ; 𝑃(𝑌 = 𝑦) = (𝑦) 𝜋 𝑦 (1 − 𝜋)𝑛−𝑦

2
Y={AA}  𝑃(𝑌 = 0) = ( ) 0.400 (1 − 0.40)2−0 = 0.36
0
2
Y={AG,GA} 𝑃(𝑌 = 1) = ( ) 0.401 (1 − 0.40)2−1 = 0.48
1
2
Y={GG}  𝑃(𝑌 = 2) = ( ) 0.402 (1 − 0.40)2−2 = 0.16
2
c. Suppose you observe y = 1 and do not know π. Calculate and sketch the likelihood
function.
Answer :
Fungsi Likelihood
𝑙 = (𝜋|𝑦 = 1)
𝑙 = 2𝜋(1 − 𝜋)
Dimana 0 ≤ 𝜋 ≤ 1, saat membuat plot dari fungsi likelihood maka didapat 𝜋 =0.5
d. Using the plotted likelihood function from (c), show that the ML estimate of π equals
0.50.
Answer :
Karena penaksir maksimum likelihood memaksimalkan fungsi likelihood, dengan
cara melakukan diferensial terhadap parameternya kemudian hasil diferensiasi
tersebut disamadengankan nol maka dari bagian c dapat diketahui bahwa fungsi 𝑙 =
2𝜋(1 − 𝜋) mengambil nilai maksimumnya di 𝜋̂𝑀𝐿 = 0.50

5. Refer to the previous exercise. Suppose y = 0 in 2 flips. Find the ML estimate of π. Does
this estimate seem “reasonable”? Why? [The Bayesian estimator is an alternative one that
combines the sample data with your prior beliefs about the parameter value. It provides a
nonzero estimate of π, equaling (y +1)/(n + 2) when your prior belief is that π is equally
likely to be anywhere between 0 and 1.]
Answer :
Jika y = 0, maka fungsi likehood akan menjadi 𝑙(𝜋|𝑦 = 0) = (1 − 𝜋)2 . 𝜋̂ =
0 memaksimumkan fungsi likelihood tersebut. Jadi dari hasil perhitungan parameter
tersebut dapat memungkinkan untuk mendapatkan gambar saat pelemparan koin.

6. Genotypes AA, Aa, and aa occur with probabilities (π1, π2, π3). For n = 3 independent
observations, the observed frequencies are (n1, n2, n3).
a. Explain how you can determine n3 from knowing n1 and n2. Thus, the multinomial
distribution of (n1, n2, n3) is actually two-dimensional.
Answer :
Diketahui n = 3,
maka untuk mendapatkan n3:
n3 = 3 – n1 – n2
b. Show the set of all possible observations, (n1, n2, n3) with n = 3.
Answer :
Observasi yang akan muncul adalah (3, 0, 0), (2, 1, 0), (2, 0, 1), (1, 2, 0), (1, 1, 1), (1,
0, 2), (0, 3, 0), (0, 2, 1), (0, 1, 2), (0, 0, 3)
c. Suppose (π1, π2, π3) = (0.25, 0.50, 0.25). Find the multinomial probability that (n1, n2,
n3)(1,2,0).
Answer :
Distribusi Multinomial :
𝑛! 𝑛 𝑛 𝑛
P (n1, n2, n3) = (𝑛 𝜋1 1 𝜋2 2 𝜋3 3
1 !𝑛2 !𝑛3 !)

3!
= (1!2!0!) x (0.25)1 x (0.50)2 x (0.50)0

= 3 (0.25) (0.25)
= 0.1875
The multinomial probability that (n1, n2, n3)(1,2,0) is 0.1875
d. Refer to (c). What probability distribution does n1 alone have? Specify the values of
the sample size index and parameter for that distribution.
Answer :
Distribusi peluang n1 adalah binomial probability distribution dengan n = 3, dan
parameter 𝜋 = 0.25.

7. In his autobiography A Sort of Life, British author Graham Greene described a period of
severe mental depression during which he played Russian Roulette. This “game” consists
of putting a bullet in one of the six chambers of a pistol, spinning the chambers to select
one at random, and then firing the pistol once at one’s head.
a. Greene played this game six times, and was lucky that none of them resulted in a
bullet firing. Find the probability of this outcome.
Answer :
Diketahui :
n=6
peluru tembak= y = 0
gagal = 6
𝜋 = 1/6

Peluang Binomial pada peluru tembak


𝑛!
P (y = 0) = y!(n−y)! 𝜋y(1- 𝜋)n-y
6!
= 0!(6−0)! (1/6)0(1- 1/6)6 - 0

= (5/6)6

= 0.3349

Jadi peluang tidak terjadi peluru tembak sebesar 0.3349


b. Suppose one kept playing this game until the bullet fires. Let Y denote the number of
the game on which the bullet fires. Argue that the probability of the outcome y equals
(5/6)y−1(1/6), for y = 1, 2, 3, . . . . (This is called the geometric distribution.)
Answer :
Y = y ketika terdapat (y – 1) keberhasilan, lalu terjadi kegagalan rangkaian peluang
dari kejadian yang saling independen adalah produk dari peluang kejadian yang saling
lepas.

8. When the 2000 General Social Survey asked subjects whether they would be willing to
accept cuts in their standard of living to protect the environment, 344 of 1170 subjects
said “yes.”
a. Estimate the population proportion who would say “yes.”
Answer :

𝑛(𝑦𝑒𝑠) 344
p = 𝑛(𝑠𝑢𝑏𝑗𝑒𝑐𝑡) = 1170 = 0.294

Proporsi populasi yang akan menjawab “yes” sebesar 0.294.


b. Conduct a significance test to determine whether a majority or minority of the
population would say “yes.” Report and interpret the P-value.
Answer :
n yang menjawab “yes” : 1170
𝜋̂ : 0.294
Hipotesis :
𝐻0 : 𝜋0 = 0.5, artinya proporsi yang mengatakan “yes” sama dengan 0.5
𝐻1 : 𝜋0 ≠ 0.5, artinya proporsi yang mengatakan “yes” tidak sama dengan 0.5
𝛼 =0.01
Statistik Uji :
𝜋̂ − 𝜋0
𝑍=
√𝜋0 (1 − 𝜋0 )/𝑛
0.294−0.5
=
√0.5(1−0.5)/1170

= −14.093
P-value = 2 x P(Z < -14.093) < 0.0001 , sehingga
Kriteria Uji : Tolak H0 jika p-value < alpha, terima dalam hal lainnya.
Di lihat dari hasil perhitungan ternyata p-value < 𝛼 =0.01, artinya 𝐻0 ditolak.
Kesimpulan : Dengan taraf signifikan 99% dapat disimpulkan bahwa 𝐻0 ditolak yang
artinya bahwa proporsi populasi yang mengatakan “yes” tidak sama dengan 0.05 .
c. Construct and interpret a 99% confidence interval for the population proportion who
would say “yes.”
Answer :
Selang kepercayaan, dengan nilai 𝑍0.99
𝜋0 (1−𝜋0 ) 𝜋0 (1−𝜋0 )
𝜋0 − 𝑍0.005 √ ≤ 𝜋̂ ≤ 𝜋0 + 𝑍0.005 √
𝑛 𝑛

0.294(1−0.294) 0.294(1−0.294)
0.294 − 2.58√ 1170
≤ 𝜋̂ ≤ 0.294 − 2.58√ 1170

0.294 − 0.03436 ≤ 𝜋̂ ≤ 0.294 + 0.03436


0.2596 ≤ 𝜋̂ ≤ 0.3284
Dengan tingkat kepercayaan 99%, dapat disimpulkan bahwa taksiran proporsi
populasi yang mengatakan “yes” berada dalam interval 0.2596 ≤ 𝜋̂ ≤ 0.3284.

9. A sample of women suffering from excessive menstrual bleeding have been taking an
analgesic designed to diminish the effects. A new analgesic is claimed to provide greater
relief. After trying the new analgesic, 40 women reported greater relief with the standard
analgesic, and 60 reported greater relief with the new one.
a. Test the hypothesis that the probability of greater relief with the standard analgesic is
the same as the probability of greater relief with the new analgesic. Report and
interpret the P-value for the two-sided alternative. (Hint:Express the hypotheses in
terms of a single parameter. A test to compare matched-pairs responses in terms of
which is better is called a sign test.)
Answer :
𝜋0 = 0.5
𝜋̂ = 0.6
𝑛 = 100
𝐻0 : 𝜋0 = 0.5, artinya peluang pengobatan standar sama dengan peluang
pengobatan baru
𝐻1 : 𝜋0 ≠ 0.5, artinya tidak peluang pengobatan standar sama dengan peluang
pengobatan baru
𝛼 =0.01
Statistik Uji :
𝜋̂ − 𝜋0
𝑍=
√𝜋0 (1 − 𝜋0 )/𝑛
0.6−0.5
=
√0.5(1−0.5)/100

=2
P value = 2 X P(Z< 2) = 0.0455, sehingga
Kriteria Uji : Tolak H0 jika p-value < alpha, terima dalam hal lainnya.
Di lihat dari hasil perhitungan ternyata p-value > 𝛼 =0.01, artinya 𝐻0 diterima.
Kesimpulan : Dengan taraf signifikan 99% dapat disimpulkan bahwa 𝐻0 diterima
yang artinya bahwa peluang pengobatan standar sama dengan peluang pengobatan
baru.
b. Construct and interpret a 95% confidence interval for the probability of greater relief
with the new analgesic.
Answer :
Selang kepercayaan, dengan nilai 𝑍0.025
𝜋0 ± 𝑍0.025 √𝜋0 (1 − 𝜋0 )/𝑛

𝜋0 (1 − 𝜋0 )
𝜋0 − 𝑍0.025 √ ≤ 𝜋̂ ≤ 𝜋0 + 𝑍0.025 √𝜋0 (1 − 𝜋0 )/𝑛
𝑛

0.6(1−0.6) 0.6(1−0.6)
0.6 − 1.96√ ≤ 𝜋̂ ≤ 0.6 + 1.96√
100 100

0.6 − 0.09602 ≤ 𝜋̂ ≤ 0.6 + 0.09602


0.50398 ≤ 𝜋̂ ≤ 0.69602
Dengan tingkat kepercayaan 95% , dapat dikatakan bahwa taksiran proporsi populasi
berada dalam interval 0.50398 ≤ 𝜋̂ ≤ 0.69602

10. Refer to the previous exercise. The researchers wanted a sufficiently large sample to be
able to estimate the probability of preferring the new analgesic to within 0.08, with
confidence 0.95. If the true probability is 0.75, how large a sample is needed to achieve
this accuracy? (Hint: For how large an n does a 95% confidence interval have margin of
error equal to about 0.08?)
Answer :
Margin error untuk proporsi = (koefisien konfiden) x (standar error dari p)
margin error yang dibutuhkan yaitu 0.08 dan peluang sebesar 0.75
Koefisien konfiden untuk nilai z pada tingkat signifikansi sebesar 95% adalah 1.96, maka

𝑝̂ (1 − 𝑝̂ )
𝑀𝑂𝐸 = 𝑧𝛼 x√
2 𝑛

0.75(1 − 0.75)
0.08 = 1.96 x√
𝑛
0.75(1 − 0.75)
= 1.665972511 ∙ 10−3
𝑛
𝑛 = 112.5
Maka jumlah sampel yang dibutuhkan untuk mendapat margin error sebesar 0.08 adalah
sebanyak 112.5 sampel atau jika dibulatkan menjadi 113 sampel.

11. When a recent General Social Survey asked 1158 American adults, “Do you believe in
Heaven?”, the proportion who answered yes was 0.86. Treating this as a random sample,
conduct statistical inference about the true proportion of American adults believing in
heaven. Summarize your analysis and interpret the results in a short report of about 200
words.
Answer :
Metode statistika inferens yang dipakai adalah penaksiran parameter interval
n = 1158
𝜋0 = 0,86
Penaksir interval dari 𝜋 adalah sebagai berikut.
𝜋0 ± 𝑍0.025 √𝜋0 (1 − 𝜋0 )/𝑛

𝜋0 (1 − 𝜋0 )
𝜋0 − 𝑍0.025 √ ≤ 𝜋̂ ≤ 𝜋0 + 𝑍0.025 √𝜋0 (1 − 𝜋0 )/𝑛
𝑛

0.86(1 − 0.86) 0.86(1 − 0.86)


0.86 − 1.96√ ≤ 𝜋̂ ≤ 0.86 + 1.96√
1158 1158
0,86 − 0,02 ≤ 𝜋̂ ≤ 0,86 + 0,02
0,84 ≤ 𝜋̂ ≤ 0,88
Dengan menggunakan statistic inferens yakni penaksiran parameter dengan alpha 5%
diperoleh hasil penaksir interval 𝜋 dari penelitian General Social Survey mengenai
kepercayaan orang dewasa di Amerika mengenai apakah mereka percaya akan adanya
surge adalah berada pada interval 0.84 sampai dengan 0.88.
Sehingga didapat bahwa dengan kepercayaan 95% dapat disimpulkan bahwa 𝜋̂ terletak
dalam interval 0,84 ≤ 𝜋̂ ≤ 0,88.

12. To collect data in an introductory statistics course, recently I gave the students a
questionnaire. One question asked whether the student was a vegetarian. Of 25 students, 0
answered “yes”. They were not a random sample, but let us use these data to illustrate
inference for a proportion. (You may wish to refer to Section 1.4.1 on methods of
inference). Let π denote the population proportion who would say “yes”. Consider H0: π =
0.5 and Ha: π ≠ 0.50.
a. What happens when you try to conduct the “Wald test”, for which 𝑧 = (𝑝 −
𝑝(1−𝑝)
𝜋0 )/√[ ] uses the estimated standard error?
𝑛

Answer :
n = 25
y=0
0
𝑃̂= 25 = 0

Dengan Menggunakan Uji wald :

𝑆𝐸 = √𝑃̂(1 − 𝑃̂ )/𝑛

𝑆𝐸 = √0(1 − 0)/25

𝑆𝐸 = 0

𝑃̂ − 𝜋0
𝑍=
√𝑃̂(1 − 𝑃̂)/𝑛
𝑃̂ − 𝜋0
𝑍=
𝑆𝐸
0 − 0.5
𝑍=
0
𝑍 = −∞
Jadi dengan demikian dapat disimpulkan bahwa hasil standar eror yang diperoleh
adalah sebesar 0 dan statistic z sama dengan −∞.
b. find the 95% “Wald confidence interval” (1.3) for π. Is it believeable? (When the
observation falls at the boundary of the sample space, often Wald methods do not
provide sensible answers).
Answer :

𝑃̂ − 𝑍0.025 √𝜋0 (1 − 𝜋0 )/𝑛 ≤ 𝜋̂ ≤ 𝑃̂ − 𝑍0.025 √𝜋0 (1 − 𝜋0 )/𝑛


𝑃̂ − 𝑍0.025 𝑆E ≤ 𝜋̂ ≤ 𝑃̂ + 𝑍0.025 𝑆E
0− 1.96 (0) ≤ 𝜋̂ ≤0 + 1.96 (0)
0 ≤ 𝜋̂ ≤ 0
Hasil dari selang kepercayaan (0,0) tidak dapat dipercaya karena kita mengharapkan
bahwa beberapa murid adalah vegetarian meskipun proporsinya sangat kecil.
𝜋0 (1−𝜋0 )
c. Conduct the “score test”, for which 𝑧 = (𝑝 − 𝜋0 )/√[ ] uses the null standard
𝑛

error. Report the P-value.


Answer :

𝑃̂ − 𝜋0
𝑍=
√𝑃̂(1 − 𝑃̂)/𝑛
0 − 0.5
𝑍=
√0.5(1 − 0.5)/25
−0.5
𝑍=
0.1
𝑍 = −5
Didapat nilai p-value lebih kecil dari 0.0001
Untuk mengetahui besarnya nilai p-value yang didapat, maka rumusnya sebagai
berikut:

𝑛! 𝑛!
= 2 {𝑦!(𝑛−𝑦)!π0y(1- π0)n-y + [𝑛!𝑦!π0n (1- π0)0}
25! 25!
= 2 {0!(25−0)!0.50 0.525-0 + 25!0!0.525 0.50}

= 2 {[ 1] 0.525 + [ 1] 0.525 } = 2 (0.00000003 + 0.00000003)


= 0.00000012
Sehingga terbukti bahwa nilai p-value = 0.00000012 < 0.0001.
d. Verify that 95% score confidence interval (i.e., the set of 𝜋0 for which |𝑧|<1.96 in the
score test) equals (0.0, 0.133). (Hint: what do the z test statistic and P-value equal
when you test H0: π = 0.133 against Ha: π ≠ 0.133.
Answer :
H0: π = 0.133
Ha: π ≠ 0.133

𝑃̂ − 𝜋0
𝑍=
√𝑃̂(1 − 𝑃̂)/𝑛
0 − 0.133
𝑍=
√0.133(1 − 0.133)/25
−0.133
𝑍=
0.0679
𝑍 = −1.96
Jadi, 𝜋0 adalah 0.133 yang memiliki nilai p-value sebesar 0.05 (terbukti benar)

13. Refer to the previous exercise, with y = 0 in n = 25 trials.


a. Show that l0, the maximized likelihood under H0, equals (1 − π0)25, which is (0.50)25
for H0: π = 0.50.
Answer :
ℓ0( π0) =(1- 𝜋0 )n
ℓ0( π0)= (1- 0.5)25
ℓ0( π0)= (0.5)25
sehingga (0.5)25 adalah nilai maksimum likelihood dibawah H0.
b. Show that l1, the maximum of the likelihood function over all possible π values,
equals 1.0. (Hint: This is the value at the ML estimate value of 0.0.)
Answer :
ℓ1( π) =(1- 𝜋)n
ℓ1( π)= (1- 𝜋)25
untuk mendapatkan maksimum likelihood dimana ℓ1( π) =(1- 𝜋)n =(1- 𝜋)25= 1
maka nilai π haruslah = 0
pembuktian :
saat π = 0 → ℓ1( π) =(1- 𝜋)n = (1- 0)25 = 1
jadi maksimum likelihood akan terjadi saat nilai π = 0
c. For H0: π = 0.50, show that the likelihood-ratio test statistic -2 log (ℓ0 / ℓ1 ), equals
34.7. Report the P-value
Answer :
𝑛!
ℓ0( π0) = 𝑦!(𝑛−𝑦)!π0y(1- π0)n-y
25!
=0!(25−0)!0.50 (1- 0.5)25 - 0

=(1- 0.5)25
= (0.5)25
𝑛!
ℓ1(π) = 𝑦!(𝑛−𝑦)!πy(1- π)n-y
25!
=0!(25−0)! π0(1- π)25

=(1-π)25

Jadi maksimum likelihood akan terjadi pada saat nilai π = 0

ℓ1(π) = (1-π)25 = (1 - 0)25 = 1

Likelihood rasio test :

-2 log (ℓ0 / ℓ1 ) = -2 log [(0.5)25 / (1)] = 34.7

Didapat nilai p-value lebih kecil dari 0.0001


Untuk mengetahui besarnya nilai p-value yang didapat, maka rumusnya sebagai
berikut:

𝑛! 𝑛!
= 2 {𝑦!(𝑛−𝑦)!π0y(1- π0)n-y + [𝑛!𝑦!π0n (1- π0)0}
25! 25!
= 2 {0!(25−0)!0.50 0.525-0 + 25!0!0.525 0.50}

= 2 {[ 1] 0.525 + [ 1] 0.525 } = 2 (0.00000003 + 0.00000003)


= 0.00000012
Sehingga terbukti bahwa nilai p-value = 0.00000012 < 0.0001.
d. The 95% likelihood-ratio confidence interval for π is (0.000, 0.074).Verify that 0.074
is the correct upper bound by showing that the likelihood-ratio test of H0: π = 0.074
against Ha: π ≠ 0.074 has chi-squared test statistic equal to 3.84 and P-value = 0.05.
Jawaban :
𝑛!
ℓ0( π0) = 𝑦!(𝑛−𝑦)!π0y(1- π0)n-y
25!
= 0!(25−0)! 0.0740(1- 0.074)25

= (0.926)25
𝑛!
ℓ1(π) = 𝑦!(𝑛−𝑦)!πy(1- π)n-y
25!
= 0!(25−0)! π0(1- π)25

= (1-π)25

ℓ1(π) = (1-π)25 = (1 - 0)25 = 1

Jadi maksimum likelihood akan terjadi pada saat nilai π = 0

Bedasarkan pada Likelihood ratio test: -2 log (ℓ0 / ℓ1 ) = -2 log [(0.926)25 / (1)] = 3.84
Didapat nilai p value lebih kecil dari 0.05 dengan menggunakan tabel Chi-square

Untuk mengetahui besarnya nilai p-value yang didapat, maka rumusnya sebagai
berikut:

𝑛! 𝑛!
= 2 {𝑦!(𝑛−𝑦)!π0y(1- π0)n-y + [𝑛!𝑦!π0n (1- π0)0}
25! 25!
= 2 {0!(25−0)! 0.0740 0.07425 + 0!(25−0)! 0.07425 0.0740}

= 2 {[ 1] 0.07425 + [ 1] 0.07425 } = < 0.0000000001


Sehingga terbukti bahwa nilai p-value = 0.00000012 < 0.0001.

14. Sections 1.4.4 and 1.4.5 found binomial P-values for a clinical trial with y = 9 successes
in 10 trials. Suppose instead y = 8. Using the binomial distribution shown in Table 1.2:
a. Find the P-value for (i) Ha:π > 0.50, (ii) Ha:π < 0.50.
Answer :
(i) P-value untuk H0: π > 0.5 = P(8) + P(9) + P (10) = 0.055
(ii) P-value untuk H0: π < 0.5 = ∑8𝑖=0 𝑃(𝑖) = 1 − 𝑃(9) − 𝑃(10) = 0.989
b. Find the mid P-value for (i) Ha:π > 0.50, (ii) Ha:π < 0.50.
Answer :
𝑃(8)
(i) Nilai tengah P-value untuk H0: π > 0.5 = + P(9) + P (10) = 0.033
2
𝑃(8)
(ii) Nilai tengah P-value untuk π < 0.5= ∑7𝑖=0 𝑃(𝑖) = 1 − = 1 − 𝑃(9) −
2
𝑃(8)
𝑃(10) + = 0.967
2
c. Why is the sum of the one-sided P-values greater than 1.0 for the ordinary P-value but
equal to 1.0 for the mid P-value?
Answer :
Kita dapat melihat untuk nilai p-value yang biasa satu sisi p-value= ∑10
𝑖=0 𝑃(𝑖) +

𝑃(8) = 1 + 𝑃(8) > 1. Tapi untuk nilai tengah p-value adalah ∑10
𝑖=0 𝑃(𝑖) = 1

15. If Y is a variate and c is a positive constant, then the standard deviation of the distribution
𝑌
of cY equals cσ(Y ). Suppose Y is a binomial variate, and let p = 𝑛.
𝜋(1−𝜋) ½
a. Based on the binomial standard deviation for Y , show that σ(p) = [ ] .
𝑛

Answer :
Berdasarkan standar deviasi untuk Y yang berdistribusi binomial, akan ditunjukkan
𝜋(1−𝜋) ½
bahwa σ(p) = [ ]
𝑛

Telah diketahui bahwa :


E[X] = np
Var[X] = np(1-p), dan standar deviasi adalah akar dari varians.
Berikut adalah pembuktian :
Var[X] = 𝐸([𝑋 − 𝐸(𝑋)]2 )
Var[X] = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2
Var[X] = 𝐸(𝑋(𝑋 − 1)) + 𝐸(𝑋) − [𝐸(𝑋)]2
Var[X] = (𝑛2 𝑝2 − 𝑛𝑝2 ) + 𝑛𝑝 − (𝑛𝑝2 )
Var[X] = np - 𝑛𝑝2
= np(1-p)
Terbukti bahwa :
𝜋(1−𝜋) 𝜋(1−𝜋) ½
𝑣𝑎𝑟𝑖𝑎𝑛𝑠 = 𝜎 2 (p) = [ ] dan Standar Deviasi = σ(p) = [ ] .
𝑛 𝑛

b. Explain why it is easier to estimate π precisely when it is near 0 or 1 than when it is


near 0.50.
Answer :
σ (p) mengambil nilai maksimum pada π = 0,50 dan minimum pada π = 0 dan 1.
Misalnya π = 1, maka setiap pengamatan harus sukses, dan proporsi sampel p sama
dengan π yakni dengan probabilitas 1. Berbeda jika π = 0,50 maka setiap pengamatan
memiliki dua kemungkinan, yaitu bisa sukses atau gagal dan proporsi sampel p
dengan π berbeda.
16. Using calculus, it is easier to derive the maximum of the log of the likelihood function, L
= log l, than the likelihood function l itself. Both functions have maximum at the same
value, so it is sufficient to do either.
a. Calculate the log likelihood function L(π) for the binomial distribution (1.1).
Answer :
𝑛
p(x) = P(X=x) = (𝑦) 𝜋 𝑦 (1 − 𝜋)𝑛−𝑦 ; y = 0,1,2,….,n

µ = n𝜋
𝜎 2 = 𝑛𝜋(1 − 𝜋)
𝑛
L(π) = log[(𝑦) 𝜋 𝑦 (1 − 𝜋)𝑛−𝑦 ]
n!
L(π) = log [y!(n−y)! 𝜋 𝑦 (1 − 𝜋)𝑛−𝑦 ]
n!
L(π) = log [y!(n−y)!] + log(𝜋)𝑦 + log(1- 𝜋)(𝑛−𝑦)
n!
L(π) = log [y!(n−y)!] + y log(𝜋) + (n-y) log(1- 𝜋)

b. One can usually determine the point at which the maximum of a log likelihood L
occurs by solving the likelihood equation. This is the equation resulting from
differentiating L with respect to the parameter, and setting the derivative equal to
zero. Find the likelihood equation for the binomial distribution, and solve it to show
that the ML estimate equals p = y/n.
Answer :
y (1-p) = (n-y) p
y – yp = (np – yp)
y + yp = np + yp
yp = np + yp – y
p = (np + yp – y)/ y
p = np/y + p
np = y
p = y/n
p = (y/n) (Terbukti)

17. Suppose a researcher routinely conducts significance tests by rejecting H0 if the P-value
satisfies P ≤ 0.05. Suppose a test using a test statistic T and righttail probability for the P-
value has null distribution P(T = 0) = 0.30, P(T =3) = 0.62, and P(T = 9) = 0.08.
a. Show that with the usual P-value, the actual probability of type I error is 0 rather than
0.05.
Answer :
Saat T=0, p-value = P(T≥0) = 0.3+0.62+0.08 = 1. Saat T = 3, p-value =
P(T≥3)=0.62+0.08 = 0.7. saat T=9, p-value = P(T≥9) = 0.08. karena nilai p-value
selalu lebih besar dari 0.05, maka kita tidak akan pernah menolak Ho. Kita tidak akan
memiliki kekeliruan tipe 1, karena peluang kekeliruan tipe 1 adalah 0 (terbukti).
b. Show that with the mid P-value, the actual probability of type I error equals 0.08.
Answer :
Saat T=0, nilai tengah p-value = 0.3/2+0.62+0.08 = 0.85. Saat T = 3, nilai tengah p-
value = 0.62/2+0.08 = 0.39. saat T=9, nilai tengah p-value =0.08/2 = 0.04. sehingga
kita akan menolak Ho saat T=9 karena nilai tengah p-value = 0.04<0.05. maka
peluang kekeliruan tipe 1 adalah peluang T=9 yaitu 0.08 (terbukti).
c. Repeat (a) and (b) using P(T = 0) = 0.30, P(T = 3) = 0.66, and P(T =9) = 0.04. Note
that the test with mid P-value can be “conservative” [having actual P(type I error)
below the desired value] or “liberal” [having actual P(type I error) above the desired
value]. The test with the ordinary P-value cannot be liberal.
Answer :
Saat T=0, p-value = P(T≥0) = 0.3+0.66+0.04 = 1 dan nilai tengah p-value = 0.3/2 +
0.66 + 0.04 = 0.85. Saat T = 3, p-value = P(T≥3)=0.66+0.04 = 0.7 dan nilai tengah p-
value = 0.66/2 + 0.04 = 0.37 . saat T=9, p-value = P(T≥9) = 0.04 dan nilai tengah p-
value = 0.04/2 = 0.02. dengan nilai p-value biasa, kita menolak H0 saat T=9 karena
pada kasus ini p-value = 0.04 ≤ 0.05. maka peluang kekeliruan tipe 1 adalah peluang
T=9 yaitu sebesar 0.04. dengan nilai tengah p-value, kita menolak H0 saat T=9 karena
pada kasus nilai tengah p-value = 0.02 ≤ 0.05. sehingga peluang kekeliruan tipe 1
adalah peluang bahwa T=9 yaitu sebesar 0.04.

18. For a given sample proportion p, show that a value π0 for which the test statistic z = (p −
π0)/√[π0(1 − π0)/n] takes some fixed value z0 (such as 1.96) is a solution to the equation (1
+ z20/n)π20+ (−2p − z20/n)π0 + p2 = 0. Hence, using the formula x = [−b ±√(b2 − 4ac)]/2a
for solving the quadratic equation ax2 + bx + c = 0, obtain the limits for the 95%
confidence interval in Section 1.3.4 for the probability of success when a clinical trial has
nine successes in 10 trials.
Answer :
Diketahui:
p − π0
z0 =
√π0 (1 − π0 )/n
Dimana,
(p − π0 )2
z02 =
π0 (1 − π0 )/n
z02 π0 z02 π20
p2 − 2pπ0 + π20 = −
n n
z02 2 z02
(1 + ) π0 + (−2p − ) π0 + p2 = 0
n n
Maka,
2
z2 z2 z2
2p + n0 ± √(2p + n0 ) − 4p2 (1 + n0 )
π0 = 2
z02
2 (1 + n )

z02 p(1 − p) z02


p + 2n ± z0 √ + 4n
n
π0 =
z2
1 + n0

Dengan derajat kepercayaan 95% dapat disimpulkan bahwa interval kepercayaan


0,5959 ≤ 𝜋̂ ≤ 0,9821.

You might also like