Hi,
how to compute the gini index use Desctools or other packages in R? I could only complete one column that not have na. Take the “col1”,“col2”, “col3” for example. Thank you in advance.
c1<-c(16.6,1.0,10.1,8.6,8.0,17.0,2.4,7.6,5.7,11.6,3.6,2.8,6.3,1.5,2.7,7.4,6.2,2.5,6.0,5.5,2.0,6.7,5.6,3.5,10.4,6.8,3.5,NA,NA)
c2<-c(9.3,10.6,1.3,2.8,5.8,NA,9.4,2.5,3.2,7.3,12.5,18.4,15.0,11.8,13.7,10.2,9.5,7.6,2.5,13.6,4.8,3.6,3.2,10.2,17.7,6.8,3.5,18.9,NA)
c3<-c(5.6,5.8,13.3,13.8,3.0,10.1,10.7,7.7,12.3,15.8,3.5,12.7,4.2,8.1,13.6,19.8,14.3,16.8,9.9,6.6,8.9,10.8,13.1,12.1,5.9,10.1,11.2,18.8,11.0)
c4<-c(1:29)
c5<-data.frame(c4,c1,c3,c2)
colnames(c5)<-c("id","col1","col2","col3")
Created on 2022-10-31 with reprex v2.0.2