Lecture 39 (lab 10)—March 28, 2006

What was covered?

R functions and commands demonstrated

R packages used

Multiple logistic regression

> #obtain data
> library(DAAG)
> data(frogs)
> names(frogs)
[1] "pres.abs" "northing" "easting" "altitude" "distance"
[6] "NoOfPools" "NoOfSites" "avrain" "meanmin" "meanmax" )

> fullmodel<-glm(pres.abs~altitude + distance + NoOfPools + NoOfSites + avrain + meanmin + meanmax, data=frogs, family=binomial)
> summary(fullmodel)

Call:
glm(formula = pres.abs ~ altitude + distance + NoOfPools + NoOfSites +
    avrain + meanmin + meanmax, family = binomial, data = frogs)

Deviance Residuals:
    Min      1Q  Median     3Q    Max
-1.7215 -0.7590 -0.2237 0.8320 2.6789

Coefficients:
             Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.105e+02  1.388e+02   0.796 0.42587
altitude   -3.086e-02  4.076e-02  -0.757 0.44901
distance   -4.800e-04  2.055e-04  -2.336 0.01949 *
NoOfPools   2.986e-02  9.276e-03   3.219 0.00129 **
NoOfSites   4.364e-02  1.061e-01   0.411 0.68077
avrain     -1.140e-02  5.995e-02  -0.190 0.84920
meanmin     4.899e+00  1.564e+00   3.133 0.00173 **
meanmax    -5.660e+00  5.049e+00  -1.121 0.26224
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 279.99 on 211 degrees of freedom
Residual deviance: 198.74 on 204 degrees of freedom
AIC: 214.74

Number of Fisher Scoring iterations: 6

# fit reduced model
> model1<-glm(pres.abs~distance+NoOfPools+meanmin, data=frogs, family=binomial)
# compare full and reduced models
> anova(fullmodel,model1,test='Chisq')

Analysis of Deviance Table

Model 1: pres.abs ~ altitude + distance + NoOfPools + NoOfSites + avrain +
   meanmin + meanmax
Model 2: pres.abs ~ distance + NoOfPools + meanmin
  Resid. Df Resid. Dev Df Deviance P(>|Chi|)
1       204    198.738
2       208    216.104 -4  -17.365    0.002

> model2<-glm(pres.abs~distance+NoOfPools+meanmin+meanmax, data=frogs, family=binomial)
> anova(fullmodel, model2, test='Chisq')

Analysis of Deviance Table

Model 1: pres.abs ~ altitude + distance + NoOfPools + NoOfSites + avrain +
   meanmin + meanmax
Model 2: pres.abs ~ distance + NoOfPools + meanmin + meanmax
Resid. Df Resid. Dev Df Deviance P(>|Chi|)
1     204    198.738
2     207    199.627 -3   -0.889     0.828

> summary(model2)

Call:
glm(formula = pres.abs ~ distance + NoOfPools + meanmin + meanmax,
    family = binomial, data = frogs)

Deviance Residuals:
    Min      1Q  Median     3Q    Max
-1.7457 -0.7637 -0.2000 0.8570 2.9552

Coefficients:
              Estimate Std. Error z value Pr(>|z|)
(Intercept) 14.0074032  4.9264854   2.843 0.004465 **
distance    -0.0005138  0.0001875  -2.741 0.006132 **
NoOfPools    0.0285643  0.0089138   3.204 0.001353 **
meanmin      5.6230647  1.2140742   4.632 3.63e-06 ***
meanmax     -2.3717579  0.6246508  -3.797 0.000146 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 279.99 on 211 degrees of freedom
Residual deviance: 199.63 on 207 degrees of freedom
AIC: 209.63

Number of Fisher Scoring iterations: 6

> cor(frogs$meanmax, cbind(frogs$altitude, frogs$avrain, frogs$NoOfSites))
          [,1]       [,2]       [,3]
[1,] -0.996557 -0.8186997 0.1576344

Observe that the correlation of meanmax with either altitude or avrain is quite high (and negative). This suggests that we could replace meanmax with either of these two variables and not change things very much. I try this with each variable in turn.

> model2.1<-glm(pres.abs~distance + NoOfPools + meanmin + avrain, data=frogs, family=binomial)
> model2.2<-glm(pres.abs~distance + NoOfPools + meanmin + altitude, data=frogs, family=binomial)
> summary(model2.1)

Call:
glm(formula = pres.abs ~ distance + NoOfPools + meanmin + avrain,
   family = binomial, data = frogs)

Deviance Residuals:
    Min      1Q  Median     3Q    Max
-1.7866 -0.7884 -0.2708 0.8342 2.8787

Coefficients:
              Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.036e+01  4.844e+00  -4.204 2.62e-05 ***
distance    -5.346e-04  1.779e-04  -3.005 0.002654 **
NoOfPools    2.763e-02  8.704e-03   3.174 0.001501 **
meanmin      2.515e+00  4.926e-01   5.106 3.30e-07 ***
avrain       7.966e-02  2.320e-02   3.435 0.000594 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 279.99 on 211 degrees of freedom
Residual deviance: 202.78 on 207 degrees of freedom
AIC: 212.78

Number of Fisher Scoring iterations: 6

> summary(model2.2)

Call:
glm(formula = pres.abs ~ distance + NoOfPools + meanmin + altitude,
   family = binomial, data = frogs)

Deviance Residuals:
    Min      1Q  Median     3Q    Max
-1.7468 -0.7798 -0.2253 0.8882 3.1010

Coefficients:
              Estimate Std. Error z value Pr(>|z|)
(Intercept) -5.427e+01  1.428e+01  -3.801 0.000144 ***
distance    -5.187e-04  1.878e-04  -2.761 0.005756 **
NoOfPools    2.707e-02  8.717e-03   3.105 0.001900 **
meanmin      6.039e+00  1.412e+00   4.277 1.90e-05 ***
altitude     2.235e-02  6.336e-03   3.527 0.000420 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 279.99 on 211 degrees of freedom
Residual deviance: 201.76 on 207 degrees of freedom
AIC: 211.76

Number of Fisher Scoring iterations: 6

> sapply(list(model2,model2.1,model2.2),AIC)
[1] 209.6275 212.7838 211.7601

Based on AIC model2, the model in which meanmax is added, rates best.

> cor(frogs$meanmin, frogs$meanmax)
[1] 0.9462741

We'll examine later whether keeping such highly correlated variables in the same model is an asset or a liability.

Assessing the structural form of the model

The proper structural form for meanmin

> library(Design)
> rcspline.plot(y=frogs$pres.abs, x=frogs$meanmin, nk=5, m=20)
> mtext(side=1, line=2.5, 'meanmin')

The structural form for meanmax

> rcspline.plot(y=frogs$pres.abs, x=frogs$meanmax, nk=5, m=20)
> mtext(side=1, line=2.5, 'meanmax')

> model2a<-glm(pres.abs~distance + NoOfPools + meanmin + meanmax + I(meanmin^2) + I(meanmax^2), data=frogs, family=binomial)
> summary(model2a)

Call:
glm(formula = pres.abs ~ distance + NoOfPools + meanmin
  + meanmax + I(meanmin^2) + I(meanmax^2),
  family = binomial, data = frogs)

Deviance Residuals:
    Min      1Q  Median     3Q    Max
-1.9675 -0.7414 -0.2758 0.7764 2.8252

Coefficients:
               Estimate Std. Error z value Pr(>|z|)
(Intercept)  -1.112e+02  6.673e+01  -1.666 0.095623 .
distance     -5.295e-04  1.914e-04  -2.767 0.005659 **
NoOfPools     3.173e-02  9.576e-03   3.314 0.000921 ***
meanmin      -5.460e+00  9.722e+00  -0.562 0.574382
meanmax       1.793e+01  1.158e+01   1.549 0.121424
I(meanmin^2)  1.640e+00  1.578e+00   1.040 0.298567
I(meanmax^2) -7.144e-01  4.196e-01  -1.702 0.088673 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 279.99 on 211 degrees of freedom
Residual deviance: 195.01 on 205 degrees of freedom
AIC: 209.01

Number of Fisher Scoring iterations: 6

> anova(model2, model2a, test='Chisq')
Analysis of Deviance Table

Model 1: pres.abs ~ distance + NoOfPools + meanmin + meanmax
Model 2: pres.abs ~ distance + NoOfPools + meanmin + meanmax + I(meanmin^2) + I(meanmax^2)
  Resid. Df Resid. Dev Df Deviance P(>|Chi|)
1       207    199.627
2       205    195.012  2    4.616    0.099

> sapply(list(model2,model2a),AIC)
[1] 209.6275 209.0118

So the AIC values are barely distinguishable from each other. So, contrary to what we saw in the spline plots the statistical evidence for including quadratic terms is fairly weak. Why the discrepancy? One problem is that in fitting the spline models we are treating the variables in isolation. We've already seen that meanmax and meanmin are highly correlated.

> model2b<-glm(pres.abs ~ distance + NoOfPools + meanmin +I(meanmin^2), family = binomial, data = frogs)
> model2c<-glm(pres.abs ~ distance + NoOfPools + meanmax +I(meanmax^2), family = binomial, data = frogs)
> sapply(list(model2,model2b,model2c),AIC)

[1] 209.6275 213.8477 222.8593

The model linear in both meanmin and meanmax still ranks best. So contrary to our conclusions in lab 9 and the spline plots, we don't need quadratic terms.

The structural form for distance

> rcspline.plot(y=frogs$pres.abs,x=frogs$distance,nk=5,m=20)
singular information matrix in lrm.fit (rank= 4 ). Offending variable(s):
Error in array(x, c(length(x), 1), if (!is.null(names(x))) list(names(x), :
attempt to set an attribute on NULL

> rcspline.plot(y=frogs$pres.abs,x=frogs$distance,nk=4,m=20)
> mtext(side=1,line=2.5,'distance')
#log transform
> rcspline.plot(y=frogs$pres.abs,x=log(frogs$distance),nk=4,m=20)
> mtext(side=1,line=2.5,'log(distance)')

     

Fig. 3  Spline plots for untransformed and log-transformed distance

> model3<-glm(pres.abs~log(distance) + NoOfPools + meanmin + meanmax, data=frogs, family=binomial)
> sapply(list(model2,model3),AIC)

[1] 209.6275 205.1332

The structural form for NoOfPools

> rcspline.plot(y=frogs$pres.abs, x=frogs$NoOfPools, nk=5, m=20)
> mtext(side=1, line=2.5, 'NoOfPools')
#check log transform since used in thesis
> rcspline.plot(y=frogs$pres.abs, x=log(frogs$NoOfPools), nk=5, m=20)
> mtext(side=1, line=2.5, 'log(NoOfPools)')

       

Fig. 4  Spline plot for untransformed and log-transformed NoOfPools

> model3b<-glm(pres.abs~log(distance) + log(NoOfPools) + meanmin + meanmax, data=frogs, family=binomial)
> sapply(list(model3,model3b), AIC)

[1] 205.1332 207.6561

Including interaction terms—stepwise methods


> library(MASS)
> stepAIC(model3, scope=list(upper=~log(distance)*NoOfPools*meanmin*meanmax, lower=~1))

Start: AIC= 205.13
pres.abs ~ log(distance) + NoOfPools + meanmin + meanmax

                          Df Deviance    AIC
+ log(distance):meanmin    1   189.05 201.05
+ log(distance):meanmax    1   191.55 203.55
+ log(distance):NoOfPools  1   192.03 204.03
+ meanmin:meanmax          1   192.79 204.79
<none>                         195.13 205.13
+ NoOfPools:meanmax        1   194.94 206.94
+ NoOfPools:meanmin        1   194.97 206.97
- NoOfPools                1   205.34 213.34
- log(distance)            1   209.73 217.73
- meanmax                  1   211.42 219.42
- meanmin                  1   219.97 227.97

<output deleted>

Call: glm(formula = pres.abs ~ log(distance) + NoOfPools + meanmin + meanmax + log(distance):meanmin + meanmin:meanmax, family = binomial, data = frogs)

Coefficients:
    (Intercept)         log(distance)       NoOfPools  meanmin
      -50.71310               3.20271         0.03128 25.38805
        meanmax log(distance):meanmin meanmin:meanmax
        0.82240              -1.22059        -0.86433

Degrees of Freedom: 211 Total (i.e. Null); 205 Residual
Null Deviance:      280
Residual Deviance: 183 AIC: 197

> model4<-glm(formula = pres.abs ~ log(distance) + NoOfPools + meanmin + meanmax + log(distance):meanmin + meanmin:meanmax, family = binomial, data = frogs)
> summary(model4)

Call:
glm(formula = pres.abs ~ log(distance) + NoOfPools + meanmin +
    meanmax + log(distance):meanmin + meanmin:meanmax, family = binomial,
    data = frogs)

Deviance Residuals:
    Min      1Q  Median     3Q    Max
-2.2805 -0.6141 -0.2764 0.6753 2.4552

Coefficients:
                        Estimate Std. Error z value Pr(>|z|)
(Intercept)            -50.71310   24.52294  -2.068 0.038641 *
log(distance)            3.20271    1.29544   2.472 0.013425 *
NoOfPools                0.03128    0.00954   3.279 0.001043 **
meanmin                 25.38805    6.77238   3.749 0.000178 ***
meanmax                  0.82240    1.65155   0.498 0.618517
log(distance):meanmin   -1.22059    0.40565  -3.009 0.002621 **
meanmin:meanmax         -0.86433    0.37292  -2.318 0.020462 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 279.99 on 211 degrees of freedom
Residual deviance: 183.03 on 205 degrees of freedom
AIC: 197.03

Number of Fisher Scoring iterations: 5

Goodness of Fit

> y.cuts<-cut(predict(model3), quantile(predict(model3), seq(0,1,.1)), include.lowest=TRUE)
> y.1<-tapply(fitted(model3),y.cuts,sum)
> y.n<-tapply(fitted(model3),y.cuts,length)
> y.0<-y.n-y.1
> Oi<-table(frogs$pres.abs,y.cuts)
> Ei<-rbind(y.0,y.1)
> Oi

y.cuts
  [-5.95,-3.84] (-3.84,-2.53] (-2.53,-1.87] (-1.87,-1.25] (-1.25,-0.686] (-0.686,-0.186]
0            22            17            20            18             17              13
1             0             4             1             3              4               8
y.cuts
  (-0.186,0.277] (0.277,0.647] (0.647,1.4] (1.4,6.99]
0             12             9           2          3
1              9            12          19         19

> Ei
    [-5.95,-3.84] (-3.84,-2.53] (-2.53,-1.87] (-1.87,-1.25] (-1.25,-0.686] (-0.686,-0.186]
y.0    21.7878765    20.0209707     18.854612     17.396798      14.913822       12.535826
y.1     0.2121235     0.9790293      2.145388      3.603202       6.086178        8.464174
   (-0.186,0.277] (0.277,0.647] (0.647,1.4] (1.4,6.99]
y.0      10.35678      8.158018    5.987189   2.988109
y.1      10.64322     12.841982   15.012811  19.011891

> Ei.new<-cbind(Ei[,1]+Ei[,2]+Ei[,3]+Ei[,4],Ei[,5:10])
> Ei.new

             (-1.25,-0.686] (-0.686,-0.186] (-0.186,0.277] (0.277,0.647] (0.647,1.4] (1.4,6.99]
y.0 78.060257     14.913822       12.535826       10.35678      8.158018    5.987189   2.988109
y.1  6.939743      6.086178        8.464174       10.64322     12.841982   15.012811  19.011891

> Oi.new<-cbind(Oi[,1]+Oi[,2]+Oi[,3]+Oi[,4],Oi[,5:10])
> sum((Oi.new-Ei.new)^2/Ei.new)

[1] 5.596732
> 1-pchisq(sum((Oi.new-Ei.new)^2/Ei.new),5)
[1] 0.3474554

> out.h<-lrm( pres.abs ~ log(distance) + NoOfPools + meanmin + meanmax,data=frogs,x=TRUE,y=TRUE)
> residuals.lrm(out.h,type='gof')

Sum of squared errors Expected value|H0         SD           Z
          31.14031539       32.31699406 0.51671399 -2.27723399
         P
0.02277226

The results from this test disagree with our conclusions above. The p-value suggests that there may be lack of fit.

> out.h2<-lrm( pres.abs ~ log(distance) + NoOfPools + meanmin + meanmax+log(distance):meanmin+meanmin:meanmax, data=frogs, x=TRUE, y=TRUE)
> residuals.lrm(out.h2,type='gof')
Sum of squared errors Expected value|H0        SD          Z
           29.2178830        29.4623453 0.4771416 -0.5123474
                    P
            0.6084079

> y.cuts<-cut(predict(model4), quantile(predict(model4), seq(0,1,.1)),
include.lowest=TRUE)
> y.1<-tapply(fitted(model4),y.cuts,sum)
> y.n<-tapply(fitted(model4),y.cuts,length)
> y.0<-y.n-y.1
> Oi<-table(frogs$pres.abs,y.cuts)
> Ei<-rbind(y.0,y.1)
> Ei

    [-4.19,-3.33] (-3.33,-2.7] (-2.7,-2.09] (-2.09,-1.58] (-1.58,-0.876]
y.0    21.3972477   20.0584396    19.146099     18.113064      16.233116       
y.1     0.6027523    0.9415604     1.853901      2.886936       4.766884       
    (-0.876,-0.294](-0.294,0.191] (0.191,1.01] (1.01,1.67] (1.67,8.3]
y.0      13.345059       10.60849     7.546274    4.535015   2.017197
y.1       7.654941       10.39151    13.453726   16.464985  19.982803

> Ei.new<-cbind(Ei[,1]+Ei[,2]+Ei[,3]+Ei[,4], Ei[,5:8], Ei[,9]+Ei[,10])
> Ei.new
             (-1.58,-0.876] (-0.876,-0.294] (-0.294,0.191] (0.191,1.01]
y.0 78.71485      16.233116       13.345059       10.60849     7.546274  6.552212
y.1  6.28515       4.766884        7.654941       10.39151    13.453726 36.447788

> Oi.new<-cbind(Oi[,1]+Oi[,2]+Oi[,3]+Oi[,4], Oi[,5:8], Oi[,9]+Oi[,10])
> 1-pchisq(sum((Oi.new-Ei.new)^2/Ei.new),4)

[1] 0.3352193

Model Calibration

Sensitivity and specificity

> library(ROCR)
> pred<-prediction(fitted(model3), frogs$pres.abs)

Fig. 5   Sensitivity and specificity for main effect model

> performance(pred, 'tpr', 'tnr')->testy

testy@alpha.values[[1]].

The following code plots specificity and sensitivity against the cutoffs.

> plot(testy@alpha.values[[1]], testy@x.values[[1]], type='n', xlab='c',
ylab='sensitivity or specificity')
> lines(testy@alpha.values[[1]], testy@y.values[[1]])
> lines(testy@alpha.values[[1]], testy@x.values[[1]],col=2)
> legend(.8,.8, c('sensitivity', 'specificity'), lty=c(1,1), col=1:2, cex=c(.9,.9), bty='n')

> tempmat<-cbind(testy@x.values[[1]], testy@y.values[[1]], testy@alpha.values[[1]])
> tempmat[abs(tempmat[,1]-tempmat[,2])<.02,]->submat
> submat

           [,1]      [,2]      [,3]
[1,] 0.7894737 0.7721519 0.4381193
[2,] 0.7819549 0.7721519 0.4374489
[3,] 0.7819549 0.7848101 0.4350874
[4,] 0.7819549 0.7974684 0.4332186

> submat[2,3] + (submat[2,1] - submat[2,2])/(submat[3,2] - submat[2,2]) * (submat[3,3] - submat[2,3])
[1] 0.4356201

ROC curves

> perf <- performance(pred,"tpr","fpr")
> plot(perf)

> library(Epi)
> attach(frogs)
> ROC(form=pres.abs~log(distance)+NoOfPools+meanmin+meanmax, plot="ROC")

    

Fig. 6  ROC curves from the ROCR and Epi packages, respectively

 
Observed
 
Yi = 1 Yi = 0

Predicted
(using decision rule)

A
C
A+C
B
D
B+D
 
A+B
C+D
A+B+C+D

You should contrast this with the definition of sensitivity and specificity given in Lecture 37.

Area under the curve (AUC)

> lrm(pres.abs~log(distance) + NoOfPools + meanmin + meanmax, data=frogs)

Logistic Regression Model

lrm(formula = pres.abs ~ log(distance) + NoOfPools + meanmin +
   meanmax, data = frogs)

Frequencies of Responses
  0  1
133 79

  Obs Max Deriv Model L.R. d.f. P     C   Dxy Gamma
  212     1e-05      84.85    4 0 0.856 0.712 0.712
Tau-a        R2      Brier
0.334      0.45      0.147

          Coef    S.E.      Wald Z P
Intercept 19.64372 5.289504   3.71 0.0002
distance  -0.80747 0.223489  -3.61 0.0003
NoOfPools  0.02728 0.009059   3.01 0.0026
meanmin    5.50919 1.228085   4.49 0.0000
meanmax   -2.40129 0.634164  -3.79 0.0002

Cross-validation

> cv.binary(model3)

Fold: 8 10 3 5 2 1 9 7 4 6
Internal estimate of accuracy = 0.792
Cross-validation estimate of accuracy = 0.778

> cost<-function(r,pi=0) mean(abs(r-pi)>0.5)
> cv.glm(frogs,model3,cost,K=10)->out
> names(out)

[1] "call" "K" "delta" "seed"
> out$delta
1         1
0.2169811 0.2215646

Cross-validation for ROC curves

my.cvfunc<-function (obj = frogs.glm, rand = NULL, nfolds = 10, print.details = TRUE, seed=NULL)
{
data <- obj$data
m <- dim(data)[1]
if (is.null(seed))
{
if (is.null(rand))
rand <- sample(nfolds, m, replace = TRUE)
}
else {
set.seed(seed)
if (is.null(rand))
rand <- sample(nfolds, m, replace = TRUE)
}

form <- formula(obj)
yvar <- all.vars(form)[1]
obs <- data[, yvar]
ival <- unique(rand)
fam <- obj$family$family
hat <- predict(glm(form, data, family = fam), type = "response")
cvhat <- rep(0, length(rand))
if (print.details)
cat("\nFold: ")
my.out<-vector("list",nfolds)
my.y<-vector("list",nfolds)

for (i in ival) {
if (print.details)
cat("", i)
if (i%%20 == 0)
cat("\n")
here <- i != rand
i.glm <- glm(form, data = data[here, ], family = fam)
cvhat[!here] <- predict(i.glm, newdata = data[!here,
], family = fam, type = "response")
my.out[[i]]<-cvhat[!here]
my.y[[i]]<-data[!here,yvar]

}
list(my.out,my.y)
}

> testit<-my.cvfunc(model3,seed=10)

> pred<-prediction(testit[[1]], testit[[2]])
> perf<-performance(pred,"tpr", "fpr")
> plot(perf,col="grey82",lty=3)
> plot(perf,lwd=1,avg="vertical", spread.estimate="boxplot", add=TRUE)
> abline(0,1,col=4,lty=3)
> mtext('Model 3',side=3,line=.5, font=2)

> testit<-my.cvfunc(model4,seed=10)
> pred<-prediction(testit[[1]], testit[[2]])
> perf<-performance(pred,"tpr","fpr")
> plot(perf,col="grey82", lty=3)
> plot(perf,lwd=1, avg="vertical", spread.estimate="boxplot", add=TRUE)
> abline(0,1,col=4,lty=3)
> mtext('Model 4',side=3,line=.5,font=2)

     

Fig. 7  Cross-validation ROC curves for models 3 and 4

Cited References

Course Home Page


Jack Weiss
Phone: (919) 962-5930
E-Mail: jack_weiss@unc.edu
Address: Curriculum in Ecology, Box 3275, University of North Carolina, Chapel Hill, 27516
Copyright © 2006
Last Revised--April 10, 2006
URL: http://www.unc.edu/courses/2006spring/ecol/145/001/docs/lectures/lecture39.htm