Lack of ISR / only 5% ISR in study with 656 samples [Regulatives / Guidelines]
❝ Next do this:
❝ for (i in 1:sims) {
❝ xboot = sample(data, replace=T)
❝ y <- length(xboot[abs(xboot)>20]) # No. of abs. deviations > 20%
❝ y <- y/ISR.no # Fraction of repeats with > 20% deviation
❝ if (y > 1/3) failed <- failed + 1
❝ }
❝ cat(sprintf("%i",sims),"simulated studies with", size, "samples:\n",
❝ "Method: Bootstrapping (Mersenne-Twister) of ISR data\n",
❝ "Failed criterion (deviations >20% in >1/3 of repeats) seen in",
❝ sprintf("%.2f%% %s", 100*failed, "of studies.\n"))
Wanted to perform some kind of sensitivity analysis to see at which criterion studies start to fail. With 1/8 of samples deviating more than 20% I get 200% study failure, due to simply multiplying number of failed studies by 100 in the output, but should be divided by number of studies simulated, I guess. The code above works only as long as 0 trials fail, i guess

Οὐδείς
Edit: Full quote removed. Please delete everything from the text of the original poster which is not necessary in understanding your answer; see also this post. [Helmut]
Of course, you are correct. The line should be:
sprintf("%.2f%% %s", 100*failed/sims, "of studies.\n"))
—
Kindest regards, nobody
Kindest regards, nobody
Complete thread:
- Incurred sample reanalysis sarada06884 2013-04-09 12:22 [Regulatives / Guidelines]
- Incurred sample reanalysis Ohlbe 2013-04-09 14:09
- Incurred sample reanalysis The Outlaw Torn 2013-04-10 08:40
- Clopidogrel Ohlbe 2013-04-10 10:34
- Clopidogrel The Outlaw Torn 2013-04-10 11:31
- Lack of ISR / only 5% ISR in study with 656 samples Helmut 2013-04-22 17:01
- Lack of ISR / only 5% ISR in study with 656 samples ElMaestro 2013-04-22 18:56
- Lack of ISR / only 5% ISR in study with 656 samples Helmut 2013-04-22 19:35
- "Meth" - apologies ElMaestro 2013-04-22 20:03
- "Meth" - apologies The Outlaw Torn 2013-04-23 08:27
- "Meth" - apologies ElMaestro 2013-04-23 14:29
- "ISR" - apologies The Outlaw Torn 2013-04-24 07:44
- Repeat use ElMaestro 2013-04-24 11:08
- Repeat use Ohlbe 2013-04-24 11:41
- Repeat use ElMaestro 2013-04-24 13:45
- Repeat use Ohlbe 2013-04-24 11:41
- "ISR" – resolved Helmut 2013-09-20 21:50
- "ISR" – resolved Dr_Dan 2013-09-22 16:56
- Repeat use ElMaestro 2013-04-24 11:08
- "ISR" - apologies The Outlaw Torn 2013-04-24 07:44
- "Meth" - apologies ElMaestro 2013-04-23 14:29
- "Meth" - apologies The Outlaw Torn 2013-04-23 08:27
- "Meth" - apologies ElMaestro 2013-04-22 20:03
- Lack of ISR / only 5% ISR in study with 656 samples Helmut 2013-04-22 19:35
- Lack of ISR / only 5% ISR in study with 656 samples ElMaestro 2013-04-23 23:31
- Some more stuff Helmut 2013-04-24 02:08
- Lack of ISR / only 5% ISR in study with 656 samplesnobody 2014-10-23 10:06
- Lack of ISR / only 5% ISR in study with 656 samples ElMaestro 2013-04-22 18:56
- Lack of ISR / only 5% ISR in study with 656 samples Helmut 2013-04-22 17:01
- Clopidogrel The Outlaw Torn 2013-04-10 11:31
- Clopidogrel Ohlbe 2013-04-10 10:34
- Incurred sample reanalysis The Outlaw Torn 2013-04-10 08:40
- Incurred sample reanalysis Ohlbe 2013-04-09 14:09