Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
STATISTICAL ANALYSIS
Assignment #2
a-
b- We can simply plot the two bar charts with each bar chart representing one election where the y-
axes are identical in both the plots. But, if we want to compare the election results in one graph then
the best solution to compare between two different results of the election in different dates, is by
applying the difference between the percentage of each political party in the election.
Difference in results between the 2014 and 2009 elections
Exercise2:
a- It’s clear that the scale of X is continuous.
b-the table bellow contains all the important information that may help us in our
exercise specially to find the histogram
j [ej-1,ej) nj fj dj hj F(x)
c-
f-We can use the function “plot.ecdf” which give us easily a plot of ECDF of the original data
Exercise 3:
a-
Score 1 2 3 4 5 6 7 8 9 10
Results 1 3 8 8 27 30 11 6 4 2
fj 1/100 3/100 8/100 8/100 27/100 30/100 11/100 6/100 4/100 2/100
In R:
b-from our table and thanks to our course’s formula we have:
c-the ECDF for the grouped data goes from (0, 0) to (1, 1)
d-it’s clear that we have a huge difference between (b) and (c) because of the different formula
applied in each case ;in (c) we assumed that the values are uniformly distributed in each category
(each value occurs as often as each other value).But thanks to question (a) we know that there are
more values towards the central score numbers. So, we can conclude that the assumption(c) is
inappropriate.
Exercise4:
a-
b- after installing trdyverse package (install.packages("tidyverse") ) which contain ggplot2 we
can use it
c-
d-