The average yearly life expectancy

 

1
Question 1 (50 pts)
In the object life_exp, you are given average yearly life expectancy values from five continents. You will use
this data for the following sub-questions. You should paste your codes that generated your anser for all of
the sub-questions.
a (5 pts)
What are the maximum and minimum values of the variable year? Or in other words what are the first and
the last years that we have the life expectancy data from.
b (15 pts)
Which continent has the most drastic change of life expectancy overall? Take the minimum and the maximum
of each continent and check which continent has the most stark increase in life expectancy.
c (15 pts)
Does the life expectancy always increase through the years for all continents? Is the difference between n th
and the n-1 th year always positive for all continents? You should do this separately for all five continents,
and check if there are negative elements in the resulting “difference” vectors. (2nd-1st year, 3rd-2nd year, . . .
etc.)
Hint: you can use the diff() function to find the differences between consecutive elements in a vector.
If there is such a continent, find and write in which year this drop(s) in life expectancy occur (e.g. “Americas,
1951” would mean that 1951 had lower life expectancy than 1950 for Americas)
2
d (15 pts)
1950 1960 1970 1980 1990 2000 2010
40 50 60 70 80
Etka’s plot
Year
Average Life Expectancy
Africa Americas Asia Europe Oceania
Try to reproduce the above plot. The colors, line styling, point styling don’t need to match the shown plot
exactly. It is important that you have different colors for each continent though. The plot was drawn with y
axis spanning from 35 to 80 and the x axis spanning the 1950-2010 range. Your plot should match that. X
and Y axis labels should also match. You should have your name in the plots title (Like I do with “Etka’s
plot” below.) The colors I used for my plot are c(1,2,3,4,6). You can specify numbers instead of color
names in plotting functions that have a col= argument, that’s why it works.
Hint: you can use the matplot() function to plot different columns in matrix on the same plot. You can
specify one specific column to be the constant x= value and a range of other columns to be the y= values
(corresponding different lines). You can use the type=’b’ argument if you want a line graph with dots
included like the below plot.
Bonus (5 pts): If you can include a legend in your plot you will get bonus points. Again it doesn’t need to
be exactly the same with my legend, but it should correctly represent what is in the plot, like my legend does
(Line colors in the plot and the ones in the legend are correct). The position, size, or the horizontal/vertical
placement of legend elements does not matter (Its okay if the legend blocks data points in the plot).
3
Question 2 (30 pts)
Head circumference of newborn babies is normally distributed with mean of 34.71 centimeters and with
standard deviation of 1.27 centimeters.
a (10 pts)
What is the probability of a baby being born with a head that measures 37 centimeters or larger in
circumference?
b (10 pts)
A total of 11 babies was born in one hour, in one of the big hospitals. Among this sample of 11 babies, what
is probability that all of them have head circumference of 33 or less?
c (10 pts)
Among the same sample of 11 babies, what is the probability that they have a mean head circumference of
33.81 cm or lower?
Question 3 (20 pts)
Assume that the frequency of neonatal hepatitis (yenidogan sariligi in turkish) is 1/2500 among the turkish
population.
a (10 pts)
Among 50 babies born in a week in a private hospital, there were 3 with neonatal hepatitis. What is the
probability of seeing such 50 babies given the incidence of this condition?
b (10 pts)
What is the expected value (average) of sick babies within a sample of 50 babies? The resulting number does
not have to be an integer, nor it has to make sense in a real world scenario.
4

 

This question has been answered.

Get Answer