[R] bootstrapping statistics from leaken package

Benedetto Rocchi benedetto.rocchi at unifi.it
Thu Dec 31 16:28:44 CET 2015


I am trying to generate a confidence interval for the statistic arpt (at 
risk of poverty threshold generated with the package leaken) using the 
package boot.
This is my temptative script (where XH090 and DB030 and w are variables 
of an attached dataframe):
> arpt.boot <- function(data,i){
>   d = data[i]
>   arpt <- arpr(d, sort=DB030, p=c(0.4))
>   arpt <- as.vector(arpt)
>  }
> arpt40 <- boot(HX090,arpt.boot,R=1000,weights=w)
> boot.ci(arpt40, conf = 0.95, type = "norm")

R answer with the following error message:
> Error in boot(dati_mauro$HX090, arpt.boot, R = 1000, weights = 
> dati_mauro$w) : incorrect number of subscripts on matrix
Thank you in advance for any help in solving this problem.
Benedetto Rocchi

-- 
Dipartimento di Scienze per l'Economia e l'Impresa
Università degli Studi di Firenze
Via delle Pandette, 9 50127 Firenze
telefono 0552759706 cellulare 3204309360


	[[alternative HTML version deleted]]



More information about the R-help mailing list