View source: R/reportSeverity.R
| spotSeverity | R Documentation |
spotSeverity
spotSeverity(xbar, mu0, mu1, n, sigma, alpha, tdist = FALSE, paired = TRUE)
xbar |
sample mean value |
mu0 |
mean value of the null hypothesis (usually referred to as H0) |
mu1 |
mean value of the alternative hypothesis (usually referred to as H1) |
n |
sample size in each arm, e.g., if 20 samples are available, then |
sigma |
sample s.d. Will be used to determine s.d. of the differences (if
|
alpha |
probability of a type I error, given H0 is true |
tdist |
logical. Use Student t Distribution. Default: FALSE |
paired |
logical. Paired (blocked) data. Default: TRUE |
an object of class "spotSeverity",
with a summary method and a print method.
s0 <- spotSeverity(xbar=0.4, mu0=0.0, mu1=0.6, n=25, sigma=1, alpha=0.03)
print(s0)
s1 <- spotSeverity(xbar=0.4, mu0=0.6, mu1=0.6, n=25, sigma=1, alpha=0.03)
print(s1)
s2 <- spotSeverity(xbar=0, mu0=0.6, mu1=0.6, n=25, sigma=1, alpha=0.03)
print(s2)
## Example from Mayo, p345
spotSeverity(xbar=90, mu0=0, mu1= 200, n=200, sigma = 450, alpha = 0.025,
paired = FALSE, tdist = FALSE)
## Example from Vena02a to compare with results from t.test()
## library("BHH2")
## data(shoes.data)
## A <- shoes.data$matA
## B <- shoes.data$matB
A <- c(13.2, 8.2, 10.9, 14.3, 10.7, 6.6, 9.5, 10.8, 8.8, 13.3)
B <- c(14, 8.8, 11.2, 14.2, 11.8, 6.4, 9.8, 11.3, 9.3, 13.6)
t.paired <- t.test(x = A, y = B, var.equal = TRUE, paired = TRUE,
alternative = "greater", conf.level = 0.95)
xbar <- mean(A-B)
n <- length(A)
sigma <- sd(A-B)
s.paired <- spotSeverity(xbar=xbar,mu0=0, mu1= 1, n=n, sigma = sigma,
alpha = 0.025, tdist = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.