trimci:

Usage Arguments Examples

Usage

1
trimci(x, tr = 0.2, alpha = 0.05, null.value = 0, pr = TRUE, nullval = NULL)

Arguments

x
tr
alpha
null.value
pr
nullval

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, tr = 0.2, alpha = 0.05, null.value = 0, pr = TRUE, 
    nullval = NULL) 
{
    if (pr) {
        print("The p-value returned by the this function is based on the")
        print("null value specified by the argument null.value, which defaults to 0")
        print("To get a measure of effect size using a Winsorized measure of scale,  use trimciv2")
    }
    if (!is.null(nullval)) 
        null.value = nullval
    x <- elimna(x)
    se <- sqrt(winvar(x, tr))/((1 - 2 * tr) * sqrt(length(x)))
    trimci <- vector(mode = "numeric", length = 2)
    df <- length(x) - 2 * floor(tr * length(x)) - 1
    trimci[1] <- mean(x, tr) - qt(1 - alpha/2, df) * se
    trimci[2] <- mean(x, tr) + qt(1 - alpha/2, df) * se
    test <- (mean(x, tr) - null.value)/se
    sig <- 2 * (1 - pt(abs(test), df))
    list(ci = trimci, estimate = mean(x, tr), test.stat = test, 
        se = se, p.value = sig, n = length(x))
  }

musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.