> # Input Data > surved.households <- c(39, 179, 107, 56, 32, 22, 11, 15, 38) > percentage.household<-surved.households*100/sum(surved.households) > income <- c(56126.36, 290124.32, 281048.35, 225586.54, 162442.64, 115243.11, 64389.11, 136743.99, 784834.07) > average.per.capita.income<-income/surved.households > expenditure <- (21266.13, 254711.65, 281124.15, 188828.04, 137942.38, 135931.97, 98167.24, 125930.71, 697523.22) > average.per.capita.expenditure<-expenditure/surved.households > # Format the Data in a Matrix form > m<-cbind(surved.households,income) > row.names <-c("<1000", "1000-2000", "2001-3000", "3001-4000", "4001-5000", "5001-6000", "6001-7000", "7001-8000", "8000+") > dimnames(m)<- list(row.names,c("surved.households","income")) > # Write the formula > x <- average.per.capita.income > parameter <- 3.00 > atkinson <- ( 1 - mean( (x/mean(x))^(1 - parameter) )^(1/(1 - parameter)) ) > atknsn1 <- ( 1 - (exp(mean(log(x)))/mean(x)) ) # For parameter = 1 only the formula changes > # Or we could use "the ineq Package" of Achim Zeileis as the following sequence > # 1. Download ineq_0.2-1.ZIP (not the source ineq_0.2-1.TAR file) from http://cran.r-project.org/bin/windows/contrib/ > # 2. Open R 1.3.1 , install it as - Packages> Install Package From Local Zip File > # 3. Load it as - Packages> Load Package> ineq > OK > # And then command as follows: > Atkinson(x, parameter = 3.00) > Atkinson(x, parameter = 1) Note: These commands of R Console was documented in 9:53 AM 12/13/2003 by Mohammad Ehsanul Karim, Institute of Statistical Research and Training, Dhaka - 1000, Bangladesh.