Skip to content
Prev 359727 / 398503 Next

Compute the Gini coefficient

Hello,

Thank you very much for your help. 

How can I draw a Lorenz curve with several replications ?

Here is an example with 4 replications:

hosts=c(23,31,19,10,7,7,3,
        39,40,8,3,6,2,2,
        47,17,8,10,6,11,1,
        30,30,10,0,15,15,0)
parasites=rep(seq(from=0,to=6,by=1),4)
replications=c(rep(1,7),rep(2,7),rep(3,7),rep(4,7))
test <- cbind(parasites,hosts,replications)

Should I calculate the average frequency of hosts (replication mean values) and next calculate the cumulative percentage of hosts from the average frequency ? 

Thank you very much for your time.
Have a nice day.
Marine 
________________________________________
De : Achim Zeileis <Achim.Zeileis at uibk.ac.at>
Envoy? : mercredi 30 mars 2016 12:05
? : Erich Neuwirth
Cc : Marine Regis; r-help at r-project.org
Objet : Re: [R] Compute the Gini coefficient
On Wed, 30 Mar 2016, Erich Neuwirth wrote:

            
That's what I thought as well but Marine explicitly said that the 'host'
are _not_ weights. Hence I was confused what this would actually mean.

Using the "ineq" package you can also do
plot(Lc(parasites, hosts))
Message-ID: <AMSPR07MB470DF18CE58731BA7275FD6E2990@AMSPR07MB470.eurprd07.prod.outlook.com>
In-Reply-To: <alpine.DEB.2.20.1603301203320.6554@paninaro>