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
+
+
-[](http://www.repostatus.org/#wip)
-[](https://codecov.io/gh/biometryhub/RankedSetSampling?branch=main)
-[](https://github.com/AAGI-AUS/InPlotSampling/actions)
+[](http://www.repostatus.org/#wip)
+[](https://codecov.io/gh/biometryhub/RankedSetSampling?branch=main)
+[](https://github.com/AAGI-AUS/InPlotSampling/actions)

-
[](https://cran.r-project.org/)
+
+[](https://cran.r-project.org/)
[](/commits/main)
-[](/commits/main)
+[](/commits/main)
[](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 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
``` 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
```
-