logreg.plot:

Usage Arguments Examples

Usage

1
logreg.plot(x, y, MLE = FALSE, ROB = TRUE, xlab = "X", ylab = "P(X)")

Arguments

x
y
MLE
ROB
xlab
ylab

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
##---- 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, y, MLE = FALSE, ROB = TRUE, xlab = "X", ylab = "P(X)") 
{
    if (is.matrix(x)) 
        x = x[, 1]
    xord = order(x)
    xx = x[xord]
    yy = y[xord]
    est1 = logreg(xx, yy)[1:2, 1]
    plot(xx, yy, xlab = xlab, ylab = ylab)
    phat = exp(est1[1] + est1[2] * xx)/(1 + exp(est1[1] + est1[2] * 
        xx))
    if (MLE) 
        lines(xx, phat)
    if (ROB) {
        est2 = wlogreg(xx, yy)$coef[1:2]
        phat2 = exp(est2[1] + est2[2] * xx)/(1 + exp(est2[1] + 
            est2[2] * xx))
        lines(xx, phat2, lty = 2)
    }
  }

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