Title: | Distribution-Free Confidence Region |
---|---|
Description: | Constructs confidence regions without the need to know the sampling distribution of bivariate data. The method was proposed by Zhiqiu Hu & Rong-cai Yang (2013) <doi:10.1371/journal.pone.0081179.g001>. |
Authors: | Zhiqiu Hu, Rong-cai Yang |
Maintainer: | Zhiqiu Hu <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.5.1 |
Built: | 2024-12-16 06:36:58 UTC |
Source: | CRAN |
The disfree.cr package was developed to implement a novel geometry-based method introduced by Zhiqiu Hu and Rong-cai Yang for constructing confidence regions without the need to know the sampling distribution of estimated parameters for two or more variables.
Package: | distfree.cr |
Type: | Package |
Version: | 1.0 |
Date: | 2012-11-23 |
License: | GPL (>2.0) |
Zhiqiu Hu and Rong-cai Yang
Maintainer: Zhiqiu Hu <[email protected]>
Constructs empirical confidence regions for bivariate data based on the method proposed by Zhiqiu Hu and Rong-cai Yang(2013) <doi:10.1371/journal.pone.0081179.g001>.
distfree.cr(x, y, alpha = 0.05, alpha.min.diff = 0.5/NROW(x), nknots = 40, xlab = deparse(substitute(x)), ylab = deparse(substitute(y)), col = c("red", "black", "gray"), draw = T)
distfree.cr(x, y, alpha = 0.05, alpha.min.diff = 0.5/NROW(x), nknots = 40, xlab = deparse(substitute(x)), ylab = deparse(substitute(y)), col = c("red", "black", "gray"), draw = T)
x |
numeric vector, of dimensions nobs * 1. If a data frame or a two-column numeric matrix of x and y is supplied here, the second option |
y |
numeric vector, of dimensions nobs * 1. This option needs to be ignored if users provided both x and y in the first option of the function. |
alpha |
Significant level. By default |
alpha.min.diff |
minimum difference is allowed for calculating confidence region. This option is not suggested for most users. The default value is set to be |
nknots |
number of knots that will be used to enclose the confidence region. The default value |
xlab |
define the label of x axis of the plot. |
ylab |
define the label of y axis of the plot. |
col |
define colors of the scatter points and lines of the plot. The default setting |
draw |
a logical indicator. Users may disable plotting by setting the option to |
This function constructs a distribution-free confidence region based on the method proposed by Zhiqiu Hu and Rong-cai Yang.
alpha.realized |
Realized-alpha, which is defined as the proportion of the total points outside the confidence region. |
polygon |
'data.frame' of x,y providing the apexes of the lines. |
polygon.smooth1 |
'data.frame' of x,y providing the apexes of the smoothed polygon 1. |
polygon.smooth2 |
'data.frame' of x,y providing the apexes of the smoothed polygon 2. |
data |
'data.frame', of dimension nobs * 3, the first two columns are input data of x and y values and the third column |
alpha , xlab , ylab , col
|
values assigned by users. |
A smooth confidence region can be achieved by setting up a big number for input variable nknots, and this in turn requires large sample sizes.
Zhiqiu Hu and Rong-cai Yang
library(distfree.cr) dat=data.frame(x=c(rnorm(3000), rnorm(3000, mean=1, sd=2.5)), y=c(rnorm(3000), rnorm(3000, mean=1, sd=2.5))) pt=distfree.cr(dat, draw=TRUE, alpha=0.05) pt=distfree.cr(x=dat$x, y=dat$y, draw=FALSE) plot(pt)
library(distfree.cr) dat=data.frame(x=c(rnorm(3000), rnorm(3000, mean=1, sd=2.5)), y=c(rnorm(3000), rnorm(3000, mean=1, sd=2.5))) pt=distfree.cr(dat, draw=TRUE, alpha=0.05) pt=distfree.cr(x=dat$x, y=dat$y, draw=FALSE) plot(pt)
Plot an object that is returned by the distfree.cr function.
## S3 method for class 'distfree.cr' plot(x, show.points = T, ...)
## S3 method for class 'distfree.cr' plot(x, show.points = T, ...)
x |
An object returned by the distfree.cr function. |
show.points |
A logical indicator of whether or not the original data are plotted. |
... |
Other parameters that can be passed to the |