Skip to content

Commit

Permalink
edited readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sidiwang committed Aug 18, 2024
1 parent 1bc967b commit 49e478a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 46 deletions.
4 changes: 3 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ An snSMART is a multi-stage trial design where for a two-stage design, randomiza

## Installation

You can install the package from CRAN:
Before using this package, please install the [JAGS library](https://sourceforge.net/projects/mcmc-jags/) on your device.

You can install the snSMART package from CRAN:
```{r}
install.packages("snSMART", repos = "http://cran.us.r-project.org")
library(snSMART)
Expand Down
92 changes: 47 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ across the two stages of the snSMART design to more precisely estimate
the effect of the treatments given in the first stage.

## Installation
Before using this package, please install the [JAGS library](https://sourceforge.net/projects/mcmc-jags/) on your device.

Before using this package, please install the [JAGS
library](https://sourceforge.net/projects/mcmc-jags/) on your device.

You can install the snSMART package from CRAN:

Expand All @@ -46,7 +48,7 @@ install.packages("snSMART", repos = "http://cran.us.r-project.org")

##
## The downloaded binary packages are in
## /var/folders/5_/sp2r7r_s5snf4hq634xmk_0r0000gn/T//RtmpNRlYCm/downloaded_packages
## /var/folders/5_/sp2r7r_s5snf4hq634xmk_0r0000gn/T//RtmpUxY3P4/downloaded_packages

``` r
library(snSMART)
Expand Down Expand Up @@ -108,33 +110,33 @@ summary(BJSM_result)
##
## Treatment Effects Estimate:
## Estimate Std. Error C.I. CI low CI high
## trtA 0.4046939 0.10427533 0.95 0.2103586 0.6583262
## trtB 0.3900296 0.07865828 0.95 0.2501780 0.5374523
## trtC 0.6180690 0.08709180 0.95 0.4925770 0.7772426
## trtA 0.3733798 0.1532599 0.95 0.1879501 0.7281596
## trtB 0.4185251 0.1646755 0.95 0.1377496 0.7658878
## trtC 0.6694094 0.1044533 0.95 0.4533836 0.8364925
##
## Differences between Treatments:
## Estimate Std.Error C.I. CI low CI high
## diffAB 0.01466433 0.1287876 0.95 -0.2202233 0.32554853
## diffBC -0.22803936 0.1271915 0.95 -0.5270646 -0.06082518
## diffAC -0.21337503 0.1493975 0.95 -0.4840569 0.04220399
## diffAB -0.04514528 0.2534023 0.95 -0.5669267 0.377003340
## diffBC -0.25088433 0.1648132 0.95 -0.5241105 0.093336459
## diffAC -0.29602961 0.1676356 0.95 -0.5361779 0.002146219
##
## Linkage Parameter Estimate:
## Estimate Std. Error C.I. CI low CI high
## beta0A 0.9595907 0.04719401 0.95 0.8544802 0.9998446
## beta0B 0.9575869 0.05057664 0.95 0.8615737 0.9997691
## beta0C 0.6930520 0.24176704 0.95 0.3444717 0.9917792
## beta1A 1.5171964 0.38056743 0.95 1.0808245 2.3459093
## beta1B 1.7896323 0.56996358 0.95 1.1208255 2.9052050
## beta1C 1.3295262 0.23142426 0.95 1.0005293 1.8001938
## beta0A 0.9109306 0.09415977 0.95 0.7450933 0.9991757
## beta0B 0.9474557 0.05466744 0.95 0.8546296 0.9998542
## beta0C 0.6844260 0.25597435 0.95 0.1968036 0.9921257
## beta1A 1.3743002 0.40896514 0.95 1.0046594 2.9088154
## beta1B 1.6303701 0.81305930 0.95 1.0023232 3.8184414
## beta1C 1.2112592 0.18514509 0.95 1.0012300 1.6548299
##
## Expected Response Rate of Dynamic Treatment Regimens (DTR):
## Estimate Std. Error C.I. CI low CI high
## rep_AB 0.4697516 0.09275624 0.95 0.2917702 0.6296532
## rep_AC 0.6015571 0.07162453 0.95 0.4451989 0.7184334
## rep_BA 0.5012073 0.08332682 0.95 0.3709581 0.6217467
## rep_BC 0.6294671 0.09964662 0.95 0.4624197 0.7828289
## rep_CA 0.6175090 0.11258901 0.95 0.3954040 0.8142629
## rep_CB 0.6065809 0.10694339 0.95 0.4134393 0.7979918
## rep_AB 0.4490128 0.13354447 0.95 0.1833142 0.6635111
## rep_AC 0.5858904 0.10180160 0.95 0.4046741 0.7529446
## rep_BA 0.4754814 0.12128590 0.95 0.2514877 0.6599729
## rep_BC 0.6272426 0.09956371 0.95 0.4679389 0.8323915
## rep_CA 0.6280401 0.11172644 0.95 0.3704172 0.7754331
## rep_CB 0.6315693 0.12178323 0.95 0.3518751 0.8164481

`LPJSM_binary`: Here, we call the LPJSM_binary mirroring our example for
the BJSM_binary above.
Expand Down Expand Up @@ -259,24 +261,24 @@ summary(result2)
##
## Treatment Effects Estimate:
## Estimate Std. Error C.I. CI low CI high
## trtA 0.3009 0.04858 0.95 0.2073 0.3965
## trtB 0.4734 0.03911 0.95 0.3974 0.5503
## trtC 0.6769 0.04219 0.95 0.5959 0.7610
## trtA 0.3015 0.04856 0.95 0.2064 0.3960
## trtB 0.4735 0.03939 0.95 0.3957 0.5492
## trtC 0.6808 0.04373 0.95 0.5908 0.7638
##
## Differences between Treatments:
## Estimate Std.Error C.I. CI low CI high
## diffAB -0.1724 0.06193 0.95 -0.2945 -0.05246
## diffBC -0.2035 0.05663 0.95 -0.3137 -0.09219
## diffAC -0.3759 0.06264 0.95 -0.4936 -0.24832
## diffAB -0.1719 0.06223 0.95 -0.2955 -0.05129
## diffBC -0.2073 0.05767 0.95 -0.3185 -0.09348
## diffAC -0.3793 0.06379 0.95 -0.5018 -0.25274
##
## Linkage Parameter Estimate:
## Estimate Std. Error C.I. CI low CI high
## beta0A 0.8728 0.10923 0.95 0.6662 1.000
## beta0B 0.7207 0.11468 0.95 0.5401 1.000
## beta0C 0.8729 0.12545 0.95 0.6231 1.000
## beta1A 1.4711 0.36005 0.95 1.0000 2.164
## beta1B 1.3608 0.16853 0.95 1.0301 1.673
## beta1C 1.4633 0.09484 0.95 1.2800 1.641
## beta0A 0.8700 0.1105 0.95 0.6625 1.0000
## beta0B 0.7174 0.1147 0.95 0.5010 0.9568
## beta0C 0.8710 0.1267 0.95 0.6192 1.0000
## beta1A 1.4728 0.3595 0.95 1.0000 2.1657
## beta1B 1.3606 0.1704 0.95 1.0375 1.6863
## beta1C 1.4550 0.0977 0.95 1.2738 1.6569

`BJSM_c`: Below, we call the function assuming the mean and standard
deviation of the normal prior being 50 and 50 for all three treatments,
Expand All @@ -296,19 +298,19 @@ summary(BJSM_result)
##
## Parameter Estimation:
## Estimate CI CI_low CI_high
## V1[1,1] 110.526 0.95 6.351e+01 167.1243
## V1[2,1] 84.797 0.95 4.640e+01 130.1543
## V1[1,2] 84.797 0.95 4.640e+01 130.1543
## V1[2,2] 77.082 0.95 4.386e+01 116.8413
## V2[1,1] 122.695 0.95 6.342e+01 195.2136
## V2[2,1] 28.201 0.95 -2.200e+01 74.1924
## V2[1,2] 28.201 0.95 -2.200e+01 74.1924
## V2[2,2] 107.332 0.95 5.682e+01 173.0125
## phi1 0.184 0.95 3.294e-05 0.3795
## phi3 4.004 0.95 2.738e+00 5.3468
## xi_[A] 51.126 0.95 4.724e+01 54.9047
## xi_[B] 62.030 0.95 5.836e+01 65.7607
## xi_[C] 69.035 0.95 6.526e+01 72.7477
## V1[1,1] 111.0169 0.95 60.701765 168.5941
## V1[2,1] 85.2106 0.95 44.885297 132.4085
## V1[1,2] 85.2106 0.95 44.885297 132.4085
## V1[2,2] 77.4065 0.95 43.146839 117.7926
## V2[1,1] 123.2723 0.95 66.132083 193.6889
## V2[2,1] 28.6508 0.95 -16.647146 75.8023
## V2[1,2] 28.6508 0.95 -16.647146 75.8023
## V2[2,2] 106.9160 0.95 55.412731 167.4823
## phi1 0.1818 0.95 0.000246 0.3768
## phi3 3.9991 0.95 2.705726 5.2487
## xi_[A] 51.1377 0.95 47.256453 54.9003
## xi_[B] 62.0380 0.95 58.063443 65.5587
## xi_[C] 69.0069 0.95 65.538008 72.9675

This R package will continue to be updated as more snSMART designs and
methods are developed. We hope that this package translates snSMART
Expand Down

0 comments on commit 49e478a

Please sign in to comment.