| Title: | Intelligent Ranked Set Sampling with 'Excel' Integration and SRS Comparison |
|---|---|
| Description: | Provides tools for Ranked Set Sampling (RSS) analysis, data import, statistical estimation, and comparison with Simple Random Sampling (SRS). The package offers a complete workflow from 'Excel' and CSV data import and cleaning to RSS implementation, efficiency evaluation, visualization, and automated reporting. Intelligent ranking procedures based on correlation analysis, regression models, and machine learning methods are included to address imperfect ranking commonly encountered in practical RSS applications. Monte Carlo simulation tools are provided for evaluating estimator performance under different sampling scenarios. Ranked Set Sampling was originally introduced by McIntyre (1952) <doi:10.2307/3001960> as an efficient alternative to simple random sampling when ranking information is available at low cost. The package supports researchers, statisticians, and practitioners working in agricultural, environmental, biological, and other applied sciences. |
| Authors: | Khalid Ul Islam Rather [aut, cre] |
| Maintainer: | Khalid Ul Islam Rather <[email protected]> |
| License: | GPL-3 |
| Version: | 0.2.4 |
| Built: | 2026-07-09 14:23:05 UTC |
| Source: | https://github.com/cran/KlerRSS |
Runs the complete Ranked Set Sampling (RSS) analysis workflow by comparing the performance of RSS and Simple Random Sampling (SRS) using the supplied dataset.
kler_analyze(data, m = 3, r = 10)kler_analyze(data, m = 3, r = 10)
data |
A data frame containing the study variable. |
m |
An integer specifying the set size. Default is 3. |
r |
An integer specifying the number of cycles. Default is 10. |
A list containing the results returned by 'kler_compare()', including the comparative analysis of RSS and SRS.
data <- data.frame(y = rnorm(100)) kler_analyze(data, m = 3, r = 5)data <- data.frame(y = rnorm(100)) kler_analyze(data, m = 3, r = 5)
Compares Ranked Set Sampling (RSS) and Simple Random Sampling (SRS) using the supplied dataset and computes summary statistics and relative efficiency.
kler_compare(data, m = 3, r = 5)kler_compare(data, m = 3, r = 5)
data |
A data frame containing the study variable. |
m |
An integer specifying the set size. Default is 3. |
r |
An integer specifying the number of cycles. Default is 5. |
A list containing the sample means, sample variances, and relative efficiency of RSS compared with SRS.
data <- data.frame(y = rnorm(100)) kler_compare(data, m = 3, r = 5)data <- data.frame(y = rnorm(100)) kler_compare(data, m = 3, r = 5)
Imports data from CSV or 'Excel' (.xlsx) files and removes missing values.
kler_import(file)kler_import(file)
file |
A character string specifying the path to a CSV or 'Excel' (.xlsx) file. |
The function automatically detects the file format from its extension. Files with the '.csv' extension are imported using 'utils::read.csv()', while '.xlsx' files are imported using 'readxl::read_excel()'.
A cleaned data frame with missing values removed.
tmp <- tempfile(fileext = ".csv") write.csv(data.frame(y = rnorm(10)), tmp, row.names = FALSE) kler_import(tmp)tmp <- tempfile(fileext = ".csv") write.csv(data.frame(y = rnorm(10)), tmp, row.names = FALSE) kler_import(tmp)
Simulates imperfect judgment ranking by adding random noise to the true ranks of the observations. This function can be used to emulate ranking errors in Ranked Set Sampling (RSS).
kler_ml_rank(x, noise_level = 0.1)kler_ml_rank(x, noise_level = 0.1)
x |
A numeric vector to be ranked. |
noise_level |
A non-negative numeric value controlling the amount of ranking error. Larger values correspond to greater ranking uncertainty. The default is 0.1. |
An integer vector giving the indices that order the observations according to the simulated noisy ranking.
Creates a density plot comparing the distributions of Simple Random Sampling (SRS) and Ranked Set Sampling (RSS) samples.
kler_plot_distribution(srs_sample, rss_sample)kler_plot_distribution(srs_sample, rss_sample)
srs_sample |
A numeric vector containing the SRS observations. |
rss_sample |
A numeric vector containing the RSS observations. |
A 'ggplot2' object representing the density comparison of the two sampling methods.
srs <- rnorm(100) rss <- rnorm(100, mean = 0.5) kler_plot_distribution(srs, rss)srs <- rnorm(100) rss <- rnorm(100, mean = 0.5) kler_plot_distribution(srs, rss)
Creates a bar chart comparing the sample variances obtained from Simple Random Sampling (SRS) and Ranked Set Sampling (RSS).
kler_plot_efficiency(comparison)kler_plot_efficiency(comparison)
comparison |
A list returned by 'kler_compare()'. |
A 'ggplot2' object displaying the variance comparison between SRS and RSS.
data <- data.frame(y = rnorm(100)) comp <- kler_compare(data, m = 3, r = 5) kler_plot_efficiency(comp)data <- data.frame(y = rnorm(100)) comp <- kler_compare(data, m = 3, r = 5) kler_plot_efficiency(comp)
Generates a text report summarizing the comparison between Ranked Set Sampling (RSS) and Simple Random Sampling (SRS).
kler_report(results)kler_report(results)
results |
A list returned by 'kler_compare()'. |
A character string containing the analysis report.
data <- data.frame(y = rnorm(100)) res <- kler_compare(data, m = 3, r = 5) cat(kler_report(res))data <- data.frame(y = rnorm(100)) res <- kler_compare(data, m = 3, r = 5) cat(kler_report(res))
Draws a Ranked Set Sampling (RSS) sample from a univariate dataset using the classical RSS procedure.
kler_rss(data, m, r)kler_rss(data, m, r)
data |
A data frame containing at least one numeric variable. |
m |
A positive integer specifying the set size. |
r |
A positive integer specifying the number of sampling cycles. |
A numeric vector containing the Ranked Set Sampling (RSS) observations.
data <- data.frame(y = rnorm(100)) rss <- kler_rss(data, m = 3, r = 5) head(rss)data <- data.frame(y = rnorm(100)) rss <- kler_rss(data, m = 3, r = 5) head(rss)
Performs a Monte Carlo simulation to compare the performance of Ranked Set Sampling (RSS) and Simple Random Sampling (SRS).
kler_simulation(n = 50, m = 3, r = 10, N = 500)kler_simulation(n = 50, m = 3, r = 10, N = 500)
n |
A positive integer specifying the population sample size. |
m |
A positive integer specifying the set size. |
r |
A positive integer specifying the number of cycles. |
N |
A positive integer specifying the number of Monte Carlo repetitions. |
A list containing the estimated means, variances, and relative efficiency of RSS compared with SRS.
kler_simulation(n = 50, m = 3, r = 5, N = 10)kler_simulation(n = 50, m = 3, r = 5, N = 10)
Draws a Ranked Set Sampling (RSS) sample from a data set using the classical RSS procedure.
kler_true_rss(data, m, r)kler_true_rss(data, m, r)
data |
A data frame containing at least one numeric variable. |
m |
A positive integer specifying the set size. |
r |
A positive integer specifying the number of sampling cycles. |
A numeric vector containing the Ranked Set Sampling (RSS) sample.
data <- data.frame(y = rnorm(100)) rss <- kler_true_rss(data, m = 3, r = 5) head(rss)data <- data.frame(y = rnorm(100)) rss <- kler_true_rss(data, m = 3, r = 5) head(rss)