The overall achievement vector of a person/household is designated by x=(x_1 \cdots x_n)
. To demonstrate, imagine that there are five persons in a society with over all income $25
, $18
, $15
, $33
, $31
. In this case x=(25, 18, 15, 33, 31)
is a vector indicating the income of the society.
As can be seen, ordering/ranking the overall achievement vector; in other words, ranking/ordering individuals or households by their achievements yields (15, 18, 25, 31, 33)
.
The aim here is to plot the cumulative distribution function for X
? It is an excerpt my research Thesis – a Welfare Analysis approach in the Multidimensional Poverty Analysis domains!
\begin{axis}[
clip=false,
jump mark left,
ymin=0,ymax=1,
xmin=0, xmax=6,
every axis plot/.style={very thick},
discontinuous,
table/create on use/cumulative distribution/.style={
create col/expr={\pgfmathaccuma + \thisrow{f(x)}}
}
]
\addplot [red] table [y=cumulative distribution]{
P(x) f(x)
<15 0
15 1/5
18 2/5
25 3/5
31 4/5
33 1
};
\end{axis}
Best Answer
I have adjusted the following things to obtain the result below:
The code for the key
discontinuous
is copied from here.The x and y ranges didn't fit; I adjusted them to
Currently the first column is taken as the x values, hence "<15" doesn't work. I replaced it by 14, the smallest value of the range.
I added the upper bound of the x range (35) to the table, such that the last accumulated value is also drawn.