Re: [R] Speed up studentized confidence intervals ?

2022-01-03 Thread varin sacha via R-help
Dear John, Dear Rui, I really thank you a lot for your R code. Best, SV Le jeudi 30 décembre 2021, 05:25:11 UTC+1, Fox, John a écrit : Dear varin sacha, You didn't correctly adapt the code to the median. The outer call to mean() in the last line shouldn't be replaced with median()

Re: [R] Speed up studentized confidence intervals ?

2021-12-29 Thread Fox, John
Dear varin sacha, You didn't correctly adapt the code to the median. The outer call to mean() in the last line shouldn't be replaced with median() -- it computes the proportion of intervals that include the population median. As well, you can't rely on the asymptotics of the bootstrap for a

Re: [R] Speed up studentized confidence intervals ?

2021-12-29 Thread David Winsemius
On 12/29/21 11:08 AM, varin sacha via R-help wrote: Dear David, Dear Rui, Many thanks for your response. It perfectly works for the mean. Now I have a problem with my R code for the median. Because I always get 1 (100%) coverage probability that is more than very strange. Indeed,

Re: [R] Speed up studentized confidence intervals ?

2021-12-29 Thread varin sacha via R-help
Dear David, Dear Rui, Many thanks for your response. It perfectly works for the mean. Now I have a problem with my R code for the median. Because I always get 1 (100%) coverage probability that is more than very strange. Indeed, considering that an interval whose lower limit is the smallest

Re: [R] Speed up studentized confidence intervals ?

2021-12-23 Thread Rui Barradas
Hello, The code is running very slowly because you are recreating the function in the replicate() loop and because you are creating a data.frame also in the loop. And because in the bootstrap statistic function med() you are computing the variance of yet another loop. This is probably

Re: [R] Speed up studentized confidence intervals ?

2021-12-22 Thread David Winsemius
I’m wondering if this is an X-Y problem. (A request to do X when the real problem should be doing Y. ) You haven’t explained the goals in natural or mathematical language which is leaving me to wonder why you are doing either sampling or replication (much less doing both within each iteration

[R] Speed up studentized confidence intervals ?

2021-12-19 Thread varin sacha via R-help
Dear R-experts, Here below my R code working but really really slowly ! I need 2 hours with my computer to finally get an answer ! Is there a way to improve my R code to speed it up ? At least to win 1 hour ;=) Many thanks library(boot)