Description Usage Arguments Value Functions Examples
This function returns whether to stop the trial.
Stopping rule based precision of the MTD estimation.
The trial is stopped, when the MTD can be estimated with sufficient precision.
The criteria is based on the robust coefficient of variation (CV) calculated
from the posterior distribution.
The robust CV is defined mad(MTD) / median(MTD)
, where mad
is the median
absolute deviation.
Stopping based based on the lowest non placebo dose. The trial is stopped when the lowest non placebo dose meets the Hard Safety Rule, i.e. it is deemed to be overly toxic. Stopping is based on the observed data at the lowest dose level using a Bin-Beta model based on DLT probability.
Stopping based based on the lowest dose meeting the hard safety criteria using Bin-Beta model based DLT probability.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingList,ANY,ANY,ANY,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingAll,ANY,ANY,ANY,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingAny,ANY,ANY,ANY,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingCohortsNearDose,numeric,ANY,ANY,Data'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingPatientsNearDose,numeric,ANY,ANY,Data'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingMinCohorts,ANY,ANY,ANY,Data'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingMinPatients,ANY,ANY,ANY,Data'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingTargetProb,numeric,Samples,Model,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingMTDdistribution,numeric,Samples,Model,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingMTDCV,numeric,Samples,Model,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingLowestDoseHSRBeta,numeric,Samples,ANY,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature
## 'StoppingTargetBiomarker,numeric,Samples,DualEndpoint,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingHighestDose,numeric,ANY,ANY,Data'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingTDCIRatio,ANY,Samples,ModelTox,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingTDCIRatio,ANY,missing,ModelTox,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingGstarCIRatio,ANY,Samples,ModelTox,DataDual'
stopTrial(
stopping,
dose,
samples,
model,
data,
TDderive,
Effmodel,
Effsamples,
Gstarderive,
...
)
## S4 method for signature 'StoppingGstarCIRatio,ANY,missing,ModelTox,DataDual'
stopTrial(stopping, dose, model, data, Effmodel, ...)
## S4 method for signature 'StoppingLowestDoseHSRBeta_DK,numeric,ANY,ANY,Data'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature
## 'StoppingTargetProbPatientsNearHighestDose,numeric,Samples,Model,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature
## 'StoppingTargetProbPatientsNearLowestDose,numeric,Samples,Model,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingLowestDoseHSRBeta,numeric,Samples,ANY,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingPatientsNearDoseBay,numeric,ANY,ANY,Data'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingHardFirst,numeric,Samples,ANY,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingHardFirstFix,numeric,Samples,ANY,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature
## 'StoppingMTDdistributionBay,numeric,Samples,Model,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingPatientsNearDose2,numeric,ANY,ANY,Data'
stopTrial(stopping, dose, samples, model, data, ...)
## S4 method for signature 'StoppingProbBay,numeric,Samples,Model,ANY'
stopTrial(stopping, dose, samples, model, data, ...)
|
stopping |
The rule, an object of class
|
dose |
the recommended next best dose |
samples |
the |
model |
The model input, an object of class |
data |
The data input, an object of class |
... |
additional arguments |
TDderive |
the function which derives from the input, a vector of the posterior samples called
|
Effmodel |
the efficacy model of |
Effsamples |
the efficacy samples of |
Gstarderive |
the function which derives from the input, a vector of the posterior Gstar (the dose
which gives the maximum gain value) samples
called |
logical value: TRUE
if the trial can be stopped, FALSE
otherwise. It should have an attribute message
which gives the reason
for the decision.
stopTrial,StoppingList,ANY,ANY,ANY,ANY-method
: Stop based on multiple stopping rules
stopTrial,StoppingAll,ANY,ANY,ANY,ANY-method
: Stop based on fulfillment of all multiple stopping
rules
stopTrial,StoppingAny,ANY,ANY,ANY,ANY-method
: Stop based on fulfillment of any stopping rule
stopTrial,StoppingCohortsNearDose,numeric,ANY,ANY,Data-method
: Stop based on number of cohorts near to next best dose
stopTrial,StoppingPatientsNearDose,numeric,ANY,ANY,Data-method
: Stop based on number of patients near to next best
dose
stopTrial,StoppingMinCohorts,ANY,ANY,ANY,Data-method
: Stop based on minimum number of cohorts
stopTrial,StoppingMinPatients,ANY,ANY,ANY,Data-method
: Stop based on minimum number of patients
stopTrial,StoppingTargetProb,numeric,Samples,Model,ANY-method
: Stop based on probability of target tox interval
stopTrial,StoppingMTDdistribution,numeric,Samples,Model,ANY-method
: Stop based on MTD distribution
stopTrial,StoppingTargetBiomarker,numeric,Samples,DualEndpoint,ANY-method
: Stop based on probability of targeting biomarker
stopTrial,StoppingHighestDose,numeric,ANY,ANY,Data-method
: Stop when the highest dose is reached
stopTrial,StoppingTDCIRatio,ANY,Samples,ModelTox,ANY-method
: Stop based on 'StoppingTDCIRatio' class when
reaching the target ratio of the upper to the lower 95% credibility
interval of the estimate (TDtargetEndOfTrial). This is a stopping rule which incorporate only
DLE responses and DLE samples are given
stopTrial,StoppingTDCIRatio,ANY,missing,ModelTox,ANY-method
: Stop based on 'StoppingTDCIRatio' class
when reaching the target ratio of the upper to the lower 95% credibility
interval of the estimate (TDtargetEndOfTrial). This is a stopping rule which incorporate only
DLE responses and no DLE samples are involved
stopTrial,StoppingGstarCIRatio,ANY,Samples,ModelTox,DataDual-method
: Stop based on reaching the target ratio of the upper to the lower 95% credibility
interval of the estimate (the minimum of Gstar and TDtargetEndOfTrial). This is a stopping rule which
incorporate DLE and efficacy responses and DLE and efficacy samples are also used.
stopTrial,StoppingGstarCIRatio,ANY,missing,ModelTox,DataDual-method
: Stop based on reaching the target ratio of the upper to the lower 95% credibility
interval of the estimate (the minimum of Gstar and TDtargetEndOfTrial). This is a stopping rule which
incorporate DLE and efficacy responses without DLE and efficacy samples involved.
stopTrial,StoppingLowestDoseHSRBeta_DK,numeric,ANY,ANY,Data-method
: Stop based on the lowest dose meeting the hard
safety criteria using Beta based DLT probability
stopTrial,StoppingTargetProbPatientsNearHighestDose,numeric,Samples,Model,ANY-method
: Stop based on probability of target tox interval and
number of patients near to the highest dose
stopTrial,StoppingTargetProbPatientsNearLowestDose,numeric,Samples,Model,ANY-method
: Stop based on probability of target tox interval and
number of patients near to the lowest dose
stopTrial,StoppingPatientsNearDoseBay,numeric,ANY,ANY,Data-method
: Stop based on number of patients near to next best
dose
stopTrial,StoppingHardFirst,numeric,Samples,ANY,ANY-method
: Stopping rule based on a hard stopping rule
This is a method that takes into account a hardstopping rule that is not
based on the model. The rule is triggered when the first dose is considered
to be toxic (above threshold prob) based on the observed data and an
uninformative Beta(1,1) prior (default).
stopTrial,StoppingHardFirstFix,numeric,Samples,ANY,ANY-method
: Stopping rule based on hard stopping rule
This method take into account the hardstopping rule, specified in the
protocol. I.e. in the protocol certain numbers for stopping are specified
(often not based on a posterior distribution)
stopTrial,StoppingMTDdistributionBay,numeric,Samples,Model,ANY-method
: Stopping rule based on posterior dist
stopTrial,StoppingPatientsNearDose2,numeric,ANY,ANY,Data-method
: Stop based on number of patients near to next best
dose. Identical behavior to the original rule StoppingPatientsNearDose
The only change is that additional text is putted, so that it can be
identified if the rule is triggered
stopTrial,StoppingProbBay,numeric,Samples,Model,ANY-method
: Stopping rule based on posterior probability
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 | ## Example of combining stopping rules with '&' and/or '|' operators
myStopping1 <- StoppingMinCohorts(nCohorts=3)
myStopping2 <- StoppingTargetProb(target=c(0.2, 0.35),
prob=0.5)
myStopping3 <- StoppingMinPatients(nPatients=20)
myStopping <- (myStopping1 & myStopping2) | myStopping3
# nolint start
# Create some data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rules
myStopping1 <- StoppingMinCohorts(nCohorts=3)
myStopping2 <- StoppingTargetProb(target=c(0.2, 0.35),
prob=0.5)
myStopping3 <- StoppingMinPatients(nPatients=20)
# Create a list of stopping rules (of class 'StoppingList') which will then be
# summarized (in this specific example) with the 'any' function, meaning that the study
# would be stopped if 'any' of the single stopping rules is TRUE.
mystopping <- StoppingList(stopList=c(myStopping1,myStopping2,myStopping3),
summary=any)
# Evaluate if to stop the Trial
stopTrial(stopping=myStopping, dose=doseRecommendation$value,
samples=samples, model=model, data=data)
# nolint end
# nolint start
# Create some data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rules
myStopping1 <- StoppingMinCohorts(nCohorts=3)
myStopping2 <- StoppingTargetProb(target=c(0.2, 0.35),
prob=0.5)
myStopping3 <- StoppingMinPatients(nPatients=20)
# Combine the stopping rules, obtaining (in this specific example) a list of stopping
# rules of class 'StoppingAll'
myStopping <- (myStopping1 | myStopping2) & myStopping3
# Evaluate if to stop the Trial
stopTrial(stopping=myStopping, dose=doseRecommendation$value,
samples=samples, model=model, data=data)
# nolint end
# nolint start
# Create some data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rules
myStopping1 <- StoppingMinCohorts(nCohorts=3)
myStopping2 <- StoppingTargetProb(target=c(0.2, 0.35),
prob=0.5)
myStopping3 <- StoppingMinPatients(nPatients=20)
# Combine the stopping rules, obtaining (in this specific example) a list of stopping
# rules of class 'StoppingAny'
myStopping <- (myStopping1 | myStopping2) | myStopping3
# Evaluate if to stop the Trial
stopTrial(stopping=myStopping, dose=doseRecommendation$value,
samples=samples, model=model, data=data)
# nolint end
# nolint start
# Create the data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if at least 3
# cohorts were already dosed within 1 +/- 0.2 of the next best dose
myStopping <- StoppingCohortsNearDose(nCohorts = 3,
percentage = 0.2)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
data=data)
# nolint end
# nolint start
# Create the data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if at least 9
# patients were already dosed within 1 +/- 0.2 of the next best dose
myStopping <- StoppingPatientsNearDose(nPatients = 9,
percentage = 0.2)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
data=data)
# nolint end
# nolint start
# Create the data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if at least 6
# cohorts were already dosed
myStopping <- StoppingMinCohorts(nCohorts = 6)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
data=data)
# nolint end
# nolint start
# Create the data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if at least 20
# patients were already dosed
myStopping <- StoppingMinPatients(nPatients = 20)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
data=data)
# nolint end
# nolint start
# Create the data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if there is at least
# 0.5 posterior probability that [0.2 =< Prob(DLT | next-best-dose) <= 0.35]
myStopping <- StoppingTargetProb(target=c(0.2, 0.35),
prob=0.5)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
samples=samples,
model=model,
data=data)
# nolint end
# nolint start
# Create the data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if there is at least
# 0.9 probability that MTD > 0.5*next_best_dose. Here MTD is defined as the dose for
# which prob(DLE)=0.33
myStopping <- StoppingMTDdistribution(target = 0.33,
thresh = 0.5,
prob = 0.9)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
samples=samples,
model=model,
data=data)
# nolint end
# Create the data.
my_data <- Data(
x = c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y = c(0, 0, 0, 0, 0, 0, 1, 0),
cohort = c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid = c(0.1, 0.5, 1.5, 3, 6, seq(from = 10, to = 80, by = 2))
)
# Initialize the CRM model used to model the data.
my_model <- LogisticLogNormal(
mean = c(-0.85, 1),
cov = matrix(c(1, -0.5, -0.5, 1), nrow = 2),
ref_dose = 56
)
# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(
burnin = 100, step = 2, samples = 2000, rng_kind = "Mersenne-Twister", rng_seed = 94
)
my_samples <- mcmc(my_data, my_model, my_options)
# Define the rule for dose increments and calculate the maximum dose allowed.
my_increments <- IncrementsRelative(intervals = c(0, 20), increments = c(1, 0.33))
next_max_dose <- maxDose(my_increments, data = my_data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'.
my_next_best <- NextBestNCRM(
target = c(0.2, 0.35),
overdose = c(0.35, 1),
maxOverdoseProb = 0.25
)
# Calculate the next best dose.
dose_recommendation <- nextBest(
my_next_best,
doselimit = next_max_dose,
samples = my_samples,
model = my_model,
data = my_data
)
# Define the stopping rule such that the study would be stopped if the
# the MTD can be estimated with sufficient precision, i.e. if robust coefficient
# of variation is below 40%.
my_stopping <- StoppingMTDCV(target = 0.3, thresh_cv = 40)
# Evaluate if to stop the trial.
stopTrial(
stopping = my_stopping,
dose = dose_recommendation$value,
samples = my_samples,
model = my_model,
data = my_data
)
# Create the data.
data <- Data(
x = c(0.1, 0.1, 0.1),
y = c(0, 0, 1),
cohort = c(1, 1, 1),
doseGrid = c(
0.1, 0.5, 1.5, 3, 6,
seq(from = 10, to = 80, by = 2)
),
ID = 1:3
)
# Initialize the CRM model used to model the data.
model <- LogisticLogNormal(
mean = c(-0.85, 1),
cov = matrix(c(1, -0.5, -0.5, 1), nrow = 2),
ref_dose = 56
)
# Set-up some MCMC parameters and generate samples from the posterior.
options <- McmcOptions(
burnin = 100,
step = 2,
samples = 2000
)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed.
my_increments <- IncrementsRelative(
intervals = c(0, 20),
increments = c(1, 0.33)
)
next_max_dose <- maxDose(my_increments, data = data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'.
my_next_best <- NextBestNCRM(
target = c(0.2, 0.35),
overdose = c(0.35, 1),
maxOverdoseProb = 0.25
)
# Calculate the next best dose.
dose_recommendation <- nextBest(my_next_best,
doselimit = next_max_dose,
samples = samples, model = model, data = data
)
# Define the stopping rule such that the study would be stopped if first dose
# is toxic based on a Beta posterior distribution with Beta(1,1) prior.
my_stopping <- StoppingLowestDoseHSRBeta(
target = 0.3,
prob = 0.9
)
# Evaluate if the trial will be stopped.
stopTrial(
stopping = my_stopping,
dose = dose_recommendation$value,
samples = samples,
model = model,
data = data
)
# Create the data
data <- DataDual(
x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10,
20, 20, 20, 40, 40, 40, 50, 50, 50),
y=c(0, 0, 0, 0, 0, 0, 1, 0,
0, 1, 1, 0, 0, 1, 0, 1, 1),
w=c(0.31, 0.42, 0.59, 0.45, 0.6, 0.7, 0.55, 0.6,
0.52, 0.54, 0.56, 0.43, 0.41, 0.39, 0.34, 0.38, 0.21),
doseGrid=c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the Dual-Endpoint model (in this case RW1)
model <- DualEndpointRW(mu = c(0, 1),
Sigma = matrix(c(1, 0, 0, 1), nrow=2),
sigma2betaW = 0.01,
sigma2W = c(a=0.1, b=0.1),
rho = c(a=1, b=1),
smooth = "RW1")
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=500)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# In this case target a dose achieving at least 0.9 of maximum biomarker level (efficacy)
# and with a probability below 0.25 that prob(DLT)>0.35 (safety)
myNextBest <- NextBestDualEndpoint(target=c(0.9, 1),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples,
model=model,
data=data)
# Define the stopping rule such that the study would be stopped if if there is at
# least 0.5 posterior probability that the biomarker (efficacy) is within the
# biomarker target range of [0.9, 1.0] (relative to the maximum for the biomarker).
myStopping <- StoppingTargetBiomarker(target = c(0.9, 1),
prob = 0.5)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
samples=samples,
model=model,
data=data)
# nolint start
# Create the data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10, 20, 20, 20, 40, 40, 40,
80, 80, 80),
y=c(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if there is at least
# 0.5 posterior probability that [0.2 =< Prob(DLT | next-best-dose) <= 0.35]
stopTarget <- StoppingTargetProb(target=c(0.2, 0.35),
prob=0.5)
## now use the StoppingHighestDose rule:
stopHigh <-
StoppingHighestDose() &
StoppingPatientsNearDose(nPatients=3, percentage=0) &
StoppingTargetProb(target=c(0, 0.2),
prob=0.5)
## and combine everything:
myStopping <- stopTarget | stopHigh
# Then evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
samples=samples,
model=model,
data=data)
# nolint end
##define the stopping rules based on the 'StoppingTDCIRatio' class
##Using only DLE responses with samples
## we need a data object with doses >= 1:
data<-Data(x=c(25,50,50,75,150,200,225,300),
y=c(0,0,0,0,1,1,1,1),
doseGrid=seq(from=25,to=300,by=25))
##model can be specified of 'Model' or 'ModelTox' class
##For example, the 'logisticIndepBeta' class model
model<-LogisticIndepBeta(binDLE=c(1.05,1.8),DLEweights=c(3,3),DLEdose=c(25,300),data=data)
##define MCMC options
##for illustration purpose we use 10 burn-in and generate 50 samples
options<-McmcOptions(burnin=10,step=2,samples=50)
##samples of 'Samples' class
samples<-mcmc(data,model,options)
##define the 'StoppingTDCIRatio' class
myStopping <- StoppingTDCIRatio(targetRatio=5,
targetEndOfTrial=0.3)
##Find the next Recommend dose using the nextBest method (plesae refer to nextbest examples)
tdNextBest<-NextBestTDsamples(targetDuringTrial=0.35,targetEndOfTrial=0.3,
derive=function(TDsamples){quantile(TDsamples,probs=0.3)})
RecommendDose<-nextBest(tdNextBest,doselimit=max(data@doseGrid),samples=samples,
model=model,data=data)
##use 'stopTrial' to determine if the rule has been fulfilled
##use 0.3 as the target proability of DLE at the end of the trial
stopTrial(stopping=myStopping,dose=RecommendDose$nextdose,
samples=samples,model=model,data=data)
## RecommendDose$nextdose refers to the next dose obtained in RecommendDose
##define the stopping rules based on the 'StoppingTDCIRatio' class
##Using only DLE responses
## we need a data object with doses >= 1:
data<-Data(x=c(25,50,50,75,150,200,225,300),
y=c(0,0,0,0,1,1,1,1),
doseGrid=seq(from=25,to=300,by=25))
##model must be of 'ModelTox' class
##For example, the 'logisticIndepBeta' class model
model<-LogisticIndepBeta(binDLE=c(1.05,1.8),DLEweights=c(3,3),DLEdose=c(25,300),data=data)
##define the 'StoppingTDCIRatio' class
myStopping <- StoppingTDCIRatio(targetRatio=5,
targetEndOfTrial=0.3)
##Find the next Recommend dose using the nextBest method (plesae refer to nextbest examples)
tdNextBest<-NextBestTD(targetDuringTrial=0.35,targetEndOfTrial=0.3)
RecommendDose<-nextBest(tdNextBest,doselimit=max(data@doseGrid),model=model,data=data)
##use 'stopTrial' to determine if the rule has been fulfilled
##use 0.3 as the target proability of DLE at the end of the trial
stopTrial(stopping=myStopping,dose=RecommendDose$nextdose,
model=model,data=data)
## RecommendDose$nextdose refers to the next dose obtained in RecommendDose
##define the stopping rules based on the 'StoppingGstarCIRatio' class
##Using both DLE and efficacy responses
## we need a data object with doses >= 1:
data <-DataDual(x=c(25,50,25,50,75,300,250,150),
y=c(0,0,0,0,0,1,1,0),
w=c(0.31,0.42,0.59,0.45,0.6,0.7,0.6,0.52),
doseGrid=seq(25,300,25),
placebo=FALSE)
##DLEmodel must be of 'ModelTox' class
##For example, the 'logisticIndepBeta' class model
DLEmodel<-LogisticIndepBeta(binDLE=c(1.05,1.8),DLEweights=c(3,3),DLEdose=c(25,300),data=data)
##Effmodel must be of 'ModelEff' class
##For example, the 'Effloglog' class model
Effmodel<-Effloglog(Eff=c(1.223,2.513),Effdose=c(25,300),nu=c(a=1,b=0.025),data=data,c=0)
##for illustration purpose we use 10 burn-in and generate 50 samples
options<-McmcOptions(burnin=10,step=2,samples=50)
##DLE and efficacy samples must be of 'Samples' class
DLEsamples<-mcmc(data,DLEmodel,options)
Effsamples<-mcmc(data,Effmodel,options)
##define the 'StoppingGstarCIRatio' class
myStopping <- StoppingGstarCIRatio(targetRatio=5,
targetEndOfTrial=0.3)
##Find the next Recommend dose using the nextBest method (plesae refer to nextbest examples)
mynextbest<-NextBestMaxGainSamples(DLEDuringTrialtarget=0.35,
DLEEndOfTrialtarget=0.3,
TDderive=function(TDsamples){
quantile(TDsamples,prob=0.3)},
Gstarderive=function(Gstarsamples){
quantile(Gstarsamples,prob=0.5)})
RecommendDose<-nextBest(mynextbest,doselimit=max(data@doseGrid),samples=DLEsamples,model=DLEmodel,
data=data,Effmodel=Effmodel,Effsamples=Effsamples)
##use 'stopTrial' to determine if the rule has been fulfilled
##use 0.3 as the target proability of DLE at the end of the trial
stopTrial(stopping=myStopping,
dose=RecommendDose$nextdose,
samples=DLEsamples,
model=DLEmodel,
data=data,
TDderive=function(TDsamples){
quantile(TDsamples,prob=0.3)},
Effmodel=Effmodel,
Effsamples=Effsamples,
Gstarderive=function(Gstarsamples){
quantile(Gstarsamples,prob=0.5)})
## RecommendDose$nextdose refers to the next dose obtained in RecommendDose
##define the stopping rules based on the 'StoppingGstarCIRatio' class
##Using both DLE and efficacy responses
## we need a data object with doses >= 1:
data <-DataDual(x=c(25,50,25,50,75,300,250,150),
y=c(0,0,0,0,0,1,1,0),
w=c(0.31,0.42,0.59,0.45,0.6,0.7,0.6,0.52),
doseGrid=seq(25,300,25),
placebo=FALSE)
##DLEmodel must be of 'ModelTox' class
##For example, the 'logisticIndepBeta' class model
DLEmodel<-LogisticIndepBeta(binDLE=c(1.05,1.8),DLEweights=c(3,3),DLEdose=c(25,300),data=data)
##Effmodel must be of 'ModelEff' class
##For example, the 'Effloglog' class model
Effmodel<-Effloglog(Eff=c(1.223,2.513),Effdose=c(25,300),nu=c(a=1,b=0.025),data=data,c=0)
##define the 'StoppingGstarCIRatio' class
myStopping <- StoppingGstarCIRatio(targetRatio=5,
targetEndOfTrial=0.3)
##Find the next Recommend dose using the nextBest method (plesae refer to nextbest examples)
mynextbest<-NextBestMaxGain(DLEDuringTrialtarget=0.35,DLEEndOfTrialtarget=0.3)
RecommendDose<-nextBest(mynextbest,doselimit=max(data@doseGrid),model=DLEmodel,
Effmodel=Effmodel,data=data)
##use 'stopTrial' to determine if the rule has been fulfilled
##use 0.3 as the target proability of DLE at the end of the trial
stopTrial(stopping=myStopping,dose=RecommendDose$nextdose,model=DLEmodel,
data=data, Effmodel=Effmodel)
## RecommendDose$nextdose refers to the next dose obtained in RecommendDose
# Create the data
data <- Data(x=c(0.1, 0.1, 0.1),
y=c(0, 0, 1),
cohort=c(1, 1, 1),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
refDose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if first dose
# is toxic based on a Beta posterior distribution with Beta(1,1) prior
myStopping <- StoppingLowestDoseHSRBeta(target = 0.3,
prob = 0.9)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
samples=samples,
model=model,
data=data)
# nolint start
# Create the data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if at least 9
# patients were already dosed within 1 +/- 0.2 of the next best dose
myStopping <- StoppingPatientsNearDose(nPatients = 9,
percentage = 0.2)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
data=data)
# nolint end
# nolint start
# Create the data
data <- Data(x=c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y=c(0, 0, 0, 0, 0, 0, 1, 0),
cohort=c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid=
c(0.1, 0.5, 1.5, 3, 6,
seq(from=10, to=80, by=2)))
# Initialize the CRM model used to model the data
model <- LogisticLogNormal(mean=c(-0.85, 1),
cov=
matrix(c(1, -0.5, -0.5, 1),
nrow=2),
ref_dose=56)
# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin=100,
step=2,
samples=2000)
set.seed(94)
samples <- mcmc(data, model, options)
# Define the rule for dose increments and calculate the maximum dose allowed
myIncrements <- IncrementsRelative(intervals=c(0, 20),
increments=c(1, 0.33))
nextMaxDose <- maxDose(myIncrements,
data=data)
# Define the rule which will be used to select the next best dose
# based on the class 'NextBestNCRM'
myNextBest <- NextBestNCRM(target=c(0.2, 0.35),
overdose=c(0.35, 1),
maxOverdoseProb=0.25)
# Calculate the next best dose
doseRecommendation <- nextBest(myNextBest,
doselimit=nextMaxDose,
samples=samples, model=model, data=data)
# Define the stopping rule such that the study would be stopped if at least 9
# patients were already dosed within 1 +/- 0.2 of the next best dose
myStopping <- StoppingPatientsNearDose(nPatients = 9,
percentage = 0.2)
# Evaluate if to stop the trial
stopTrial(stopping=myStopping,
dose=doseRecommendation$value,
data=data)
# nolint end
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.