-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
115 lines (81 loc) · 3.3 KB
/
README.Rmd
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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# npboottprm
<!-- badges: start -->
<!-- badges: end -->
The goal of npboottprm is to provide a robust tool for conducting nonparametric bootstrap tests with pooled resampling. These tests are ideal for small sample sizes and include the independent t-test, paired t-test, and F-test. The package employs methods presented in Dwivedi, Mallawaarachchi, and Alvarado (2017).
## Installation
You can install the released version of npboottprm from [CRAN](https://CRAN.R-project.org):
```{r eval=FALSE}
install.packages("npboottprm")
```
To install the development version of npboottprm from GitHub, use the [devtools](https://devtools.r-lib.org/) package:
```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("mightymetrika/npboottprm")
```
## Nonparametric bootstrap t-test
The following example demonstrates how to use the nonparboot() function to conduct an independent t-test.
```{r}
library(npboottprm)
# Use the simulated data included in the package
print(data_t)
# Run the test
res_t <- nonparboot(data = data_t,
x = "x",
grp = "grp",
nboot = 1000,
test = "t",
conf.level = 0.95,
seed = 183)
# Print the results, excluding the bootstrap distributions
print(res_t[!names(res_t) %in%
c("bootstrap.stat.dist", "bootstrap.effect.dist")])
```
## Nonparametric bootstrap paired t-test
The following example demonstrates how to use the nonparboot() function to conduct a paired t-test.
```{r}
# Use the simulated data included in the package
print(data_pt)
# Run the test
res_pt <- nonparboot(data = data_pt,
x = "x",
y = "y",
nboot = 1000,
test = "pt",
conf.level = 0.95,
seed = 166)
# Print the results, excluding the bootstrap distributions
print(res_pt[!names(res_pt) %in%
c("bootstrap.stat.dist", "bootstrap.effect.dist")])
```
## Nonparametric bootstrap F-test
The following example demonstrates how to use the nonparboot() function to conduct an F-test.
```{r}
# Use the simulated data included in the package
print(data_f)
# Run the test
res_f <- nonparboot(data = data_f,
x = "x",
grp = "grp",
nboot = 1000,
test = "F",
conf.level = 0.95,
seed = 397)
# Print the results, excluding the bootstrap distributions
print(res_f[!names(res_f) %in%
c("bootstrap.stat.dist", "bootstrap.effect.dist")])
```
Please note that the examples provided here use simulated data included in the package. When using this package with your own data, replace data_t, data_pt, and data_f with your own data frames, and adjust the x, y, and grp parameters as needed.
## References
Dwivedi AK, Mallawaarachchi I, Alvarado LA (2017). "Analysis of small sample size studies using nonparametric bootstrap test with pooled resampling method." Statistics in Medicine, 36 (14), 2187-2205.