[R] bootstrapping statistics from leaken package

Bert Gunter bgunter.4567 at gmail.com
Thu Dec 31 18:27:13 CET 2015


Try

d= data[ ,i]

instead of d= data[i]

in your function. If that doesn't help, I think we would have to know
more about the structure of your data.

-- Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Dec 31, 2015 at 7:28 AM, Benedetto Rocchi
<benedetto.rocchi at unifi.it> wrote:
> 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]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list