ZQMS-ARC-REC-002
ASSIGNMENT COVER
REGION:
_VIRTUAL____________________________________________________________________
PROGRAMME: __BSCHMSZ_________________________________________________
INTAKE:__5__
FULL NAME OF STUDENT: _ROBERT
NYAMUGUNDURU_______________________________________
PIN:__P2476105H______
MAILING ADDRESS:
__N/A________________________________________________________
CONTACT TELEPHONE/CELL: _0818567683________________________ ID. NO.:
____34076827D34____________
COURSE NAME: _STATISTICAL INFERENCE_____________________________________
COURSE CODE: _BSTD103________
ASSIGNMENT NO. e.g. 1 or 2: ___1________________________ DUE DATE:
_____30/09/2024________
ASSIGNMENT TITLE: __________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
MARKER’S COMMENTS: ______________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
OVERALL MARK: _____________
MARKER’S NAME: ________________________
MARKER’S SIGNATURE:_______________________________
Issue Date: 3 October 2013
DATE: ___________
Revision 0
A1
(a)
Statistics can be considered both an art and a science.
Science: Statistics involves systematic methods of collecting, analysing, and interpreting data. It
relies on mathematical theories and formulas to test hypotheses and make data-driven
conclusions. Statistical tools like probability theory, regression analysis, and hypothesis testing
are grounded in scientific principles, making it a science.
Art: On the other hand, statistics also involves judgment, intuition, and creativity in selecting
appropriate methods, interpreting results, and making decisions based on incomplete or uncertain
data. The subjective elements of designing experiments or surveys, and the interpretation of
complex data patterns, demonstrate the artistic side of statistics.
Thus, statistics is both a science in its methodical approach and an art in its practical application,
balancing technical rigor with human judgment.
(b)
(i).
The Method of Least Squares (LSE) is a mathematical procedure used to find the best-fitting
line (or model) for a set of observed data points by minimizing the sum of the squares of the
differences between observed values and the values predicted by the model. It is commonly used
in linear regression analysis to estimate the parameters of a linear relationship between variables.
(ii)
A matched pair refers to a statistical design in which pairs of subjects are matched based on
certain characteristics or variables (such as age, gender, or pre-existing conditions) to control for
confounding factors. Each pair is then exposed to different treatments or conditions. Matched
pairs are commonly used in experiments or studies comparing two treatments or groups, as the
pairing helps to reduce variability and improve the accuracy of comparisons.
(iii)
A statistical hypothesis is a formal statement or assumption made about a population parameter
(such as the mean or proportion) that can be tested using statistical methods. It is generally of
two types:
Null hypothesis (H₀): Assumes no effect or no difference.
Alternative hypothesis (H₁ or Hₐ): Assumes the presence of an effect or a difference.
The aim of hypothesis testing is to determine whether there is enough evidence in the sample
data to reject the null hypothesis in favour of the alternative hypothesis.
(iv)
The power of a statistical test is the probability that the test correctly rejects a false null
hypothesis (i.e., avoids a Type II error). It measures a test's ability to detect an effect when
there is one. A higher power indicates a greater likelihood of detecting a true effect, and it
depends on factors such as sample size, significance level (α), and the effect size
A2
(a)
Find the maximum likelihood estimator (MLE) of 𝜃
The likelihood function𝐿(𝜃) for the sample is the product of the individual likelihoods
𝑛
𝑛
𝐿(𝜃) = ∏ 𝑓(𝑥) = ∏
𝑖=1
𝑖=1
𝑛
𝐿(𝜃) = (𝑒
𝑛
−𝜃 𝑛
) . 𝜃 ∑ 𝑥𝑖 ∏
𝑖=1
𝑛
𝐿(𝜃) = 𝑒
𝑒 −𝜃 𝜃 𝑥𝑖
𝑥!
−𝑛𝜃
𝜃 ∑ 𝑥𝑖
𝑖=1
𝑖=1
1
𝑥!
1
∏𝑛𝑖=1 𝑥𝑖 !
The log-likelihood function ℓ(𝜃) is:
𝑛
ℓ(𝜃) = 𝑙𝑛𝐿(𝜃) = 𝑙𝑛 (𝑒
−𝑛𝜃
. 𝜃 ∑ 𝑥𝑖
𝑖=1
𝑛
1
)
∏𝑛𝑖=1 𝑥𝑖 !
𝑛
ℓ(𝜃) = −𝑛𝜃 + (∑ 𝑥𝑖 ) 𝑛𝜃 − 𝑙𝑛 (∏ 𝑥𝑖 !)
𝑖=1
𝑖=1
∑𝑛𝑖=1 𝑥𝑖
𝑑ℓ(𝜃)
= −𝑛 +
𝑑𝜃
𝜃
∑𝑛𝑖=1 𝑥𝑖
−𝑛 +
=0
𝜃
∑𝑛𝑖=1 𝑥𝑖
=𝑛
𝜃
𝑛
1
𝜃̂ = ∑ 𝑥𝑖
𝑛
𝑖=1
So the MLE for 𝜃 is:
𝑛
1
𝜃̂ = 𝑋̅ = ∑ 𝑋𝑖
𝑛
𝑖=1
(b) .
An Estimator 𝜃̂ is consistent if:
The estimator converges in probability to the parameter as the sample size 𝑛 tends to
infinity.
The estimator is unbiased and the variance of the estimator goes to zero as 𝑛 increases
First, let’s check if 𝜃̂ = 𝑋̂ is unbiased
𝑛
𝑛
𝑖=1
𝑖=1
1
1
1
𝐸(𝜃̂) = 𝐸 ( ∑ 𝑋𝑖 ) = ∑ 𝐸(𝑋𝑖 ) = . 𝑛𝜃 = 𝜃
𝑛
𝑛
𝑛
So,𝜃̂ is unbiased estimator of 𝜃.
Let’s show that the variance of 𝜃̂ → 0 𝑎𝑠 𝑛 → ∞
𝑛
𝑛
𝑖=1
𝑖=1
1
1
1
𝜃
𝑉𝑎𝑟(𝜃̂) = 𝑉𝑎𝑟( ∑ 𝑋𝑖 = 2 ∑ 𝑉𝑎𝑟𝑋𝑖 = 2 . 𝑛𝜃 =
𝑛
𝑛
𝑛
𝑛
𝐴𝑠 𝑛 → ∞, 𝑉𝑎𝑟(𝜃̂) =
𝜃
→0
𝑛
𝜃̂ = 𝑋̂ is a consistent estimator of 𝜃
A3
𝜇𝑥 = 3 , 𝜇𝑦 = 4
𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 𝜎 2 = 5
(a)
Distribution of 3𝑋 + 4
𝑋~𝑁(𝜇𝑥 , 𝜎𝑥 2 )
𝑀𝑒𝑎𝑛 = 𝑎𝜇𝑥 + 𝑏
𝑉𝑎𝑟𝑖𝑎𝑛𝑐𝑒 = 𝑎2 𝜎𝑥 2
𝑋~𝑁(3,5)
𝐸(3𝑋 + 4) = 3𝐸(𝑋) + 4 = 3(3) + 4 = 13
𝑉𝑎𝑟(3𝑋 + 4) = 32 𝑉𝑎𝑟(𝑋) = 9(5) = 45
3𝑋 + 4~𝑁(13,45)
(b).
Distribution of 2𝑋 − 5𝑌
𝑋~𝑁(𝜇𝑥 , 𝜎𝑥 2 ) 𝑎𝑛𝑑 𝑌~𝑁(𝜇𝑦 , 𝜎𝑦 2 )
𝑎𝑋 + 𝑏𝑌
𝑚𝑒𝑎𝑛 𝑎𝜇𝑥 + 𝑏𝜇𝑦
𝑉𝑎𝑟𝑖𝑎𝑛𝑐𝑒 𝑎2 𝜎𝑥 2 + 𝑏 2 𝜎 2 𝑦
Given:
𝑋~𝑁(3,5)𝑎𝑛𝑑 𝑌~𝑁(4,5)
𝐸(2𝑋 − 5𝑌) = 2𝐸(𝑋) − 5𝐸(𝑌)
= 2(3) − 5(4)
= 6 − 20
= −14
𝑉𝑎𝑟𝑖𝑎𝑛𝑐𝑒(2𝑋 − 5𝑌) = 22 𝑉𝑎𝑟(𝑋) − 52 𝑉𝑎𝑟(𝑌)
= 4(5) + 25(5)
= −145
A4
𝜃 + 2𝜃 + 3𝜃 = 1
𝜃=
1
6
1
2
3
𝐸(𝑋) = 𝜇 = 1 × + 2 × + 3
6
6
6
= 2.333
A6
(a)
(𝑛1 − 1)𝑆1 2
~𝜒𝑛21 −1
2
𝜎1
(𝑛1 − 1)𝑆2 2
~𝜒𝑛22 −1
𝜎22
F-Distribution:
To derive the F-Distribution we need to use the ratio of two Chi-square distributions
divided by their degrees of freedom:
(
(
(𝑛2 − 1)𝑆22
)
𝜎22
𝑛2 − 1
(𝑛1 − 1)𝑆12
)
𝜎12
𝑛1 − 1
This simplifies to:
(𝑛2 − 1)𝑆22 𝑆22
⁄ 2
(𝑛2 − 1)𝜎22
𝜎
= 2 2
2
(𝑛1 − 1)𝑆1
𝑆1
⁄ 2
2
𝜎1
(𝑛1 − 1)𝜎1
=
𝑆22 . 𝜎12
𝑆12 . 𝜎22
By definition, the ratio follows the F-distribution:
𝑆22
𝜎22
𝜎12
× 2 ~𝐹𝑛2 −1,𝑛1 −1
𝑆1
(b)
(i)
𝑝̂ =
175
= 0.4375
400
The standard error (SE) of the sample proportion is given by:
𝑝̂ (1 − 𝑝̂ )
0.4375 × 0.5625
𝑆𝐸 = √
=√
≈ 0.0248
𝑛
400
The critical value for a 95% confidence interval is 1.96
Thus, the margin of error (ME) is:
𝑀𝐸 = 1.96 × 𝑆𝐸 ≈ 1.96 × 0.0248 ≈ 0.0486
Therefore, the 95% confidence interval for p is:
𝑝̂ ± 𝑀𝐸 = 0.4375 ± 0.0486
This yields the interval:
0.4375 − 0.0486 ≤ 𝑝 ≤ 0.4375 + 0.0486
So, the 95% on confidence interval for the probability of a head is:
[0.3889,04861]
(ii).
A coin is considered fair if the probability of getting a p (head) is0.5.This 95% confidence
interval for p is [0.3889,0.4861]
Since 0.5 is not within the confidence interval, we conclude that the coin does not appear to
be a fair coin.
A6.
(a)
Given:
Conventional treatment: 𝑛1 = 50 𝑥1 = 20
New treatment:𝑛2 = 80 , 𝑥2 = 48
Let’s find the 90% confidence interval for the difference in proportions:
(i)
90% 𝑐𝑜𝑛𝑓𝑖𝑑𝑒𝑛𝑐𝑒 𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙 𝑓𝑜𝑟 𝑡ℎ𝑒 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝑖𝑛 𝑝𝑟𝑜𝑝𝑜𝑟𝑡𝑖𝑜𝑛𝑠:
𝑝
̂1 =
𝑥1 20
=
= 0.4
𝑛1 50
, 𝑝̂ 2 =
𝑥2 48
=
= 0.6
𝑛2 80
The difference in sample proportions:
𝑝̂1 − 𝑝̂2 = 0.4 − 0.6 = −0.2
The standard error (SE) for the difference in proportions is:
𝑝
̂(1
−𝑝
̂)
𝑝
̂(1
− 𝑝̂ 2 )
0.4(0.6) 0.6(0.4)
1
1
2
𝑆𝐸 = √
+
=√
+
= 0.0884
𝑛1
𝑛2
50
80
For a 90% confidence interval, the critical value 𝑧𝛼/2 for two-tailed test is approximately
1.645
𝑀𝐸 = 𝑧𝛼/2 × 𝑆𝐸 = 1.645 × 0.0884 ≈ 0.1454
Thus, the 90% confidence interval for 𝑝̂1 − 𝑝̂ 2 𝑖𝑠: −0.2 ± 0.1454
[−0.3454, −0.0546]
(ii) Sufficient statistical evidence
To determine whether there is sufficient statistical evidence to show that the new
treatment is more effective than the conventional one, we check if the confidence interval
includes 0.
Since the 90% confidence interval for the difference in proportion[−0.3454, −0.0546] does
not include 0, we reject null hypothesis that there is no difference in effectiveness.
There is sufficient evidence to conclude that new treatment is more effective than the
conventional treatment at 90% confidence level.
(b)
Since 𝑋̂𝑖 ~𝑁(𝜇, 𝜎 2 ),the sample mean 𝑋̂ follows;
𝑋̂~𝑁(𝜇,
𝜎2
)
𝑛
The expression (𝑋̂ − 𝜇) standardizes to the standard normal distribution:
𝑋̂ − 𝜇
~𝑁(0,1)
𝜎
⁄ 𝑛
√
Squaring the standard normal random variables yields:
2
𝑋̂ − 𝜇
(𝜎
) ~𝑁(0,1)
⁄ 𝑛
√
Squaring the standard normal random variable yields:
2
𝑋̂ − 𝜇
(𝜎
) ~𝜒𝑖2
⁄ 𝑛
√
Multiplying by 𝑛 gives:
2
2
𝑛(𝑋̂ − 𝜇)
𝑋̂ − 𝜇
𝑛(
) =
~𝜒12
2
𝜎
𝜎/√𝑛
Thus, the distribution of T is:
2
𝑛(𝑋̂ − 𝜇)
𝑇=
~𝜒12
𝜎2
A7
Finding a 95% 𝑐𝑜𝑛𝑓𝑖𝑑𝑒𝑛𝑐𝑒 𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙 𝑓𝑜𝑟 𝜇1 − 𝜇2
Given:
𝑆𝑎𝑚𝑝𝑙𝑒: 𝑛1 = 25, 𝑥̅1 = 30 , 𝑠1 2 = 81
𝑠𝑎𝑚𝑝𝑙𝑒: 𝑛2 = 20, 𝑥̅2 = 45, 𝑠2 2 = 64
(𝑥̅1 − 𝑥̅2 ) = ±𝑡𝛼 , √(
2
𝜈=
𝑠 2 𝑠 2
( 𝑛1 + 𝑛2 )
1
2
2
𝑠1 2 𝑠2 2
+
)
𝑛1
𝑛2
2
2
𝑠 2
𝑠 2
( 𝑛1 )
( 𝑛2 )
1
2
𝑛1 − 1 + 𝑛2 − 1
81 64 2
+ )
𝜐 ≈ 252 20 2 ≈ 41
81
64
( )
(20)
25 +
24
20
(
𝑡𝛼 , 𝜐 = 41
2
𝛼 = 0.05
𝑡𝛼,41 = 2.020
2
Margin of error:
𝑠1 2 𝑠2 2
81 64
𝐸 = 𝑡𝛼, , 𝜈 √
+
= 2.020√ +
= 5.13
𝑛1
𝑛2
25 20
2
Thus the 95% confidence interval for 𝜇1 − 𝜇2 is:
(𝑥̅1 − 𝑥̅2 ) = ±𝐸 = (30 − 45) ± 5 = −15 ± 5.13
𝐶𝑜𝑛𝑓𝑖𝑑𝑒𝑛𝑐𝑒 𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙: (−20.13, −9.87)
(ii). Testing at 5% 𝑙𝑒𝑣𝑒𝑙
The null hypothesis 𝐻0 and the alternative 𝐻1 are:
𝐻0 : 𝜇1 = 𝜇2
𝐻1 : 𝜇1 ≠ 𝜇2
Since the 95% confidence interval for 𝜇1 − 𝜇2 does not include 0(−20.13, −9.87), we reject
the null hypothesis at the 5% significance level.
Hence, there is sufficient evidence to conclude that 𝜇1 𝑎𝑛𝑑 𝜇2 are not equal.
(b).
Determining the sample size required
𝑚𝑒𝑎𝑛 𝑥̅ = 60, 𝑠𝑡𝑎𝑛𝑑𝑎𝑟𝑑 𝑑𝑒𝑣𝑖𝑎𝑡𝑖𝑜𝑛 𝜎 = 3, 𝑚𝑎𝑟𝑔𝑖𝑛 𝑜𝑓 𝑒𝑟𝑟𝑜𝑟
𝐸 = 0.01 𝐶𝑜𝑛𝑓𝑖𝑑𝑒𝑛𝑐𝑒 𝑙𝑒𝑣𝑒𝑙 5%
Sample size 𝑛:
𝑧𝛼
𝑛=(
2
𝐸
2
𝜎)
For a 95% confidence level,𝑧𝛼/2 = 1.96
1.96(3) 2
𝑛=(
) = 345744
0.01
Thus, the required sample size to estimate the mean within 0.01 of the true mean with
probability with a 95% is 345744.