Assignment 2
Please use programming to solve the following problems!
Please attach your code and the corresponding output!
1. A hospital surveyed women who had received inadequate prenatal care. The selected mothers were divided into two groups X and Y: mothers having no more than five prenatal visits and at least six prenatal visits. The collected birth weights (in ounces) of the babies from these two sets of mothers are given below
X |
49 |
108 |
110 |
82 |
93 |
114 |
134 |
114 |
96 |
52 |
101 |
114 |
120 |
116 |
|
100 |
89 |
108 |
112 |
105 |
107 |
95 |
|
Y |
133 |
108 |
93 |
119 |
119 |
98 |
106 |
131 |
87 |
153 |
116 |
129 |
97 |
110 |
|
121 |
136 |
115 |
126 |
125 |
126 |
120 |
(a) Assume that population X is normally distributed, answer the following questions
i. Construct a 95% confidence interval for the population mean μ .
ii. Use significance level of 0.05 to carry out a hypothesis test to show that the population standard deviation is greater than 10.
(b) Assume that both populations X and Y are normally distributed, answer the following questions
i. Use significance level of 0.05 to carry out a hypothesis test on whether two population variances are equal.
ii. Based on the previous result, construct a 95% confidence interval on the difference between two population means and comment on it
(c) Use significance level of 0.05 to test whether the median of population X is 100. [Hint: use signrank function in Matlab].
(d) Use significance level of 0.05 to test whether two populations have same medians. [Hint: use ranksum function in Matlab].
(42 marks)
2. In order to know hours spent on assignments per week, 20 students from 4 programmes are randomly selected in a University. The corresponding data is given in the table below.
Programme |
|
Hours |
|
A |
2.8 |
3.2 3.5 4.0 |
3.6 |
B |
3.2 |
2.9 3.6 4.5 |
4.8 |
C |
2.5 |
3.2 3.5 4.1 |
3.9 |
D |
4.6 |
4.2 3.9 5.8 |
5.2 |
Assume that all populations are normally distributed with equal variances. Answer the following questions.
(a) Construct a one-way analysis table and comment on it. Test with α = 5%.
(b) Perform Bonferroni method to determine which pairs of subjects differ in their means. Test with α = 5% and use Matlab to get tα if necessary.
(16 marks)
3. A social researcher survives 50 people whose incomes range from 15k to 80k and ask them to rank their happiness on a scale from 1 to 10. Use data in txt to answer the following questions. In this dataset, income is recorded in 10k.
(a) Draw a scatter plot and comment on it. [Hint: use scatter function in Matlab].
(b) Estimate the regression line μY | x = β0 +β1 x. Do you think happiness is significantly related to income? Explain your reason.
(c) Report the R2 and comment on it.
(d) Check the normality of residuals.
(e) Estimate the mean value of happiness when income is equal to 7, and construct a 95% two-sided confi- dence interval for it.
(f) Construct a 95% two-sided prediction interval for happiness when income is equal to 7.
(42 marks)
Reviews
There are no reviews yet.