View source: R/conditionalCI.R
conditionalCI | R Documentation |
Conditional confidence intervals for normally distributed random variables.
conditionalCI(
theta,
threshold,
sigma = 1,
conf.level = 0.95,
df = NULL,
method = "shortest",
distribution = "gaussian",
trace = length(theta) > 1,
...
)
theta |
[numeric vector] the observed value(s) of the statistic. |
threshold |
[numeric, >0] the threshold. |
sigma |
[numeric vector] the standard error of the statistic(s). |
conf.level |
[numeric, 0-1] Conditional confidence level of the interval. |
df |
[interger, >0] Degree of freedom of the distribution of theta.
Only relevant when distribution equals |
method |
[character] the method used to compute the conditional confidence interval.
So far only |
distribution |
[character] Distribution of theta.
Either |
trace |
[interger, 0-2] should a progress bar be displayed? |
... |
additional arguments to be passed to |
Compute the confidence interval of theta conditional on theta being greater (in absolute value) than the threshold. theta is assumed to be normally distributed with known variance sigma. The thresholding is applied after normalization (i.e. dividing theta by sigma). This corresponding to conditioning on a minimal significance level.
ci <- conditionalCI(theta = seq(3,7, by = 0.1),
threshold = 2.9999, distribution = "gaussian")
print(ci)
confint(ci)
autoplot(ci)
ci1 <- conditionalCI(theta = 4, sigma = 2, threshold = 2.9999, method = "shortest")
ci2 <- conditionalCI(theta = 4/2, sigma = 1, threshold = 2.9999/2, method = "shortest")
confint(ci1) - 2*confint(ci2)
ci3 <- conditionalCI(theta = 4, sigma = 2, threshold = 2.9999, method = "shortest2")
confint(ci1) - confint(ci3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.