optimall
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.5%) to scientific vocabulary
Last synced: 11 months ago
·
JSON representation
Repository
Basic Info
- Host: GitHub
- Owner: yangjasp
- Language: R
- Default Branch: master
- Homepage: https://yangjasp.github.io/optimall/
- Size: 13.7 MB
Statistics
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
- Releases: 7
Created almost 6 years ago
· Last pushed 11 months ago
Metadata Files
Readme
Changelog
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# optimall
`optimall` offers a collection of functions that are designed to streamline the process of optimum sample allocation, specifically under an adaptive, multi-wave approach. Its main functions allow users to:
* Define, split, and merge strata based on values or quantiles of other variables.
* Calculate the optimum number of samples to allocate to each stratum in a given study in order to minimize the variance of an estimate of interest.
* Select specific ids to sample based on a stratified sampling design.
* Optimally allocate a fixed number of samples to an ancillary sampling wave based on results from a prior wave.
When used together, these functions can automate most of the sampling workflow.
## Installation
You can install `optimall` from [CRAN](https://CRAN.R-project.org/package=optimall) with:
``` r
# install.packages("optimall")
```
Or, you can install the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("yangjasp/optimall")
```
## Example
Given a dataframe where each row represents one unit, `optimall` can define the stratum each unit belongs to:
```{r example, eval=FALSE}
library(optimall)
data <- split_strata(data = data, strata = "old_strata",
split_var = "variable_to_split_on",
type = "value", split_at = c(1,2))
```
If the strata or values to split at are not obvious, it may be useful to try a few different splits and observe the effects that each has on sample allocation. `optimall` makes this process quick and easy with a Shiny app that can be launched with `optimall_shiny`. This app allows users to adjust inputs to the `split_strata` function and view the results in real time. Once the parameters are satisfactory, the user can confirm the split and move on to further ones if desired. The app prints the code required to replicate the splits in `optimall`, so making the changes inside of R becomes as easy as a copy and paste!
Screenshot:

We can then use `optimum_allocation` to calculate the optimum allocation a fixed number of samples to our strata in order to minimize the variance of a variable of interest.
```{r example2, eval=FALSE}
optimum_allocation(data = data, strata = "new_strata",
y = "var_of_interest", nsample = 100)
```
`optimall` offers more functions that streamline adaptive, multi-wave sampling workflows. For a more detailed description, see package vignettes.
## References
> McIsaac MA, Cook RJ. Adaptive sampling in two‐phase designs: a biomarker study for progression in arthritis. Statistics in Medicine. 2015 Sep 20;34(21):2899-912.
> Wright, T. (2014). A simple method of exact optimal sample allocation under stratification with any mixed constraint patterns. Statistics, 07.
Owner
- Login: yangjasp
- Kind: user
- Repositories: 2
- Profile: https://github.com/yangjasp
GitHub Events
Total
- Watch event: 1
- Push event: 12
Last Year
- Watch event: 1
- Push event: 12
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| yangjasp | j****g@o****e | 201 |
| Jasper Yang | j****r@J****l | 191 |
| yangjasp | 6****p | 9 |
Committer Domains (Top 20 + Academic)
outlook.come: 1
Issues and Pull Requests
Last synced: almost 2 years ago
All Time
- Total issues: 1
- Total pull requests: 1
- Average time to close issues: 11 days
- Average time to close pull requests: about 1 hour
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 2.0
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- JessMK (1)
- jennybc (1)
- yangjasp (1)
Pull Request Authors
- yangjasp (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 159 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 10
- Total maintainers: 1
cran.r-project.org: optimall
Allocate Samples Among Strata
- Homepage: https://github.com/yangjasp/optimall
- Documentation: http://cran.r-project.org/web/packages/optimall/optimall.pdf
- License: GPL-3
-
Latest release: 1.3.0
published 11 months ago
Rankings
Forks count: 17.8%
Stargazers count: 24.2%
Dependent packages count: 29.8%
Average: 33.1%
Dependent repos count: 35.5%
Downloads: 58.4%
Maintainers (1)
Last synced:
11 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.5.0 depends
- dplyr >= 1.0.5 imports
- glue >= 1.4.0 imports
- magrittr >= 2.0.0 imports
- methods >= 4.0.0 imports
- rlang >= 0.2.2 imports
- stats >= 4.0.2 imports
- tibble >= 1.4.2 imports
- utils >= 3.5.0 imports
- DT >= 0.15 suggests
- DiagrammeR >= 1.0.0 suggests
- bslib >= 0.2.4 suggests
- datasets * suggests
- globals >= 0.12 suggests
- knitr >= 1.28 suggests
- rmarkdown >= 2.7 suggests
- shiny >= 1.6.0 suggests
- shinytest >= 1.4.0 suggests
- survey >= 4.0 suggests
- testthat >= 3.0.2 suggests
- webshot >= 0.5 suggests