Title: | Ranked Set Sampling |
---|---|
Description: | Ranked set sampling (RSS) is introduced as an advanced method for data collection which is substantial for the statistical and methodological analysis in scientific studies by McIntyre (1952) (reprinted in 2005) <doi:10.1198/000313005X54180>. This package introduces the first package that implements the RSS and its modified versions for sampling. With 'RSSampling', the researchers can sample with basic RSS and the modified versions, namely, Median RSS, Extreme RSS, Percentile RSS, Balanced groups RSS, Double RSS, L-RSS, Truncation-based RSS, Robust extreme RSS. The 'RSSampling' also allows imperfect ranking using an auxiliary variable (concomitant) which is widely used in the real life applications. Applicants can also use this package for parametric and nonparametric inference such as mean, median and variance estimation, regression analysis and some distribution-free tests where the the samples are obtained via basic RSS. |
Authors: | Busra Sevinc, Bekir Cetintav, Melek Esemen, Selma Gurler |
Maintainer: | Busra Sevinc <[email protected]> |
License: | GPL-2 |
Version: | 1.0 |
Built: | 2024-11-20 06:33:00 UTC |
Source: | CRAN |
The Mrss
function samples from a target population by using modified ranked set sampling methods. Ranking procedure of X is done by using the concomitant variable Y.
con.Mrss(X,Y,m,r=1,type="r",sets=FALSE,concomitant=FALSE,p)
con.Mrss(X,Y,m,r=1,type="r",sets=FALSE,concomitant=FALSE,p)
X |
A vector of target population |
Y |
A vector of concomitant variable from target population |
m |
Size of units in each set |
r |
Number of cycles. (By default = 1) |
type |
type of the modified RSS method. "r" for traditional RSS, "p" for Percentile RSS, "m" for Median RSS, "bg" for Balanced Groups RSS, "e" for Extreme RSS. (By default = "r") |
sets |
logical; if TRUE, ranked set samples are given with ranked sets (see |
concomitant |
logical; if TRUE, ranked set sample of concomitant variable is given |
p |
Value of percentile for Percentile RSS method |
X and Y must be vectors and also they should be in same length. Value of percentile (p) must be between 0 and 1.
corr.coef |
the correlation coefficient between X and Y |
var.of.interest |
the sets of X, which are ranked by Y |
concomitant.var. |
the ranked sets of Y |
sample.x |
the obtained ranked set sample of X |
sample.y |
the obtained ranked set sample of Y |
McIntyre, G. A. (1952). A method for unbiased selective sampling, using ranked sets. Australian Journal of Agricultural Research, 3(4), 385-390.
Samawi, H. M., Ahmed, M. S., & Abu-Dayyeh, W. (1996). Estimating the population mean using extreme ranked set sampling. Biometrical Journal, 38(5), 577-586.
Muttlak, H. A. (1997). Median ranked set sampling. Journal of Applied Statistical Sciences, 6(4), 245-255.
Muttlak, H. A. (2003). Modified ranked set sampling methods. Pakistan Journal Of Statistics, 19(3), 315-324.
Jemain, A. A., Al-Omari, A., & Ibrahim, K. (2008). Some variations of ranked set sampling. Electronic Journal of Applied Statistical Analysis, 1(1), 1-15.
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,3]) ## Selecting modified ranked set samples con.Mrss(xx, xy, m=5, r=3, type="r", concomitant=TRUE, sets=TRUE) con.Mrss(xx, xy, m=4, r=7, type="m", concomitant=TRUE, sets=TRUE) con.Mrss(xx, xy, m=5, r=2, type="e", concomitant=TRUE, sets=TRUE) con.Mrss(xx, xy, m=8, r=3, type="p", concomitant=TRUE, sets=TRUE, p=0.25) con.Mrss(xx, xy, m=6, r=5, type="bg", concomitant=TRUE, sets=TRUE)
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,3]) ## Selecting modified ranked set samples con.Mrss(xx, xy, m=5, r=3, type="r", concomitant=TRUE, sets=TRUE) con.Mrss(xx, xy, m=4, r=7, type="m", concomitant=TRUE, sets=TRUE) con.Mrss(xx, xy, m=5, r=2, type="e", concomitant=TRUE, sets=TRUE) con.Mrss(xx, xy, m=8, r=3, type="p", concomitant=TRUE, sets=TRUE, p=0.25) con.Mrss(xx, xy, m=6, r=5, type="bg", concomitant=TRUE, sets=TRUE)
The con.Rrss
function samples from a target population by using robust ranked set sampling methods. Ranking procedure of X is done by using the concomitant variable Y.
con.Rrss(X,Y,m,r=1,type="l",sets=FALSE,concomitant=FALSE,alpha)
con.Rrss(X,Y,m,r=1,type="l",sets=FALSE,concomitant=FALSE,alpha)
X |
A vector of target population |
Y |
A vector of concomitant variable from target population |
m |
Size of units in each set |
r |
Number of cycles. (By default =1) |
type |
type of the modified RSS method. "l" for L-RSS, "tb" for truncation-based RSS, "re" for robust extreme RSS. (By default ="l") |
sets |
logical; if TRUE, ranked set sample is given with ranked sets (see |
concomitant |
logical; if TRUE, ranked set sample of concomitant variable is given |
alpha |
Coefficient of the method |
X and Y must be vectors and also they should be in same length. Coefficient of the method must be between 0 and 0.5.
corr.coef |
the correlation coefficient between X and Y |
var.of.interest |
the sets of X, which are ranked by Y |
concomitant.var. |
the ranked sets of Y |
sample.x |
the obtained ranked set sample of X |
sample.y |
the obtained ranked set sample of Y |
Al-Nasser, A. D. (2007). L ranked set sampling: A generalization procedure for robust visual sampling. Communications in Statistics-Simulation and Computation, 36(1), 33-43.
Al-Omari, A. I., & Raqab, M. Z. (2013). Estimation of the population mean and median using truncation-based ranked set samples. Journal of Statistical Computation and Simulation, 83(8), 1453-1471.
Al-Nasser, A. D., & Mustafa, A. B. (2009). Robust extreme ranked set sampling. Journal of Statistical Computation and Simulation 79(7), 859-867.
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,3]) ## Selecting robust ranked set samples con.Rrss(xx,xy,m=8,r=4,type="l", sets=TRUE, concomitant=TRUE, alpha=0.3) con.Rrss(xx,xy,m=5,r=2,type="re", sets=TRUE, concomitant=TRUE, alpha=0.2) con.Rrss(xx,xy,m=6,r=3,type="tb", sets=TRUE, concomitant=TRUE, alpha=0.25)
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,3]) ## Selecting robust ranked set samples con.Rrss(xx,xy,m=8,r=4,type="l", sets=TRUE, concomitant=TRUE, alpha=0.3) con.Rrss(xx,xy,m=5,r=2,type="re", sets=TRUE, concomitant=TRUE, alpha=0.2) con.Rrss(xx,xy,m=6,r=3,type="tb", sets=TRUE, concomitant=TRUE, alpha=0.25)
The con.rss
function samples from a target population by using ranked set sampling method. Ranking procedure of X is done by using concomitant variable Y.
con.rss(X,Y,m,r=1,sets=FALSE,concomitant=FALSE)
con.rss(X,Y,m,r=1,sets=FALSE,concomitant=FALSE)
X |
A vector of interested variable from target population |
Y |
A vector of concomitant variable from target population |
m |
Size of units in each set |
r |
Number of cycles. (Default by = 1) |
sets |
logical; if TRUE, ranked set sample is given with ranked sets(see |
concomitant |
logical; if TRUE, ranked set sample of concomitant variable is given |
X and Y must be vectors and also they should be in same length.
corr.coef |
the correlation coefficient between X and Y |
var.of.interest |
the sets of X, which are ranked by Y |
concomitant.var. |
the ranked sets of Y |
sample.x |
the obtained ranked set sample of X |
sample.y |
the obtained ranked set sample of Y |
McIntyre, G. A. (1952). A method for unbiased selective sampling, using ranked sets. Australian Journal of Agricultural Research, 3(4), 385-390.
Lynne Stokes, S. (1977). Ranked set sampling with concomitant variables. Communications in Statistics-Theory and Methods, 6(12), 1207-1211.
Chen, Z., Bai, Z., & Sinha, B. (2003). Ranked set sampling: theory and applications (Vol. 176). Springer Science & Business Media.
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,3]) con.rss(xx, xy, m=3, r=4, sets=TRUE, concomitant=TRUE)
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,3]) con.rss(xx, xy, m=3, r=4, sets=TRUE, concomitant=TRUE)
The Drss
function samples from a target population by using multi-stage ranked set sampling methods.
Drss(X,m,r=1,type="d",sets=FALSE,p)
Drss(X,m,r=1,type="d",sets=FALSE,p)
X |
A vector of target population |
m |
Size of units in each set |
r |
Number of cycles. (By default = 1) |
sets |
logical; if TRUE, ranked set samples are given with ranked sets (see |
type |
type of the modified RSS method. "d" for double RSS, "dm" for double median RSS, "dp" for double percentile RSS, "de" for double extreme RSS. (By default = "d") |
p |
Value of percentile for double percentile RSS method |
Target population X must be a vector. Value of percentile (p) must be between 0 and 1.
sets |
the ranked sets where ranked set sample is chosen from |
sample |
the obtained ranked set sample of X |
Al-Saleh, M. F., & Al-Kadiri, M. A. (2000). Double-ranked set sampling. Statistics & Probability Letters, 48: 205-212.
Samawi, H.M. & Tawalbeh, E.M. (2002). Double median ranked set sampling: Comparison to other double ranked set samples for mean and ratio estimators. Journal of Modern Applied Statistical Methods, 1(2): 428-442.
Samawi, H.M. 2002. On double extreme ranked set sample with application to regression estimator. Metron, LXn1-2: 53-66.
Jemain, A.A. & Al-Omari, A.I. (2006). Double percentile ranked set samples for estimating the population mean. Advances and Applications in Statistics, 6(3): 261-276.
Mrss
, Rrss
, con.Mrss
, con.Rrss
data=rnorm(10000) ##Seleceting a double ranked set sample Drss(data,m=4,r=3,sets=TRUE) ##Seleceting a double median ranked set sample Drss(data,m=4,r=3,type="dm",sets=TRUE) ##Seleceting a double extreme ranked set sample Drss(data,m=4,r=3,type="de",sets=TRUE) ##Seleceting a double percentile ranked set sample Drss(data,m=4,r=3,type="dm",sets=TRUE,p=0.6)
data=rnorm(10000) ##Seleceting a double ranked set sample Drss(data,m=4,r=3,sets=TRUE) ##Seleceting a double median ranked set sample Drss(data,m=4,r=3,type="dm",sets=TRUE) ##Seleceting a double extreme ranked set sample Drss(data,m=4,r=3,type="de",sets=TRUE) ##Seleceting a double percentile ranked set sample Drss(data,m=4,r=3,type="dm",sets=TRUE,p=0.6)
The meanRSS
function estimates the population mean based on ranked set sampling. Also, it calculates confidence interval, p-value and z-statistics for hypothesis testing.
meanRSS(X,m,r,alpha=0.05,alternative="two.sided",mu_0)
meanRSS(X,m,r,alpha=0.05,alternative="two.sided",mu_0)
X |
is an obtained ranked set sample |
m |
is the size of units in each set |
r |
is the number of cycles |
alpha |
is the alpha value for the confidence interval. (By default = 0.05) |
alternative |
is a character string, one of "greater","less" or "two.sided". For one sample test, alternative refers to the true mean of the parent population in relation to the hypothesized value mu_0 |
mu_0 |
is the initial value for mean in hypothesis testing formula |
An obtained ranked set sample X must be m by r matrix.
mean |
the estimated population mean based on ranked set sampling |
CI |
is a confidence interval for the true mean |
z.test |
the z-statistic for the test |
p.value |
the p-value for the test |
Chen, Z., Bai Z., Sinha B. K. (2003). Ranked Set Sampling: Theory and Application. New York: Springer.
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,2]) samplerss=con.Mrss(xx,xy,m=4,r=8,type="r",sets=FALSE,concomitant=FALSE)$sample.x ## mean estimation, confidence interval and hypothesis testing for ranked set sample meanRSS(samplerss,m=4,r=8,mu_0=1)
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,2]) samplerss=con.Mrss(xx,xy,m=4,r=8,type="r",sets=FALSE,concomitant=FALSE)$sample.x ## mean estimation, confidence interval and hypothesis testing for ranked set sample meanRSS(samplerss,m=4,r=8,mu_0=1)
The Mrss
function samples from a target population by using modified ranked set sampling methods.
Mrss(X,m,r=1,type="r",sets=FALSE,p)
Mrss(X,m,r=1,type="r",sets=FALSE,p)
X |
A vector of target population |
m |
Size of units in each set |
r |
Number of cycles. (By default = 1) |
sets |
logical; if TRUE, ranked set samples are given with ranked sets (see |
type |
type of the modified RSS method. "r" for traditional RSS, "p" for Percentile RSS, "m" for Median RSS, "bg" for Balanced Groups RSS, "e" for Extreme RSS. (By default = "r") |
p |
Value of percentile for Percentile RSS method |
Target population X must be a vector.
sets |
the ranked sets where ranked set sample is chosen from |
sample |
the obtained ranked set sample of X |
McIntyre, G. A. (1952). A method for unbiased selective sampling, using ranked sets. Australian Journal of Agricultural Research, 3(4), 385-390.
Samawi, H. M., Ahmed, M. S., & Abu-Dayyeh, W. (1996). Estimating the population mean using extreme ranked set sampling. Biometrical Journal, 38(5), 577-586.
Muttlak, H. A. (1997). Median ranked set sampling. Journal of Applied Statistical Sciences, 6(4), 245-255.
Muttlak, H. A. (2003). Modified ranked set sampling methods. Pakistan Journal Of Statistics, 19(3), 315-324.
Jemain, A. A., Al-Omari, A., & Ibrahim, K. (2008). Some variations of ranked set sampling. Electronic Journal of Applied Statistical Analysis, 1(1), 1-15.
data=rgamma(10000,1,1) ## Selecting a median ranked set sample Mrss(data,m=4,r=5,sets=TRUE,type="m") ## Selecting an extreme ranked set sample Mrss(data,m=3,r=5,sets=TRUE,type="e") ## Selecting a percentile ranked set sample Mrss(data,m=4,r=3,sets=TRUE,type="p",p=0.2) ## Selecting a balanced groups ranked set sample Mrss(data,m=6,r=2,sets=TRUE,type="bg")
data=rgamma(10000,1,1) ## Selecting a median ranked set sample Mrss(data,m=4,r=5,sets=TRUE,type="m") ## Selecting an extreme ranked set sample Mrss(data,m=3,r=5,sets=TRUE,type="e") ## Selecting a percentile ranked set sample Mrss(data,m=4,r=3,sets=TRUE,type="p",p=0.2) ## Selecting a balanced groups ranked set sample Mrss(data,m=6,r=2,sets=TRUE,type="bg")
In this function, we introduce the RSS version of the Mann-Whitney-Wilcoxon (MWW) test.
mwwutestrss(X,Y,m,r,l,n,delta0=0,alpha=0.05,lambda=0.5,alternative="two.sided")
mwwutestrss(X,Y,m,r,l,n,delta0=0,alpha=0.05,lambda=0.5,alternative="two.sided")
X |
First obtained ranked set sample |
Y |
Second obtained ranked set sample |
m |
Set size which was used while sampling X |
r |
Cycles size which was used while sampling X |
l |
Set size which was used while sampling Y |
n |
Cycles size which was used while sampling Y |
delta0 |
The median value of difference in the null hypothesis. (By Default = 0) |
alpha |
The significance level (by default = 0.05). |
lambda |
constant in the variance formula of the test statistic, see Chen et. al.(2003) |
alternative |
Character string defining the alternative hypothesis, one of "two.sided", "less" or "greater" (by default = "two.sided") |
The test statistics and an approximate confidence intervals are constructed by using the normal approximation. Also note that, we assume that the ranking mechanism in the RSS is consistent. For more details please refer to Chen et. al.(2003, pg. 115-124).
There should be two datasets to compare as "X" and "Y", respectively.
medianX |
median value of the first sample |
medianY |
median value of the second sample |
MWW.test.mwwUrss |
The value of the Mann-Whitney-Wilcoxon test statistic |
C.I. |
the confidence interval of the Mann-Whitney-Wilcoxon test statistic |
z.test |
the z statistic for test |
p.value |
the p value for the test |
Chen, Z., Bai Z., Sinha B. K. (2003). Ranked Set Sampling: Theory and Application. New York: Springer.
library("LearnBayes") mu=c(1,1.2,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,2]) samplerss=con.rss(xx,xy,m=3,r=12,concomitant=TRUE) sample.x=as.numeric(samplerss$sample.x) sample.y=as.numeric(samplerss$sample.y) mwwutestrss(sample.x,sample.y,m=3,r=12,l=3,n=12,delta0=0)
library("LearnBayes") mu=c(1,1.2,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,2]) samplerss=con.rss(xx,xy,m=3,r=12,concomitant=TRUE) sample.x=as.numeric(samplerss$sample.x) sample.y=as.numeric(samplerss$sample.y) mwwutestrss(sample.x,sample.y,m=3,r=12,l=3,n=12,delta0=0)
The obsno.Mrss
function gives the observation numbers to sample from a target population by using modified ranked set sampling methods.
Ranking is done using the concomitant variable Y.
obsno.Mrss(Y,m,r=1,type="r",p)
obsno.Mrss(Y,m,r=1,type="r",p)
Y |
A vector of concomitant variable from target population |
m |
Size of units in each set |
r |
Number of cycles |
type |
type of the modified RSS method. "r" for traditional RSS, "p" for Percentile RSS, "m" for Median RSS, "bg" for Balanced Groups RSS, "e" for Extreme RSS. Default value is "r" |
p |
Value of percentile for Percentile RSS method |
Concomitant variable Y must be a vector.
McIntyre, G. A. (1952). A method for unbiased selective sampling, using ranked sets. Australian Journal of Agricultural Research, 3(4), 385-390.
Dell, T. R., & Clutter, J. L. (1972). Ranked set sampling theory with order statistics background. Biometrics, 28, 545-553.
Samawi, H. M., Ahmed, M. S., & Abu-Dayyeh, W. (1996). Estimating the population mean using extreme ranked set sampling. Biometrical Journal, 38(5), 577-586.
Muttlak, H. A. (1997). Median ranked set sampling. Journal of Applied Statistical Sciences, 6(4), 245-255.
Muttlak, H. A. (2003). Modified ranked set sampling methods. Pakistan Journal Of Statistics, 19(3), 315-324.
Jemain, A. A., Al-Omari, A., & Ibrahim, K. (2008). Some variations of ranked set sampling. Electronic Journal of Applied Statistical Analysis, 1(1), 1-15.
y=rexp(10000) ## Determining the observation numbers of the units which are chosen to sample y=rexp(10000) obsno.Mrss(y,m=3,r=5) obsno.Mrss(y,m=5,r=6,type="m") obsno.Mrss(y,m=7,r=3,type="e") obsno.Mrss(y,m=4,r=5,type="p",p=0.3) obsno.Mrss(y,m=6,r=2,type="bg")
y=rexp(10000) ## Determining the observation numbers of the units which are chosen to sample y=rexp(10000) obsno.Mrss(y,m=3,r=5) obsno.Mrss(y,m=5,r=6,type="m") obsno.Mrss(y,m=7,r=3,type="e") obsno.Mrss(y,m=4,r=5,type="p",p=0.3) obsno.Mrss(y,m=6,r=2,type="bg")
The rankedsets
function selects ranked sets from a target population. The selection of units in a set is without replacement, but the sets are selecting with replacement.
rankedsets(X,m,s=m)
rankedsets(X,m,s=m)
X |
A vector of target population |
m |
Size of units in each set |
s |
Number of sets. (by default = m) |
Target population X must be a vector.
It returns a matrix of ranked sets.
McIntyre, G. A. (1952). A method for unbiased selective sampling, using ranked sets. Australian Journal of Agricultural Research, 3(4), 385-390.
data=rexp(10000,3) ## Creating m by m matrix (a regular cycle) rankedsets(data,m=5) ## Creating m by s matrix rankedsets(data,m=3,s=5)
data=rexp(10000,3) ## Creating m by m matrix (a regular cycle) rankedsets(data,m=5) ## Creating m by s matrix rankedsets(data,m=3,s=5)
It obtains the regression estimator for mean of interested population based on ranked set sampling.
regRSS(X,Y,mu_Y)
regRSS(X,Y,mu_Y)
X |
An obtained ranked set sample for interested variable from target population |
Y |
An obtained ranked set sample for concomitant variable from target population |
mu_Y |
The known mean for population Y |
In this code, variable X and Y represents interested and concomitant variable, respectively, please note that notation is vice versa in the reference (Yu&Lam(1997)).
X and Y must be in same length.
B |
the B coefficient |
X_reg |
the regression estimate for mean of X based on ranked set sampling |
Yu, P.L.H. and Lam, K. (1997). "Regression Estimator in Ranked Set Sampling". Biometrics, Vol. 53, No. 3, pp. 1070-1080.
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,2]) samplerss=con.rss(xx,xy,m=4,r=8,sets=FALSE,concomitant=TRUE) sample.x=samplerss$sample.x sample.y=samplerss$sample.y regRSS(sample.x,sample.y,mu_Y=mean(xy))
library("LearnBayes") mu=c(1,12,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,2]) samplerss=con.rss(xx,xy,m=4,r=8,sets=FALSE,concomitant=TRUE) sample.x=samplerss$sample.x sample.y=samplerss$sample.y regRSS(sample.x,sample.y,mu_Y=mean(xy))
The Rrss
function samples from a target population by using robust ranked set sampling methods.
Rrss(X,m,r=1,type="l",sets=FALSE,alpha)
Rrss(X,m,r=1,type="l",sets=FALSE,alpha)
X |
A vector of target population |
m |
Size of units in each set |
r |
Number of cycles. (By default = 1) |
type |
type of the modified RSS method. "l" for L-RSS, "tb" for truncation-based RSS, "re" for robust extreme RSS. (By default = "l") |
sets |
logical; if TRUE, ranked set samples are given with ranked sets (see |
alpha |
Coefficient of the method |
Target population X must be a vector. Coefficient of the method must be between 0 and 0.5.
sets |
the ranked sets where ranked set sample is chosen from |
sample |
the obtained ranked set sample of X |
Al-Nasser, A. D. (2007). L ranked set sampling: A generalization procedure for robust visual sampling. Communications in Statistics-Simulation and Computation, 36(1), 33?43.
Al-Omari, A. I., & Raqab, M. Z. (2013). Estimation of the population mean and median using truncation-based ranked set samples. Journal of Statistical Computation and Simulation, 83(8), 1453?1471.
Al-Nasser, A. D., & Mustafa, A. B. (2009). Robust extreme ranked set sampling. Journal of Statistical Computation and Simulation, 79(7), 859?867.
data=rexp(10000) ## Selecting L-ranked set sample Rrss(data, m=8, r=3, sets=TRUE, alpha=0.2) ## Selecting Truncation-based ranked set sample Rrss(data, m=8, r=3, type="tb", sets=TRUE, alpha=0.1) ## Selecting Robust extreme ranked set sample Rrss(data, m=8, r=3, type="re", sets=TRUE, alpha=0.4)
data=rexp(10000) ## Selecting L-ranked set sample Rrss(data, m=8, r=3, sets=TRUE, alpha=0.2) ## Selecting Truncation-based ranked set sample Rrss(data, m=8, r=3, type="tb", sets=TRUE, alpha=0.1) ## Selecting Robust extreme ranked set sample Rrss(data, m=8, r=3, type="re", sets=TRUE, alpha=0.4)
The rss
function samples from a target population by using ranked set sampling method.
rss(X,m,r=1,sets=FALSE)
rss(X,m,r=1,sets=FALSE)
X |
A vector of target population |
m |
Size of units in each set |
r |
Number of cycles. (By default=1) |
sets |
logical; if TRUE, ranked set samples are given with ranked sets (see |
Target population X must be a vector.
sets |
randomly chosen ranked sets |
sample |
the obtained ranked set sample of X |
McIntyre, G. A. (1952). A method for unbiased selective sampling, using ranked sets. Australian Journal of Agricultural Research, 3(4), 385-390.
data=rnorm(10000,1,3) ## Selecting classical ranked set sample with set size \emph{m} and cycle size \emph{r} rss(data,m=5,r=3,sets=TRUE)
data=rnorm(10000,1,3) ## Selecting classical ranked set sample with set size \emph{m} and cycle size \emph{r} rss(data,m=5,r=3,sets=TRUE)
It performs the RSS version of the sign test given by Chen et. al.(2003).
sign1testrss(sampledata,m,r,median0,alpha=0.05,alternative="two.sided")
sign1testrss(sampledata,m,r,median0,alpha=0.05,alternative="two.sided")
sampledata |
An obtained ranked set sample |
m |
Number of units in each set (set size) |
r |
Number of cycles |
median0 |
The median value in the null hypothesis |
alpha |
The significance level (by default = 0.05). |
alternative |
Character string defining the alternative hypothesis, one of "two.sided", "less" or "greater" (by default = "two.sided") |
The test statistics and an approximate confidence intervals are constructed by using the normal approximation. Also note that, we assume that the ranking mechanism in the RSS is consistent. For more details please refer to Chen et. al.(2003, pg. 103-115).
median |
The median value of the given set |
sign.test.stat |
The value of the RSS sign test statistic |
C.I. |
the confidence interval for median |
z.test |
the z statistic for test |
p.value |
the p value for the test |
Chen, Z., Bai Z., Sinha B. K. (2003). Ranked Set Sampling: Theory and Application. New York: Springer.
data=rnorm(10000,0,1) samplerss=as.numeric(rss(data,m=3,r=12)) sign1testrss(samplerss,m=3,r=12,median0=0.5)
data=rnorm(10000,0,1) samplerss=as.numeric(rss(data,m=3,r=12)) sign1testrss(samplerss,m=3,r=12,median0=0.5)
The varRSS
function estimates the variance based on ranked set sampling as types of Stokes or Montip&Sukuman.
varRSS(X,m,r,type)
varRSS(X,m,r,type)
X |
An obtained ranked set sample |
m |
Size of units in each set |
r |
Number of cycles |
type |
character string, one of "Stokes" or "Montip". |
An obtained ranked set sample X must be m by r matrix. Stokes (1980) showed that estimator for variance is biased. Montip and Sukuman(2003) showed that for one cycle there is no unbiased estimator for variance but for more than one cycle they proposed unbiased estimator for variance.
var |
the estimated population variance based on ranked set sampling |
Al-Hadhrami, S.A. (2010). "Estimation of the Population Variance Using Ranked Set Sampling with Auxiliary Variable". Int. J. Contemp. Math. Sciences, Vol. 5, no. 52, 2567 - 2576.
Stokes, S.L. (1980). "Estimation of Variance Using Judgment Ordered Ranked Set Samples". Biometrics, Vol. 36, No. 1, pp. 35-42.
data=rnorm(10000,2,1) samplerss=rss(data,m=4,r=3,sets=FALSE) ## Estimation of variance based on ranked set sample by Stokes varRSS(samplerss,m=4,r=3,type="Stokes") ## Estimation of variance based on ranked set sample by Montip&Sukuman varRSS(samplerss,m=4,r=3,type="Montip")
data=rnorm(10000,2,1) samplerss=rss(data,m=4,r=3,sets=FALSE) ## Estimation of variance based on ranked set sample by Stokes varRSS(samplerss,m=4,r=3,type="Stokes") ## Estimation of variance based on ranked set sample by Montip&Sukuman varRSS(samplerss,m=4,r=3,type="Montip")
It performs the RSS version of the Wilcoxon signed rank test given by Chen et. al.(2003).
wsrtestrss(sampledata,m,r,delta0=0,alpha=0.05,alternative="two.sided")
wsrtestrss(sampledata,m,r,delta0=0,alpha=0.05,alternative="two.sided")
sampledata |
An obtained ranked set sample |
m |
Number of units in each set (set size) |
r |
Number of cycles |
delta0 |
The median value of difference in the null hypothesis |
alpha |
The significance level (by default = 0.05). |
alternative |
Character string defining the alternative hypothesis, one of "two.sided", "less" or "greater" (by default = "two.sided") |
The test statistics and an approximate confidence intervals are constructed by using the normal approximation. Also note that, we assume that the ranking mechanism in the RSS is consistent. For more details please refer to Chen et. al.(2003, pg. 124-133).
median |
median value of the sample |
sign.rank.test.stat |
The value of the Wilcoxon signed rank test statistic |
z.test |
the z statistic for test |
p.value |
the p value for the test |
Chen, Z., Bai Z., Sinha B. K. (2003). Ranked Set Sampling: Theory and Application. New York: Springer.
library("LearnBayes") mu=c(1,1.2,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,2]) samplerss=con.rss(xx,xy,m=3,r=12,concomitant=TRUE) sample.x=as.numeric(samplerss$sample.x) sample.y=as.numeric(samplerss$sample.y) difference=sample.x-sample.y wsrtestrss(difference,m=3,r=12,delta0=0)
library("LearnBayes") mu=c(1,1.2,2) Sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) x <- rmnorm(10000, mu, Sigma) xx=as.numeric(x[,1]) xy=as.numeric(x[,2]) samplerss=con.rss(xx,xy,m=3,r=12,concomitant=TRUE) sample.x=as.numeric(samplerss$sample.x) sample.y=as.numeric(samplerss$sample.y) difference=sample.x-sample.y wsrtestrss(difference,m=3,r=12,delta0=0)