old.cell: Old confidence ellipse

Usage Arguments Examples

Usage

1
old.cell(model, which.coef, levels = 0.95, Scheffe = FALSE, dfn = 2, center.pch = 19, center.cex = 1.5, segments = 51, xlab, ylab, las = par("las"), col = palette()[2], lwd = 2, lty = 1, add = FALSE, ...)

Arguments

model
which.coef
levels
Scheffe
dfn
center.pch
center.cex
segments
xlab
ylab
las
col
lwd
lty
add
...

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
##---- 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 (model, which.coef, levels = 0.95, Scheffe = FALSE, 
    dfn = 2, center.pch = 19, center.cex = 1.5, segments = 51, 
    xlab, ylab, las = par("las"), col = palette()[2], lwd = 2, 
    lty = 1, add = FALSE, ...) 
{
    help <- "\nSee help for car::confidence.ellipse.lm\nexcept that 'cell' returns the points to form the ellipse\nwhich must be plotted with plot(...,type='l') or lines(...)\n-- Use dfn to determine Sheffe dimension, i.e. dfn = 1 to generate ordinary CIs, dfn = 2 for 2-dim CE, etc.\n"
    require(car)
    which.coef <- if (length(coefficients(model)) == 2) 
        c(1, 2)
    else {
        if (missing(which.coef)) {
            if (has.intercept(model)) 
                c(2, 3)
            else c(1, 2)
        }
        else which.coef
    }
    coef <- coefficients(model)[which.coef]
    xlab <- if (missing(xlab)) 
        paste(names(coef)[1], "coefficient")
    ylab <- if (missing(ylab)) 
        paste(names(coef)[2], "coefficient")
    if (missing(dfn)) {
        if (Scheffe) 
            dfn <- sum(df.terms(model))
        else 2
    }
    dfd <- df.residual(model)
    shape <- vcov(model)[which.coef, which.coef]
    ret <- numeric(0)
    for (level in rev(sort(levels))) {
        radius <- sqrt(dfn * qf(level, dfn, dfd))
        ret <- rbind(ret, c(NA, NA), ell(coef, shape, radius))
    }
    colnames(ret) <- c(xlab, ylab)
    ret
  }

gmonette/spida documentation built on May 17, 2019, 7:25 a.m.