The built-in ldeaths data set contains measurements giving the
monthly deaths from bronchitis, emphysema and asthma in the UK,
19741979, both sexes. We can easily access this data with the
assignment x <- as.vector(ldeaths). We can also get the data by
entering the values 1 by 1. (You would be wise to not do the 1 by 1
entry.) The following is a screen print of the data values:s:
[1] 3035 2552 2704 2554 2014 1655 1721 1524 1596 2074 2199 2512
2933 2889
[15] 2938 2497 1870 1726 1607 1545 1396 1787 2076 2837 2787 3891
3179 2011
[29] 1636 1580 1489 1300 1356 1653 2013 2823 3102 2294 2385 2444
1748 1554
[43] 1498 1361 1346 1564 1640 2293 2815 3137 2679 1969 1870 1633
1529 1366
[57] 1357 1570 1535 2491 3084 2605 2573 2143 1693 1504 1461 1354
1333 1492
[71] 1781 1915
Assume these values are a random sample from a normal population
with unknown mean μ and unknown standard deviation
σ.
Call the vector of observations x,using the assignment above, x
<- as.vector(deaths)
g) Calculate the interquartile range of x, using R.
h) Calculate the sample variance of 4.7x.
i) Calculate an unbiased estimate of the population variance,
σ2
using this data.
j) If we assume that the population has a normal distribution, then
calculate the maximum likelihood estimate of μ using this
data.
k) Using this data, create an 92% confidence interval for
μ, noting that the sample size is large enough so we can
use a normal distribution critical value zstar.(
,
)
(g) 1000
(h) 371911.8
(i) 377150
(j) 2056.625
(k) The 92% confidence interval for μ is between 1928.974 and 2184.27.
The R code is:
x <- c(3035, 2552, 2704, 2554, 2014, 1655, 1721, 1524, 1596,
2074, 2199, 2512, 2933, 2889,
2938, 2497, 1870, 1726, 1607, 1545, 1396, 1787, 2076, 2837, 2787,
3891, 3179, 2011,
1636, 1580, 1489, 1300, 1356, 1653, 2013, 2823, 3102, 2294, 2385,
2444, 1748, 1554,
1498, 1361, 1346, 1564, 1640, 2293, 2815, 3137, 2679, 1969, 1870,
1633, 1529, 1366,
1357, 1570, 1535, 2491, 3084, 2605, 2573, 2143, 1693, 1504, 1461,
1354, 1333, 1492,
1781, 1915)
summary(x)
iqr = 2552 - 1552
var(x)
var(x)*(72/71)
mean(x)
t.test(x, mu = 0, conf.level = 0.92, interval = "confidence")
Get Answers For Free
Most questions answered within 1 hours.