Solutions to Assignment
VerifiedAdded on 2023/01/19
|9
|1717
|78
AI Summary
This document provides solutions to various assignment questions. It covers topics such as confidence intervals, hypothesis testing, and chi-square tests. The solutions are explained step by step with relevant formulas and calculations. The document also includes R code for performing statistical tests. The assignments are related to different subjects and courses.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
Surname 1
Student’s Name
Professor’s Name
Course
Date
Solutions to Assignment
Question 1
(i) Since the data is normally distributed and n = 41 > 30, we use
x ± Zα/ 2
S
√n
Where: α = 5% = 0.05, Z0.025=1.96, and √n= √41=6.4031
Therefore, 95% CI is 19.40 ± 1.96 ( 1.90
6.4031 )
( 19.4° ± 0.5816° )
18.8184° ≤ μ ≤19.9816°
(ii) The original population is normally distributed then the standard deviation is
estimated as follows:
( n−1 ) s2
χ α
2
2 ≤ σ2 ≤ ( n−1 ) s2
χ1− α
2
2
For a sample size of n = 41, we will have df = n – 1 = 40 degrees of
freedom. For a 95% confidence interval, we have α = 0.05, which gives 2.5%
of the area at each end of the chi-square distribution. We find values of
χ0.975
2 =13.844 and χ0.025
2 =41.923.
( n−1 ) s2
χ α
2
2 = 40 x 1.9 02
41.923 =3.444 and
( n−1 ) s2
χ1− α
2
2 = 40 x 1.9 02
13.844 =10.4305. Therefore,
the 95% confidence interval for the population variance is:
3.444° ≤ σ2 ≤10.4305°
Student’s Name
Professor’s Name
Course
Date
Solutions to Assignment
Question 1
(i) Since the data is normally distributed and n = 41 > 30, we use
x ± Zα/ 2
S
√n
Where: α = 5% = 0.05, Z0.025=1.96, and √n= √41=6.4031
Therefore, 95% CI is 19.40 ± 1.96 ( 1.90
6.4031 )
( 19.4° ± 0.5816° )
18.8184° ≤ μ ≤19.9816°
(ii) The original population is normally distributed then the standard deviation is
estimated as follows:
( n−1 ) s2
χ α
2
2 ≤ σ2 ≤ ( n−1 ) s2
χ1− α
2
2
For a sample size of n = 41, we will have df = n – 1 = 40 degrees of
freedom. For a 95% confidence interval, we have α = 0.05, which gives 2.5%
of the area at each end of the chi-square distribution. We find values of
χ0.975
2 =13.844 and χ0.025
2 =41.923.
( n−1 ) s2
χ α
2
2 = 40 x 1.9 02
41.923 =3.444 and
( n−1 ) s2
χ1− α
2
2 = 40 x 1.9 02
13.844 =10.4305. Therefore,
the 95% confidence interval for the population variance is:
3.444° ≤ σ2 ≤10.4305°
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Surname 2
Question 2
(i) The test is one sample t – test since the sample size = 8 less than 30.
H0: μ>60 dB ¿the true mean noise level is greater than 60dB)
Ha: μ ≤60 dB¿the true mean noise level is than or equal to 60dB)
(ii) The test statistic is t-tests defined as follows:
tcal .= √ n ( μ−x )
s
tcal .= √ 8 ( 60−72 )
10 =−3.3941
The decision, reject null hypothesis if |tcal .|≥ , t0.025 ,(7)
Now, t0.025 ,(7)=2.3650
Since |tcal .|=3.3941>2.3650 we reject the null hypothesis and conclude
that there is sufficient evidence to suggests that the true mean noise level is
greater than 60dB at 95% significance level. Thus, the residences have
managed to disapprove the government report.
(iii) Solution to part (iii)
(a) The R-code for determining sample size:
## Install the pwr R-package
install.packages("pwr")
library(pwr)
delta <- 0.5
sigma <- 10
d <- delta/sigma
pwr.norm.test(d=d, sig.level=.05, power = .99)
## The results
Question 2
(i) The test is one sample t – test since the sample size = 8 less than 30.
H0: μ>60 dB ¿the true mean noise level is greater than 60dB)
Ha: μ ≤60 dB¿the true mean noise level is than or equal to 60dB)
(ii) The test statistic is t-tests defined as follows:
tcal .= √ n ( μ−x )
s
tcal .= √ 8 ( 60−72 )
10 =−3.3941
The decision, reject null hypothesis if |tcal .|≥ , t0.025 ,(7)
Now, t0.025 ,(7)=2.3650
Since |tcal .|=3.3941>2.3650 we reject the null hypothesis and conclude
that there is sufficient evidence to suggests that the true mean noise level is
greater than 60dB at 95% significance level. Thus, the residences have
managed to disapprove the government report.
(iii) Solution to part (iii)
(a) The R-code for determining sample size:
## Install the pwr R-package
install.packages("pwr")
library(pwr)
delta <- 0.5
sigma <- 10
d <- delta/sigma
pwr.norm.test(d=d, sig.level=.05, power = .99)
## The results
Surname 3
Mean power calculation for normal distribution with known variance
d = 0.05
n = 7348.988
sig.level = 0.05
power = 0.99
alternative = two.sided
The residents will need at least 7349 measurements.
(b) Since the population standard deviation is unknown, we use one
sample t as follows:
## R- Code for the calculation
pwr.t.test(d = d, sig.level = .05, power = .99, type = "one.sample")
One-sample t test power calculation
n = 7350.909
d = 0.05
sig.level = 0.05
power = 0.99
alternative = two.sided
The residents will need at least 7351 measurements.
Mean power calculation for normal distribution with known variance
d = 0.05
n = 7348.988
sig.level = 0.05
power = 0.99
alternative = two.sided
The residents will need at least 7349 measurements.
(b) Since the population standard deviation is unknown, we use one
sample t as follows:
## R- Code for the calculation
pwr.t.test(d = d, sig.level = .05, power = .99, type = "one.sample")
One-sample t test power calculation
n = 7350.909
d = 0.05
sig.level = 0.05
power = 0.99
alternative = two.sided
The residents will need at least 7351 measurements.
Surname 4
Question 3
(i) H0: The treatments have no effect on the probability of relapse
Ha: The treatments have an effect to the probability of relapse
(ii) Relapse give desipramine = 59
95 x 18=8 people
(iii) The X-squared = 8.22 is less than X-squared under H0 = 117.6 thus we
fail to reject the null hypothesis and conclude that the treatments do not
have an effect on the probability of relapse.
Question 4
Sign test with hypothesis:
H0: +/- are exchangeable
Ha: +/- are not exchangeable
Test statistic r = number of positive signs = 3
If H0 (+/− are exchangeable) is true, then r ∼ bin(n, 0.5):
p - value = P bin(10, 0.5) ≥ 3 =
P bin(10, 0.5) ≥ 3 = 1 - P bin(10, 0.5) < 3
P bin(10, 0.5) ≥ 3 = 1 - {( 10
0 ) 0.510 +( 10
1 ) 0.510 +( 10
2 ) 0.510
}
P bin(10, 0.5) ≥ 3 = 1 – (0.000977 + 0.00977 + 0.04395) = 0.9453 thus, there is
absolutely no evidence against H0. Therefore, the median survival time is 200 weeks.
Question 5
(i) The hypothesis are as follows:
H0: The mean uric acid for normal individuals is the same as the mean uric
acid for individuals with Down’s syndrome.
Question 3
(i) H0: The treatments have no effect on the probability of relapse
Ha: The treatments have an effect to the probability of relapse
(ii) Relapse give desipramine = 59
95 x 18=8 people
(iii) The X-squared = 8.22 is less than X-squared under H0 = 117.6 thus we
fail to reject the null hypothesis and conclude that the treatments do not
have an effect on the probability of relapse.
Question 4
Sign test with hypothesis:
H0: +/- are exchangeable
Ha: +/- are not exchangeable
Test statistic r = number of positive signs = 3
If H0 (+/− are exchangeable) is true, then r ∼ bin(n, 0.5):
p - value = P bin(10, 0.5) ≥ 3 =
P bin(10, 0.5) ≥ 3 = 1 - P bin(10, 0.5) < 3
P bin(10, 0.5) ≥ 3 = 1 - {( 10
0 ) 0.510 +( 10
1 ) 0.510 +( 10
2 ) 0.510
}
P bin(10, 0.5) ≥ 3 = 1 – (0.000977 + 0.00977 + 0.04395) = 0.9453 thus, there is
absolutely no evidence against H0. Therefore, the median survival time is 200 weeks.
Question 5
(i) The hypothesis are as follows:
H0: The mean uric acid for normal individuals is the same as the mean uric
acid for individuals with Down’s syndrome.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Surname 5
Ha: The mean uric acid for normal individuals is different to the mean uric
acid for individuals with Down’s syndrome.
(ii) Two sample independent t-test with the following assumptions:
(a) The two samples are normally distributed
(b) They variances are equal
(iii) H0: μ1−μ2=0
Ha: μ1−μ2 ≠ 0
Where: μ1−¿mean uric acid for normal individuals.
μ1−¿ mean uric acid for individuals with Down’s syndrome.
(iv) The test statistic is calculated as:
t= x1−x2
√ s2
( 1
n1
+ 1
n2 )
Where x1 and x2 are the sample means, s² is the pooled sample variance,
n1 and n2 are the sample sizes and t is the Student t quantile with n1 + n2 - 2
degrees of freedom.
(v) The distribution is t (Student t distribution) with n1 + n2 - 2 degrees of
freedom.
(vi) The first step is to test for normality using the following code:
Shapiro <- c(shapiro.test(Normal), shapiro.test(Downs.Syndrome));Shapiro
The hypothesis for Shapiro are:
H0: Normally distributed
Ha: Non- normal data
The W = 0.9908 with P-value = 0.9997 and W = 0.9778 with P-value = 0.9735
for Normal and Down’s syndrome individuals respectively. Since, both the p-
Ha: The mean uric acid for normal individuals is different to the mean uric
acid for individuals with Down’s syndrome.
(ii) Two sample independent t-test with the following assumptions:
(a) The two samples are normally distributed
(b) They variances are equal
(iii) H0: μ1−μ2=0
Ha: μ1−μ2 ≠ 0
Where: μ1−¿mean uric acid for normal individuals.
μ1−¿ mean uric acid for individuals with Down’s syndrome.
(iv) The test statistic is calculated as:
t= x1−x2
√ s2
( 1
n1
+ 1
n2 )
Where x1 and x2 are the sample means, s² is the pooled sample variance,
n1 and n2 are the sample sizes and t is the Student t quantile with n1 + n2 - 2
degrees of freedom.
(v) The distribution is t (Student t distribution) with n1 + n2 - 2 degrees of
freedom.
(vi) The first step is to test for normality using the following code:
Shapiro <- c(shapiro.test(Normal), shapiro.test(Downs.Syndrome));Shapiro
The hypothesis for Shapiro are:
H0: Normally distributed
Ha: Non- normal data
The W = 0.9908 with P-value = 0.9997 and W = 0.9778 with P-value = 0.9735
for Normal and Down’s syndrome individuals respectively. Since, both the p-
Surname 6
values are greater than 0.05 we fail to reject the null hypothesis and conclude
that the data is normally distributed. Therefore, we perform the two- sample t-
test as follows:
t.test(Normal, Downs.Syndrome, alternative = "two.sided", var.equal = TRUE,
conf.level = 0.95)
Two Sample t-test
data: Normal and Downs.Syndrome
t = -3.206, df = 25, p-value = 0.003662
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-2.3273433 -0.5067233
sample estimates:
mean of x mean of y
3.209467 4.626500
(vii) Since the p-value = 0.003662 is less than α = 0.05 we reject null hypothesis at
955 significance level and conclude that there is sufficient evidence to suggest
that the mean uric acid in normal and individuals with Down’s syndrome are
different.
(viii) The 95% confidence interval indicate that the population mean difference in
the uric acid between the normal and individuals with Downs syndrome is
between -2.3273433 and -0.5067233 level (mg/100ml).
(ix) The 99% confidence interval is between -2.6490718 and -0.1849949 level
(mg/100ml). The level is narrower than the one for 95%. The 99% gives small
room for error.
Question 6
values are greater than 0.05 we fail to reject the null hypothesis and conclude
that the data is normally distributed. Therefore, we perform the two- sample t-
test as follows:
t.test(Normal, Downs.Syndrome, alternative = "two.sided", var.equal = TRUE,
conf.level = 0.95)
Two Sample t-test
data: Normal and Downs.Syndrome
t = -3.206, df = 25, p-value = 0.003662
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-2.3273433 -0.5067233
sample estimates:
mean of x mean of y
3.209467 4.626500
(vii) Since the p-value = 0.003662 is less than α = 0.05 we reject null hypothesis at
955 significance level and conclude that there is sufficient evidence to suggest
that the mean uric acid in normal and individuals with Down’s syndrome are
different.
(viii) The 95% confidence interval indicate that the population mean difference in
the uric acid between the normal and individuals with Downs syndrome is
between -2.3273433 and -0.5067233 level (mg/100ml).
(ix) The 99% confidence interval is between -2.6490718 and -0.1849949 level
(mg/100ml). The level is narrower than the one for 95%. The 99% gives small
room for error.
Question 6
Surname 7
(i) The R-Output
(a) H0: The number of defects in a plate are the same
Ha: The number of defects in a plate are not the same
(b) The test statistics is:
χ2=∑ ( O−E )2
E
Where: O- observed frequencies, E- expected frequencies (Agresti 38).
χα ,(k−1)
2 = χ 0.05 ,(4)
2 =9.488
Where: k – 1 degrees of freedom, and k = 5
(c) Since X-squared = 6.4925 is less than χ0.05 ,(4 )
2 =9.488 we fail to reject the
null hypothesis at 95% significance level and conclude that the number of
defects in each plate is statistically the same.
(ii) Giving reasons
(a) The chi-square test is an approximation thus the result might suffer from
errors of estimation.
(b) Use the following R-code:
M <- as.table(rbind(c(0, 1, 2, 3), c(61, 24, 10, 5)))
Xsq = chisq.test(M)
The observed frequency
Xsq$observed
The expected frequencies
Xsq$expected
The tests statistics
Xsq$statistic
Xsq$statistic
(i) The R-Output
(a) H0: The number of defects in a plate are the same
Ha: The number of defects in a plate are not the same
(b) The test statistics is:
χ2=∑ ( O−E )2
E
Where: O- observed frequencies, E- expected frequencies (Agresti 38).
χα ,(k−1)
2 = χ 0.05 ,(4)
2 =9.488
Where: k – 1 degrees of freedom, and k = 5
(c) Since X-squared = 6.4925 is less than χ0.05 ,(4 )
2 =9.488 we fail to reject the
null hypothesis at 95% significance level and conclude that the number of
defects in each plate is statistically the same.
(ii) Giving reasons
(a) The chi-square test is an approximation thus the result might suffer from
errors of estimation.
(b) Use the following R-code:
M <- as.table(rbind(c(0, 1, 2, 3), c(61, 24, 10, 5)))
Xsq = chisq.test(M)
The observed frequency
Xsq$observed
The expected frequencies
Xsq$expected
The tests statistics
Xsq$statistic
Xsq$statistic
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Surname 8
(c) X – squared = 21.69879 with corresponding p-value = 7.535477e-05 less
than α = 0.05 thus reject null hypothesis and conclude that the number of
defects in the plates are independent.
(iii) output
(a) d= s2
x
Where: s2 – the sample variance, and x – the sample mean.
(b) The distribution is Chi-square with n – 1 degrees of freedom
d = 133.33 with P-value = 0.01221783 less than α = 0.05 thus reject null
hypothesis and conclude that the number of defects in the plates are
independent.
(c) Since, P-value = 0.01221783 less than α = 0.05 thus reject null
hypothesis and conclude that the number of defects in the plates are
independent.
(c) X – squared = 21.69879 with corresponding p-value = 7.535477e-05 less
than α = 0.05 thus reject null hypothesis and conclude that the number of
defects in the plates are independent.
(iii) output
(a) d= s2
x
Where: s2 – the sample variance, and x – the sample mean.
(b) The distribution is Chi-square with n – 1 degrees of freedom
d = 133.33 with P-value = 0.01221783 less than α = 0.05 thus reject null
hypothesis and conclude that the number of defects in the plates are
independent.
(c) Since, P-value = 0.01221783 less than α = 0.05 thus reject null
hypothesis and conclude that the number of defects in the plates are
independent.
Surname 9
Work Cited
Agresti, Alan. An introduction to categorical data analysis. Wiley, 2018.
Work Cited
Agresti, Alan. An introduction to categorical data analysis. Wiley, 2018.
1 out of 9
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.