https://github.com/mightymetrika/npboottprm
Nonparametric Bootstrap Test with Pooled Resampling
https://github.com/mightymetrika/npboottprm
datascience nonparametric r statistics
Last synced: about 1 year ago
JSON representation
Nonparametric Bootstrap Test with Pooled Resampling
- Host: GitHub
- URL: https://github.com/mightymetrika/npboottprm
- Owner: mightymetrika
- License: other
- Created: 2023-07-30T17:33:47.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-24T15:18:25.000Z (over 2 years ago)
- Last Synced: 2024-04-26T09:04:23.631Z (about 2 years ago)
- Topics: datascience, nonparametric, r, statistics
- Language: R
- Homepage:
- Size: 216 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# npboottprm
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.