diff --git a/README.Rmd b/README.Rmd index 061ad35..6be42ea 100644 --- a/README.Rmd +++ b/README.Rmd @@ -43,7 +43,7 @@ practice. - Judgment post-stratified (JPS) sampling - Ranked set sampling (RSS) -- Porbability-proportional to size (PPS) sampling +- Probability-proportional to size (PPS) sampling - Spatially balanced sampling (SBS) - Two-stage cluster sampling @@ -82,7 +82,9 @@ Sampling is made following the diagram below. Use the following code to install this package: ```{r, eval=F} -if (!require("remotes")) install.packages("remotes") +if (!require("remotes")) { + install.packages("remotes") +} remotes::install_github("AAGI-AUS/InPlotSampling", upgrade = FALSE) ``` @@ -110,7 +112,14 @@ rhos <- rep(0.75, n_rankers) taus <- sigma * sqrt(1 / rhos^2 - 1) population <- qnorm((1:population_size) / (population_size + 1), mu, sigma) -data <- InPlotSampling::jps_sample(population, n, H, taus, n_rankers, with_replacement) +data <- InPlotSampling::jps_sample( + population, + n, + H, + taus, + n_rankers, + with_replacement +) data <- data[order(data[, 2]), ] InPlotSampling::rss_jps_estimate( @@ -159,8 +168,12 @@ sample_id <- df_sample[, 1] y_sample <- y[sample_id] sbs_pps_estimates <- sbs_pps_estimate( - population, sample_sizes, y_sample, df_sample, - n_bootstrap = 100, alpha = 0.05 + population, + sample_sizes, + y_sample, + df_sample, + n_bootstrap = 100, + alpha = 0.05 ) print(sbs_pps_estimates) #> n1 n2 Estimate St.error 95% Confidence intervals diff --git a/README.md b/README.md index c6f7780..93fca6b 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,38 @@ +--- +output: github_document +bibliography: inst/Reference.bib +nocite: | + @Ozturk2021 +--- + + # InPlotSampling + + -[![Project Status: WIP – Initial development is in progress, but there -has not yet been a stable, usable release suitable for the -public.](http://www.repostatus.org/badges/latest/wip.svg)](http://www.repostatus.org/#wip) -[![Codecov test -coverage](https://codecov.io/gh/biometryhub/RankedSetSampling/branch/main/graph/badge.svg)](https://codecov.io/gh/biometryhub/RankedSetSampling?branch=main) -[![R build -status](https://github.com/AAGI-AUS/InPlotSampling/workflows/R-CMD-check/badge.svg)](https://github.com/AAGI-AUS/InPlotSampling/actions) +[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](http://www.repostatus.org/badges/latest/wip.svg)](http://www.repostatus.org/#wip) +[![Codecov test coverage](https://codecov.io/gh/biometryhub/RankedSetSampling/branch/main/graph/badge.svg)](https://codecov.io/gh/biometryhub/RankedSetSampling?branch=main) +[![R build status](https://github.com/AAGI-AUS/InPlotSampling/workflows/R-CMD-check/badge.svg)](https://github.com/AAGI-AUS/InPlotSampling/actions) ![pkgdown](https://github.com/AAGI-AUS/InPlotSampling/workflows/pkgdown/badge.svg) -
[![minimal R -version](https://img.shields.io/badge/R%3E%3D-3.5.0-6666ff.svg)](https://cran.r-project.org/) +
+[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.5.0-6666ff.svg)](https://cran.r-project.org/) [![packageversion](https://img.shields.io/badge/Package%20version-0.1.0-orange.svg?style=flat-square)](/commits/main) -[![Last-changedate](https://img.shields.io/badge/last%20change-2025--02--14-yellowgreen.svg)](/commits/main) +[![Last-changedate](https://img.shields.io/badge/last%20change-2026--03--27-yellowgreen.svg)](/commits/main) [![Licence](https://img.shields.io/github/license/mashape/apistatus.svg)](http://choosealicense.com/licenses/mit/) -The InPlotSampling package provides a way for researchers to easily -implement these sampling methods in practice. +The InPlotSampling package provides a way for researchers to easily implement these sampling methods in +practice. - Judgment post-stratified (JPS) sampling - Ranked set sampling (RSS) -- Porbability-proportional to size (PPS) sampling +- Probability-proportional to size (PPS) sampling - Spatially balanced sampling (SBS) - Two-stage cluster sampling @@ -34,15 +40,15 @@ implement these sampling methods in practice. -- [Sampling Methods](#sampling-methods) - - [JPS Sampling](#jps-sampling) - - [RSS](#rss-sampling) -- [Installation](#installation) -- [Examples](#examples) - - [JPS Sample and Estimator](#jps-sample-and-estimator) - - [SBS PPS Sample and Estimator](#sbs-pps-sample-and-estimator) -- [Citing this package](#citing-this-package) -- [Related Reference](#related-reference) +* [Sampling Methods](#sampling-methods) + * [JPS Sampling](#jps-sampling) + * [RSS](#rss-sampling) +* [Installation](#installation) +* [Examples](#examples) + * [JPS Sample and Estimator](#jps-sample-and-estimator) + * [SBS PPS Sample and Estimator](#sbs-pps-sample-and-estimator) +* [Citing this package](#citing-this-package) +* [Related Reference](#related-reference) @@ -52,27 +58,23 @@ implement these sampling methods in practice. Sampling is made following the diagram below. -
- - -
+![JPS sampling diagram](man/figures/jps-diagram.drawio.svg) ### RSS Sampling is made following the diagram below. -
-RSS diagram - -
+![RSS diagram](man/figures/rss-diagram.drawio.svg) ## Installation Use the following code to install this package: + ``` r -if (!require("remotes")) install.packages("remotes") +if (!require("remotes")) { + install.packages("remotes") +} remotes::install_github("AAGI-AUS/InPlotSampling", upgrade = FALSE) ``` @@ -81,9 +83,7 @@ remotes::install_github("AAGI-AUS/InPlotSampling", upgrade = FALSE) ### JPS Sample and Estimator
- -JPS sample and estimator - +JPS sample and estimator ``` r set.seed(112) @@ -102,7 +102,14 @@ rhos <- rep(0.75, n_rankers) taus <- sigma * sqrt(1 / rhos^2 - 1) population <- qnorm((1:population_size) / (population_size + 1), mu, sigma) -data <- InPlotSampling::jps_sample(population, n, H, taus, n_rankers, with_replacement) +data <- InPlotSampling::jps_sample( + population, + n, + H, + taus, + n_rankers, + with_replacement +) data <- data[order(data[, 2]), ] InPlotSampling::rss_jps_estimate( @@ -122,15 +129,12 @@ InPlotSampling::rss_jps_estimate( #> 5 SRS estimate 9.793 0.783 8.766,10.821 #> 6 Minimum 9.542 0.500 8.887,10.198 ``` -
### SBS PPS Sample and Estimator
- -SBS PPS sample and estimator - +SBS PPS sample and estimator ``` r set.seed(112) @@ -154,49 +158,27 @@ sample_id <- df_sample[, 1] y_sample <- y[sample_id] sbs_pps_estimates <- sbs_pps_estimate( - population, sample_sizes, y_sample, df_sample, - n_bootstrap = 100, alpha = 0.05 + population, + sample_sizes, + y_sample, + df_sample, + n_bootstrap = 100, + alpha = 0.05 ) print(sbs_pps_estimates) #> n1 n2 Estimate St.error 95% Confidence intervals #> 1 5 5 2.849 0.1760682 2.451,3.247 ``` -
# Citing this package -This package can be cited using `citation("InPlotSampling")` which -generates - - To cite package 'InPlotSampling' in publications use: +This package can be cited using `citation("InPlotSampling")` which generates - Ozturk O, Rogers S, Kravchuk O, Kasprzak P (2021). _InPlotSampling: - Easing the Application of Ranked Set Sampling in Practice_. R package - version 0.1.0, . - A BibTeX entry for LaTeX users is - - @Manual{, - title = {InPlotSampling: Easing the Application of Ranked Set Sampling in Practice}, - author = {Omer Ozturk and Sam Rogers and Olena Kravchuk and Peter Kasprzak}, - year = {2021}, - note = {R package version 0.1.0}, - url = {https://aagi-aus.github.io/InPlotSampling/}, - } +``` +Error in `citation()`: +! there is no package called 'InPlotSampling' +``` # Related Reference - -
- -
- -Ozturk, Omer, and Olena Kravchuk. 2021. “Judgment Post-Stratified -Assessment Combining Ranking Information from Multiple Sources, with a -Field Phenotyping Example.” *Journal of Agricultural, Biological and -Environmental Statistics*. . - -
- -