S-PLUS : Copyright (c) 1988, 2001 Insightful Corp. S : Copyright Lucent Technologies, Inc. Professional Edition Version 6.0.2 Release 1 for Microsoft Windows : 2001 Working data will be in F:\Programs\Insightful\Splus6\users\bj20 > names(prdata) [1] "Col1" "Col2" "Col3" "Col4" "Col5" "Col6" "Col7" "Col8" "Col9" [10] "Col10" "Col11" "Col12" "Col13" "Col14" > names(prdata) _ scan() 1: age 2: sex 3: smokstat 4: quetelet 5: vituse 6: calories 7: fat 8: fiber 9: alcohol 10: cholesterol 11: betadiet 12: retdiet 13: betaplasma 14: retplasma 15: > names(prdata) [1] "age" "sex" "smokstat" "quetelet" "vituse" [6] "calories" "fat" "fiber" "alcohol" "cholesterol" [11] "betadiet" "retdiet" "betaplasma" "retplasma" > par(mfrow=c(4,4)) > for (i in 1:14) hist(prdata[,i],xlab=names(prdata)[i]) > par(mfrow=c(4,4)) > for (i in 1:14) hist(prdata[,i],title=names(prdata)[i]) > par(mfrow=c(4,4)) > for (i in 1:14) {hist(prdata[,i],xlab=""); title(names(prdata)[i]))} Problem: Syntax error: No opening parenthesis before unbalanced (")") on input line 1 > par(mfrow=c(4,4)) > for (i in 1:14) {hist(prdata[,i],xlab=""); title(names(prdata)[i])} > for (i in 1:14) {hist(log(prdata[,i]),xlab=""); title(names(prdata)[i])} > par(mfrow=c(4,4)) > for (i in 1:14) {hist(log(prdata[,i]),xlab=""); title(names(prdata)[i])} > table(prodata[,"alcohol"]) Problem: Object "prodata" not found Use traceback() to see the call stack > table(prdata[,"alcohol"]) 0 0.1 0.2 0.3 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.7 2 2.1 2.2 2.3 2.4 111 25 19 6 10 3 8 2 5 12 1 4 3 1 3 2 6 1 2 1 1 2.5 2.6 2.9 3 3.1 3.2 3.4 3.5 3.7 4 4.1 4.2 4.5 4.7 4.9 5 5.2 5.6 5.7 6.1 6.2 6.4 1 1 1 4 1 4 1 1 2 3 3 1 2 1 1 5 1 1 1 1 2 1 6.5 6.7 6.8 7 7.1 7.2 7.3 8 8.3 8.4 8.5 9 10 10.5 11 14 14.1 14.2 15 15.5 17 18 2 1 1 5 2 5 1 3 1 1 1 1 2 2 3 2 3 1 2 1 1 2 18.2 20 21 22 35 203 1 1 1 1 2 1 > names(prdata) [1] "age" "sex" "smokstat" "quetelet" "vituse" [6] "calories" "fat" "fiber" "alcohol" "cholesterol" [11] "betadiet" "retdiet" "betaplasma" "retplasma" > pairs(log(prdata)) Warning messages: 1: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(mfrow = c(n, n), mgp = c(2, 0.8, 0), oma = rep(3, 4), mar = rep(0.5, 4), tck = .. .. 2: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(mfrow = c(n, n), mgp = c(2, 0.8, 0), oma = rep(3, 4), mar = rep(0.5, 4), tck = .. .. 3: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(mfrow = c(n, n), mgp = c(2, 0.8, 0), oma = rep(3, 4), mar = rep(0.5, 4), tck = .. .. 4: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(oldpar ) > lprdata _ prdata > lprdata[,"age"] = log(lprdata[,"age"]) > unique(lprdata[,"sex"]) [1] 2 1 > lprdata[,"sex"] _ lprdata[,"sex"] - 1 > par(mfrow=c(1,1)) > hist(lprdata$alcohol) > hist(log(lprdata$alcohol)) > step(lprdata$alcohol) Problem in UseMethod: No specific or default method found Use traceback() to see the call stack > stem(lprdata$alcohol) N = 315 Median = 0.3 Quartiles = 0, 3.2 Decimal point is at the colon 0 : zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzx 0 : 5555555555666777777778899999 1 : 000000000000122223334 1 : 55577 2 : 00000012234 2 : 569 3 : 0000122224 3 : 577 4 : 0001112 4 : 5579 5 : 000002 5 : 67 6 : 1224 6 : 5578 7 : 0000011222223 7 : 8 : 00034 8 : 5 9 : 0 High: 10.0 10.0 10.5 10.5 11.0 11.0 11.0 14.0 14.0 14.1 14.1 14.1 14.2 High: 15.0 15.0 15.5 17.0 18.0 18.0 18.2 20.0 21.0 22.0 35.0 35.0 203.0 > table(lprdata$alcohol) 0 0.1 0.2 0.3 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.7 2 2.1 2.2 2.3 2.4 111 25 19 6 10 3 8 2 5 12 1 4 3 1 3 2 6 1 2 1 1 2.5 2.6 2.9 3 3.1 3.2 3.4 3.5 3.7 4 4.1 4.2 4.5 4.7 4.9 5 5.2 5.6 5.7 6.1 6.2 6.4 1 1 1 4 1 4 1 1 2 3 3 1 2 1 1 5 1 1 1 1 2 1 6.5 6.7 6.8 7 7.1 7.2 7.3 8 8.3 8.4 8.5 9 10 10.5 11 14 14.1 14.2 15 15.5 17 18 2 1 1 5 2 5 1 3 1 1 1 1 2 2 3 2 3 1 2 1 1 2 18.2 20 21 22 35 203 1 1 1 1 2 1 > attach(prdata) > alcohol _ ifelse((alcohol<=5)&&(alcohol>0),1,0) Warning messages: 1: Condition has 315 elements: only the first used in: e1 && e2 2: Condition has 315 elements: only the first used in: e1 && e2 > alcohol _ prdata$alcohol > alcohol _ ifelse((alcohol<=5)&(alcohol>0),1,0) > attach(prdata) Warning messages: a database with name "prdata" already in search list: access by where="prdata" may not work in: attach.default(what, name = name) > detach() > alcohol _ prdata$alcohol > alcohol _ ifelse((alcohol<=5)&(alcohol>0),1,alcohol) > alcohol _ ifelse((alcohol<=14)&(alcohol>5),2,alcohol) > alcohol _ ifelse((alcohol>14),3,alcohol) > table(alcohol) 0 1 2 3 111 147 40 17 > lprdata$alcohol _ as.factor(alcohol) > detach() > names(lprdata) [1] "age" "sex" "smokstat" "quetelet" "vituse" [6] "calories" "fat" "fiber" "alcohol" "cholesterol" [11] "betadiet" "retdiet" "betaplasma" "retplasma" > hist(lprdata$cholesterol) > hist(log(lprdata$cholesterol)) > summary(cholesterol) Problem: Object "cholesterol" not found Use traceback() to see the call stack > summary(lprdata$cholesterol) Min. 1st Qu. Median Mean 3rd Qu. Max. 37.70 155.00 206.30 242.46 308.85 900.70 > summary(lprdata$age) Min. 1st Qu. Median Mean 3rd Qu. Max. 2.944439 3.663562 3.871201 3.871364 4.135135 4.418841 > table(lprdata$smokestat) 0 long 1 dimensional integer array: > table(lprdata$smokstat) 1 2 3 157 115 43 > table(lprdata$vituse) 1 2 3 122 82 111 > names(lprdata) [1] "age" "sex" "smokstat" "quetelet" "vituse" [6] "calories" "fat" "fiber" "alcohol" "cholesterol" [11] "betadiet" "retdiet" "betaplasma" "retplasma" > select _ c(4, 6, 7, 8, 10, 11, 12, 13, 14) > names(lprdata)[select] [1] "quetelet" "calories" "fat" "fiber" "cholesterol" [6] "betadiet" "retdiet" "betaplasma" "retplasma" > lprdata[,select] _ log(lprdata[,select]) > pairs(lprdata) Warning messages: 1: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(mfrow = c(n, n), mgp = c(2, 0.8, 0), oma = rep(3, 4), mar = rep(0.5, 4), tck = .. .. 2: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(mfrow = c(n, n), mgp = c(2, 0.8, 0), oma = rep(3, 4), mar = rep(0.5, 4), tck = .. .. 3: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(mfrow = c(n, n), mgp = c(2, 0.8, 0), oma = rep(3, 4), mar = rep(0.5, 4), tck = .. .. 4: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(oldpar ) > par(mfrow=c(4,4)) > for (i in 1:14) {hist(log(lprdata[,i]),xlab=""); title(names(lprdata)[i])} Problem in Math.factor(x): A factor is not a numeric object Use traceback() to see the call stack > select [1] 4 6 7 8 10 11 12 13 14 > names(lprdata)[select] [1] "quetelet" "calories" "fat" "fiber" "cholesterol" [6] "betadiet" "retdiet" "betaplasma" "retplasma" > summary(lprdata$select) Length Class Mode 0 NULL > summary(lprdata$sex) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.0000 1.0000 1.0000 0.8667 1.0000 1.0000 > names(lprdata) [1] "age" "sex" "smokstat" "quetelet" "vituse" [6] "calories" "fat" "fiber" "alcohol" "cholesterol" [11] "betadiet" "retdiet" "betaplasma" "retplasma" > summary(smokstat) Problem: Object "smokstat" not found Use traceback() to see the call stack > summary(lprdata$smokstat) Min. 1st Qu. Median Mean 3rd Qu. Max. 1.000 1.000 2.000 1.638 2.000 3.000 > table(lprdata$smokstat) 1 2 3 157 115 43 > lapply(lprdata,is.factor) $age: [1] F $sex: [1] F $smokstat: [1] F $quetelet: [1] F $vituse: [1] F $calories: [1] F $fat: [1] F $fiber: [1] F $alcohol: [1] T $cholesterol: [1] F $betadiet: [1] F $retdiet: [1] F $betaplasma: [1] F $retplasma: [1] F > lprdata$alcohol [1] 0 0 3 1 0 1 0 0 1 0 1 0 1 0 0 3 3 2 0 1 2 1 3 1 1 1 0 0 0 1 0 1 1 1 2 0 1 1 0 [40] 1 0 1 1 1 1 1 0 2 0 2 2 1 2 2 0 1 1 1 1 1 0 3 1 1 0 2 0 1 1 1 1 0 2 2 2 2 1 3 [79] 1 3 0 1 1 0 2 0 1 2 0 0 1 2 1 0 3 1 1 1 2 0 0 1 0 1 0 2 1 1 0 1 0 2 1 0 0 0 1 [118] 0 1 0 0 1 1 0 1 2 1 1 0 1 2 0 0 1 0 1 0 0 0 3 2 0 2 0 3 0 1 1 1 1 1 1 0 0 1 0 [157] 0 0 0 0 1 2 0 1 1 1 1 1 1 1 2 0 1 2 1 2 2 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 1 1 [196] 1 1 1 1 0 2 1 0 0 0 1 0 3 1 0 1 1 0 1 0 0 1 1 1 0 1 0 0 1 1 0 1 1 1 0 0 0 0 0 [235] 1 0 2 2 0 1 1 2 1 0 0 0 0 1 1 2 2 1 1 0 1 3 0 1 2 1 1 2 1 0 1 1 1 0 1 1 0 1 3 [274] 2 1 0 1 1 1 1 1 0 3 0 1 0 0 0 0 1 0 1 0 1 1 3 1 2 1 0 1 2 0 1 3 0 0 3 1 2 1 1 [313] 1 1 1 > as.numeric(lprdata$alcohol) [1] 1 1 4 2 1 2 1 1 2 1 2 1 2 1 1 4 4 3 1 2 3 2 4 2 2 2 1 1 1 2 1 2 2 2 3 1 2 2 1 [40] 2 1 2 2 2 2 2 1 3 1 3 3 2 3 3 1 2 2 2 2 2 1 4 2 2 1 3 1 2 2 2 2 1 3 3 3 3 2 4 [79] 2 4 1 2 2 1 3 1 2 3 1 1 2 3 2 1 4 2 2 2 3 1 1 2 1 2 1 3 2 2 1 2 1 3 2 1 1 1 2 [118] 1 2 1 1 2 2 1 2 3 2 2 1 2 3 1 1 2 1 2 1 1 1 4 3 1 3 1 4 1 2 2 2 2 2 2 1 1 2 1 [157] 1 1 1 1 2 3 1 2 2 2 2 2 2 2 3 1 2 3 2 3 3 2 2 1 2 1 2 2 1 1 1 2 2 1 1 2 2 2 2 [196] 2 2 2 2 1 3 2 1 1 1 2 1 4 2 1 2 2 1 2 1 1 2 2 2 1 2 1 1 2 2 1 2 2 2 1 1 1 1 1 [235] 2 1 3 3 1 2 2 3 2 1 1 1 1 2 2 3 3 2 2 1 2 4 1 2 3 2 2 3 2 1 2 2 2 1 2 2 1 2 4 [274] 3 2 1 2 2 2 2 2 1 4 1 2 1 1 1 1 2 1 2 1 2 2 4 2 3 2 1 2 3 1 2 4 1 1 4 2 3 2 2 [313] 2 2 2 > lprdata$alcohol _ as.numeric(lprdata$alcohol) - 1 > lprdata$alcohol [1] 0 0 3 1 0 1 0 0 1 0 1 0 1 0 0 3 3 2 0 1 2 1 3 1 1 1 0 0 0 1 0 1 1 1 2 0 1 1 0 [40] 1 0 1 1 1 1 1 0 2 0 2 2 1 2 2 0 1 1 1 1 1 0 3 1 1 0 2 0 1 1 1 1 0 2 2 2 2 1 3 [79] 1 3 0 1 1 0 2 0 1 2 0 0 1 2 1 0 3 1 1 1 2 0 0 1 0 1 0 2 1 1 0 1 0 2 1 0 0 0 1 [118] 0 1 0 0 1 1 0 1 2 1 1 0 1 2 0 0 1 0 1 0 0 0 3 2 0 2 0 3 0 1 1 1 1 1 1 0 0 1 0 [157] 0 0 0 0 1 2 0 1 1 1 1 1 1 1 2 0 1 2 1 2 2 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 1 1 [196] 1 1 1 1 0 2 1 0 0 0 1 0 3 1 0 1 1 0 1 0 0 1 1 1 0 1 0 0 1 1 0 1 1 1 0 0 0 0 0 [235] 1 0 2 2 0 1 1 2 1 0 0 0 0 1 1 2 2 1 1 0 1 3 0 1 2 1 1 2 1 0 1 1 1 0 1 1 0 1 3 [274] 2 1 0 1 1 1 1 1 0 3 0 1 0 0 0 0 1 0 1 0 1 1 3 1 2 1 0 1 2 0 1 3 0 0 3 1 2 1 1 [313] 1 1 1 > par(mfrow=c(4,4)) > for (i in 1:14) {hist(log(lprdata[,i]),xlab=""); title(names(lprdata)[i])} Warning messages: NAs generated in: log(x) > par(mfrow=c(4,4)) > for (i in 1:14) {hist(lprdata[,i],xlab=""); title(names(lprdata)[i])} > hist(prdata$age) > betadata _ lprdata[,-c(12,14)] > retdata _ lprdata[,-c(11,13)] > names(betadiet) Problem: Object "betadiet" not found Use traceback() to see the call stack > names(betadata) [1] "age" "sex" "smokstat" "quetelet" "vituse" [6] "calories" "fat" "fiber" "alcohol" "cholesterol" [11] "betadiet" "betaplasma" > names(retdata) [1] "age" "sex" "smokstat" "quetelet" "vituse" [6] "calories" "fat" "fiber" "alcohol" "cholesterol" [11] "retdiet" "retplasma" > pairs(betadata) Warning messages: 1: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(mfrow = c(n, n), mgp = c(2, 0.8, 0), oma = rep(3, 4), mar = rep(0.5, 4), tck = .. .. 2: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(mfrow = c(n, n), mgp = c(2, 0.8, 0), oma = rep(3, 4), mar = rep(0.5, 4), tck = .. .. 3: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(mfrow = c(n, n), mgp = c(2, 0.8, 0), oma = rep(3, 4), mar = rep(0.5, 4), tck = .. .. 4: Graphics error: Computed plot of type m does not fit (in zzpltz) in: par(oldpar ) > help.start() Problem: Couldn't find a function definition for "help.start" Use traceback() to see the call stack > help() > args(stepwise) function(x, y, wt, intercept = T, tolerance = 1e-007, method = "efroymson", size.max = ncol(x), nbest = 3, f.crit = 2, xinclude, plot.rss = dev.cur( ) != 1, time = 0.02) NULL > names(betadata) [1] "age" "sex" "smokstat" "quetelet" "vituse" [6] "calories" "fat" "fiber" "alcohol" "cholesterol" [11] "betadiet" "betaplasma" > stepwise(betadata[,-12],betadata[,12],method= + + "ex") $rss: [1] 1.608708e+002 1.642484e+002 1.668133e+002 1.520887e+002 1.523603e+002 [6] 1.539964e+002 1.461400e+002 1.464178e+002 1.471494e+002 1.410887e+002 [11] 1.417590e+002 1.419824e+002 1.381909e+002 1.383567e+002 1.388073e+002 [16] 1.356524e+002 1.365795e+002 1.365795e+002 1.344666e+002 1.344967e+002 [21] 1.347852e+002 1.331839e+002 1.335061e+002 1.336320e+002 1.324779e+002 [26] 1.327817e+002 1.330310e+002 1.323949e+002 1.324770e+002 1.327257e+002 [31] 1.323812e+002 1.000000e+035 1.000000e+035 $size: [1] 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 [27] 9 10 10 10 11 1 0 $which: logical matrix: 33 rows, 11 columns. age sex smokstat quetelet vituse calories fat fiber alcohol cholesterol 1(#1) F F F T F F F F F F 1(#2) F F F F T F F F F F 1(#3) F F F F F F F T F F 2(#1) F F F T T F F F F F 2(#2) F F T T F F F F F F 2(#3) F F F T F F F T F F 3(#1) F F T T T F F F F F 3(#2) F F F T T F F T F F 3(#3) F F F T T F F F F F 4(#1) F F F T T T F T F F 4(#2) F F T T T F F T F F 4(#3) F F F T T F T T F F 5(#1) F F T T T T F T F F 5(#2) T T F T T F F T F F 5(#3) F F T T T F T T F F 6(#1) T T T T T F F T F F 6(#2) T T F T T T F T F F 6(#3) T F T T T T F T F F 7(#1) T T T T T T F T F F 7(#2) T T T T T F T T F F 7(#3) T T T T T F F T T F 8(#1) T T T T T T F T T F betadiet 1(#1) F 1(#2) F 1(#3) F 2(#1) F 2(#2) F 2(#3) F 3(#1) F 3(#2) F 3(#3) T 4(#1) F 4(#2) F 4(#3) F 5(#1) F 5(#2) F 5(#3) F 6(#1) F 6(#2) F 6(#3) F 7(#1) F 7(#2) F 7(#3) F 8(#1) F age sex smokstat quetelet vituse calories fat fiber alcohol cholesterol 8(#2) T T T T T F T T T F 8(#3) T T T T T T F T F F 9(#1) T T T T T T F T T F 9(#2) T T T T T F T T T F 9(#3) T T T T T T F T T T 10(#1) T T T T T T F T T T 10(#2) T T T T T T T T T F 10(#3) T T T T T F T T T T 11(#1) T T T T T T T T T T 1(#2) F F F F F F F F F F 0(#3) F F F F F F F F F F betadiet 8(#2) F 8(#3) T 9(#1) T 9(#2) T 9(#3) F 10(#1) T 10(#2) T 10(#3) T 11(#1) T 1(#2) T 0(#3) F $method: [1] "exhaustive" Warning messages: 1 non-finite observations deleted in: stepwise(betadata[, -12], betadata[, 12], method = "ex") > par(mfrow=c(1,1)) > stepwise(betadata[,-12],betadata[,12],method="ex") $rss: [1] 1.608708e+002 1.642484e+002 1.668133e+002 1.520887e+002 1.523603e+002 [6] 1.539964e+002 1.461400e+002 1.464178e+002 1.471494e+002 1.410887e+002 [11] 1.417590e+002 1.419824e+002 1.381909e+002 1.383567e+002 1.388073e+002 [16] 1.356524e+002 1.365795e+002 1.365795e+002 1.344666e+002 1.344967e+002 [21] 1.347852e+002 1.331839e+002 1.335061e+002 1.336320e+002 1.324779e+002 [26] 1.327817e+002 1.330310e+002 1.323949e+002 1.324770e+002 1.327257e+002 [31] 1.323812e+002 1.000000e+035 1.000000e+035 $size: [1] 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 [27] 9 10 10 10 11 1 0 $which: logical matrix: 33 rows, 11 columns. age sex smokstat quetelet vituse calories fat fiber alcohol cholesterol 1(#1) F F F T F F F F F F 1(#2) F F F F T F F F F F 1(#3) F F F F F F F T F F 2(#1) F F F T T F F F F F 2(#2) F F T T F F F F F F 2(#3) F F F T F F F T F F 3(#1) F F T T T F F F F F 3(#2) F F F T T F F T F F 3(#3) F F F T T F F F F F 4(#1) F F F T T T F T F F 4(#2) F F T T T F F T F F 4(#3) F F F T T F T T F F 5(#1) F F T T T T F T F F 5(#2) T T F T T F F T F F 5(#3) F F T T T F T T F F 6(#1) T T T T T F F T F F 6(#2) T T F T T T F T F F 6(#3) T F T T T T F T F F 7(#1) T T T T T T F T F F 7(#2) T T T T T F T T F F 7(#3) T T T T T F F T T F 8(#1) T T T T T T F T T F betadiet 1(#1) F 1(#2) F 1(#3) F 2(#1) F 2(#2) F 2(#3) F 3(#1) F 3(#2) F 3(#3) T 4(#1) F 4(#2) F 4(#3) F 5(#1) F 5(#2) F 5(#3) F 6(#1) F 6(#2) F 6(#3) F 7(#1) F 7(#2) F 7(#3) F 8(#1) F age sex smokstat quetelet vituse calories fat fiber alcohol cholesterol 8(#2) T T T T T F T T T F 8(#3) T T T T T T F T F F 9(#1) T T T T T T F T T F 9(#2) T T T T T F T T T F 9(#3) T T T T T T F T T T 10(#1) T T T T T T F T T T 10(#2) T T T T T T T T T F 10(#3) T T T T T F T T T T 11(#1) T T T T T T T T T T 1(#2) F F F F F F F F F F 0(#3) F F F F F F F F F F betadiet 8(#2) F 8(#3) T 9(#1) T 9(#2) T 9(#3) F 10(#1) T 10(#2) T 10(#3) T 11(#1) T 1(#2) T 0(#3) F $method: [1] "exhaustive" Warning messages: 1 non-finite observations deleted in: stepwise(betadata[, -12], betadata[, 12], method = "ex") > sw _ stepwise(betadata[,-12],betadata[,12],method="ex") Warning messages: 1 non-finite observations deleted in: stepwise(betadata[, -12], betadata[, 12], method = "ex") > sw$rss [1] 1.608708e+002 1.642484e+002 1.668133e+002 1.520887e+002 1.523603e+002 [6] 1.539964e+002 1.461400e+002 1.464178e+002 1.471494e+002 1.410887e+002 [11] 1.417590e+002 1.419824e+002 1.381909e+002 1.383567e+002 1.388073e+002 [16] 1.356524e+002 1.365795e+002 1.365795e+002 1.344666e+002 1.344967e+002 [21] 1.347852e+002 1.331839e+002 1.335061e+002 1.336320e+002 1.324779e+002 [26] 1.327817e+002 1.330310e+002 1.323949e+002 1.324770e+002 1.327257e+002 [31] 1.323812e+002 1.000000e+035 1.000000e+035 > plot sw$rss[-c(32,33)] Problem: Object "plot sw" not found Use traceback() to see the call stack > plot(sw$rss[-c(32,33)]) > source("g:\\www\\401\\data\\sum.step.q") > sum.step function(step.rslt, data, y, sortcol = 1, sigfig = c(IC = 1, RSE = 1, R = 3), includeBIC = T, includeAIC = F, includeRSE = F, includeR2 = F, includeR2a = T, top = NULL, compact = F) { if(!is.data.frame(data)) stop("data must be a data.frame") if(length(sigfig) == 1) sigfig <- rep(sigfig, 3) wch <- step.rslt$which n <- nrow(wch) nam <- dimnames(step.rslt$which)[[2]] BIC <- AIC <- RSE <- R2 <- R2a <- rep(NA, n) if(!is.character(y)) y <- deparse(substitute(y)) for(i in 1:n) { if(!any(wch[i, ])) rslt <- lm(as.formula(paste(y, "~1")), data) else rslt <- lm(as.formula(paste(y, "~", paste(nam[wch[i, ]], collapse = "+"))), data) SSR <- sum(rslt$res^2) p <- length(rslt$coef) n <- p + rslt$df sm <- summary(rslt) RSE[i] <- sm$sigma R2[i] <- sm$r.square R2a[i] <- R2[i] - (p - 1)/(n - p) * (1 - R2[i]) Sig2 <- sm$sigma^2 LL <- - n/2 * log(2 * pi * Sig2) - SSR/2/Sig2 BIC[i] <- LL - (p * log(n))/2 AIC[i] <- LL - p } out <- wch if(includeR2a) out <- cbind(R2a = round(R2a, sigfig[3]), out) if(includeR2) out <- cbind(R2 = round(R2, sigfig[3]), out) if(includeRSE) out <- cbind(RSE = round(RSE, sigfig[2]), out) if(includeAIC) out <- cbind(AIC = round(AIC, sigfig[1]), out) if(includeBIC) out <- cbind(BIC = round(BIC, sigfig[1]), out) if(sortcol > 0) out <- out[rev(order(out[, sortcol])), ] if(!is.null(top)) out <- out[1:top, ] if(compact) out <- out[, apply(out, 2, function(x) any(x != 0))] return(out) } > args(sum.step) function(step.rslt, data, y, sortcol = 1, sigfig = c(IC = 1, RSE = 1, R = 3), includeBIC = T, includeAIC = F, includeRSE = F, includeR2 = F, includeR2a = T, top = NULL, compact = F) NULL > sum.step(sw,betadata,names(betadiet)[12],includeAIC=T,includeBIC=T,includeR2a=T) Problem: Object "betadiet" not found Use traceback() to see the call stack > sum.step(sw,betadata,names(betadat)[12],includeAIC=T,includeBIC=T,includeR2a=T) Problem: Object "betadat" not found Use traceback() to see the call stack > sum.step(sw,betadata,names(betadata)[12],includeAIC=T,includeBIC=T,includeR2a=T) Problem in m[1 + 0:(min(c(n, p)) - 1) * (n + 1)] <- x: Array subscript (1) out of bo unds, should be at most 0 Use traceback() to see the call stack > names(betadata) [1] "age" "sex" "smokstat" "quetelet" "vituse" [6] "calories" "fat" "fiber" "alcohol" "cholesterol" [11] "betadiet" "betaplasma" > sum.step(sw,betadata,"betaplasma",includeAIC=T,includeBIC=T,includeR2a=T) Problem in m[1 + 0:(min(c(n, p)) - 1) * (n + 1)] <- x: Array subscript (1) out of bo unds, should be at most 0 Use traceback() to see the call stack > sum.step function(step.rslt, data, y, sortcol = 1, sigfig = c(IC = 1, RSE = 1, R = 3), includeBIC = T, includeAIC = F, includeRSE = F, includeR2 = F, includeR2a = T, top = NULL, compact = F) { if(!is.data.frame(data)) stop("data must be a data.frame") if(length(sigfig) == 1) sigfig <- rep(sigfig, 3) wch <- step.rslt$which n <- nrow(wch) nam <- dimnames(step.rslt$which)[[2]] BIC <- AIC <- RSE <- R2 <- R2a <- rep(NA, n) if(!is.character(y)) y <- deparse(substitute(y)) for(i in 1:n) { if(!any(wch[i, ])) rslt <- lm(as.formula(paste(y, "~1")), data) else rslt <- lm(as.formula(paste(y, "~", paste(nam[wch[i, ]], collapse = "+"))), data) SSR <- sum(rslt$res^2) p <- length(rslt$coef) n <- p + rslt$df sm <- summary(rslt) RSE[i] <- sm$sigma R2[i] <- sm$r.square R2a[i] <- R2[i] - (p - 1)/(n - p) * (1 - R2[i]) Sig2 <- sm$sigma^2 LL <- - n/2 * log(2 * pi * Sig2) - SSR/2/Sig2 BIC[i] <- LL - (p * log(n))/2 AIC[i] <- LL - p } out <- wch if(includeR2a) out <- cbind(R2a = round(R2a, sigfig[3]), out) if(includeR2) out <- cbind(R2 = round(R2, sigfig[3]), out) if(includeRSE) out <- cbind(RSE = round(RSE, sigfig[2]), out) if(includeAIC) out <- cbind(AIC = round(AIC, sigfig[1]), out) if(includeBIC) out <- cbind(BIC = round(BIC, sigfig[1]), out) if(sortcol > 0) out <- out[rev(order(out[, sortcol])), ] if(!is.null(top)) out <- out[1:top, ] if(compact) out <- out[, apply(out, 2, function(x) any(x != 0))] return(out) } > sum.step(sw,betadata,betaplasma,includeAIC=T,includeBIC=T,includeR2a=T) Problem: Object "betaplasma" not found Use traceback() to see the call stack > sum.step(sw,betadata,"betaplasma",includeAIC=T,includeBIC=T,includeR2a=T) Problem in m[1 + 0:(min(c(n, p)) - 1) * (n + 1)] <- x: Array subscript (1) out of bo unds, should be at most 0 Use traceback() to see the call stack > traceback() 9: eval(action, sys.parent()) 8: doErrorAction("Problem in m[1 + 0:(min(c(n, p)) - 1) * (n + 1)] <- x: Array subsc ript (1) out of bounds, should be at most 0", 7: m[1 + 0:(min(c(n, p)) - 1) * (n + 1)] <- x 6: diag.default(p) 5: diag(p) 4: summary.lm(rslt) 3: sum.step(sw, betadata, "betaplasma", includeAIC = T, includeBIC = T, includeR2a = T 2: eval(expression(sum.step(sw, betadata, "betaplasma", includeAIC = T, includeBIC = T, 1: Message: Problem in m[1 + 0:(min(c(n, p)) - 1) * (n + 1)] <- x: Array subscript (1) out of bounds, should be at most 0 > sum.step(sw,betadata,"betaplasma") Problem in m[1 + 0:(min(c(n, p)) - 1) * (n + 1)] <- x: Array subscript (1) out of bo unds, should be at most 0 Use traceback() to see the call stack > User interrupt requested > sw $rss: [1] 1.608708e+002 1.642484e+002 1.668133e+002 1.520887e+002 1.523603e+002 [6] 1.539964e+002 1.461400e+002 1.464178e+002 1.471494e+002 1.410887e+002 [11] 1.417590e+002 1.419824e+002 1.381909e+002 1.383567e+002 1.388073e+002 [16] 1.356524e+002 1.365795e+002 1.365795e+002 1.344666e+002 1.344967e+002 [21] 1.347852e+002 1.331839e+002 1.335061e+002 1.336320e+002 1.324779e+002 [26] 1.327817e+002 1.330310e+002 1.323949e+002 1.324770e+002 1.327257e+002 [31] 1.323812e+002 1.000000e+035 1.000000e+035 $size: [1] 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 [27] 9 10 10 10 11 1 0 $which: logical matrix: 33 rows, 11 columns. age sex smokstat quetelet vituse calories fat fiber alcohol cholesterol 1(#1) F F F T F F F F F F 1(#2) F F F F T F F F F F 1(#3) F F F F F F F T F F 2(#1) F F F T T F F F F F 2(#2) F F T T F F F F F F 2(#3) F F F T F F F T F F 3(#1) F F T T T F F F F F 3(#2) F F F T T F F T F F 3(#3) F F F T T F F F F F 4(#1) F F F T T T F T F F 4(#2) F F T T T F F T F F 4(#3) F F F T T F T T F F 5(#1) F F T T T T F T F F 5(#2) T T F T T F F T F F 5(#3) F F T T T F T T F F 6(#1) T T T T T F F T F F 6(#2) T T F T T T F T F F 6(#3) T F T T T T F T F F 7(#1) T T T T T T F T F F 7(#2) T T T T T F T T F F 7(#3) T T T T T F F T T F 8(#1) T T T T T T F T T F betadiet 1(#1) F 1(#2) F 1(#3) F 2(#1) F 2(#2) F 2(#3) F 3(#1) F 3(#2) F 3(#3) T 4(#1) F 4(#2) F 4(#3) F 5(#1) F 5(#2) F 5(#3) F 6(#1) F 6(#2) F 6(#3) F 7(#1) F 7(#2) F 7(#3) F 8(#1) F age sex smokstat quetelet vituse calories fat fiber alcohol cholesterol 8(#2) T T T T T F T T T F 8(#3) T T T T T T F T F F 9(#1) T T T T T T F T T F 9(#2) T T T T T F T T T F 9(#3) T T T T T T F T T T 10(#1) T T T T T T F T T T 10(#2) T T T T T T T T T F 10(#3) T T T T T F T T T T 11(#1) T T T T T T T T T T 1(#2) F F F F F F F F F F 0(#3) F F F F F F F F F F betadiet 8(#2) F 8(#3) T 9(#1) T 9(#2) T 9(#3) F 10(#1) T 10(#2) T 10(#3) T 11(#1) T 1(#2) T 0(#3) F $method: [1] "exhaustive" > plot(sw$size[-c(32,33)],sw$rss[-c(32,33)]) > User interrupt requested > names(betadata[12]) [1] "betaplasma" > names(betadata)[12] [1] "betaplasma" > sw _ stepwise(betadata[,-12],betadata[,12],method="ex") Warning messages: 1 non-finite observations deleted in: stepwise(betadata[, -12], betadata[, 12], method = "ex") > betadiet$choleserol Problem: Object "betadiet" not found Use traceback() to see the call stack > betadiet$cholesterol Problem: Object "betadiet" not found Use traceback() to see the call stack > betadata$cholesterol [1] 5.137562 4.328098 5.552572 5.806941 5.140493 5.040841 5.541656 5.366443 [9] 5.453610 5.146913 4.922896 4.872905 6.040255 5.540871 5.890262 5.938855 [17] 5.077047 4.970508 6.238910 5.284218 5.602857 5.080783 5.249652 4.966335 [25] 5.480222 4.652054 5.048573 5.258016 5.422745 5.867601 5.509388 5.732694 [33] 5.328361 5.784440 5.491414 5.533785 5.806941 4.762174 6.133615 5.324472 [41] 5.408068 5.893300 5.443283 5.207845 5.194622 4.598146 5.893300 6.011267 [49] 4.379524 5.563370 5.168209 4.239887 4.430817 5.693059 5.376666 5.196285 [57] 5.341377 6.237543 5.258016 5.582744 5.211124 6.401917 5.547908 5.378514 [65] 5.123964 5.029130 5.851915 5.624378 4.014580 5.064492 5.942012 5.274025 [73] 5.548298 5.856790 6.115451 4.273884 5.833933 5.899897 5.982676 5.591733 [81] 5.500442 5.376204 5.662960 5.782286 4.197202 5.646506 5.355170 5.476464 [89] 5.513429 4.080922 4.955827 5.647917 4.089332 6.616734 6.151029 5.393628 [97] 6.087456 4.488636 5.304796 6.310827 4.848900 5.806339 6.215208 5.575191 [105] 5.432848 6.034524 5.091293 4.933034 5.477300 5.300814 5.414766 6.535822 [113] 4.894850 5.236442 5.185149 4.687671 5.641552 6.088137 5.164214 4.476200 [121] 5.299317 4.660605 5.898801 6.247075 5.420092 5.605067 5.706778 4.825911 [129] 5.544396 5.608372 4.593098 5.206750 5.949600 5.098035 4.350278 4.797442 [137] 5.042780 4.851249 4.601162 6.030685 5.651787 5.017280 5.752255 6.577583 [145] 5.925058 4.597138 4.498698 4.949469 5.414766 5.102911 4.793308 6.702820 [153] 4.736198 5.159630 5.136386 5.431536 4.286341 4.576771 5.518657 5.044070 [161] 4.949469 5.103518 5.837730 6.030204 5.589120 4.611152 5.273000 5.302807 [169] 5.369707 6.069120 6.124465 5.841513 5.261653 4.808111 4.624973 4.588024 [177] 5.513025 4.999911 5.135210 5.211670 5.913503 5.241218 4.950177 6.249975 [185] 4.714025 5.635147 4.632785 6.308281 4.992471 5.273512 5.422745 4.897093 [193] 4.935912 5.894678 5.165928 5.327391 4.882044 6.103900 5.964607 5.045359 [201] 5.196838 4.578826 5.448030 5.278115 5.534180 4.753590 5.989713 5.009968 [209] 5.733018 4.909709 5.605434 6.053265 6.059357 5.355170 4.774913 5.793318 [217] 5.819786 5.108971 5.278625 5.798486 5.479805 5.050497 5.277094 5.189618 [225] 5.372497 5.248602 4.981550 5.650030 5.340898 5.420535 5.638710 5.135798 [233] 4.911183 5.156178 5.306286 5.059425 5.829240 5.193512 4.360548 5.264761 [241] 5.282696 5.208393 4.395683 6.079475 5.172187 5.255932 5.184028 4.938065 [249] 5.892749 5.225209 3.629660 3.835142 6.151242 5.515040 6.062622 5.583120 [257] 6.803172 5.244389 5.560682 5.722604 5.177843 5.329331 5.430661 4.735321 [265] 5.228431 6.144829 5.309257 4.725616 5.943586 4.784989 5.155024 5.354698 [273] 5.595455 4.579852 5.165928 6.352978 4.777441 5.658436 5.736895 5.155601 [281] 5.126936 4.978801 5.171052 5.244389 5.142832 4.471639 4.518522 5.855358 [289] 5.574053 5.789042 4.992471 6.189905 4.471639 6.097400 4.469350 6.069351 [297] 5.831882 5.078294 4.707727 5.883601 5.804834 6.066108 5.811740 5.216022 [305] 5.519459 5.510198 5.481888 5.937008 5.531015 5.700778 5.725218 5.551796 [313] 5.013963 5.944897 5.276072 > betadiet$betaplasma Problem: Object "betadiet" not found Use traceback() to see the call stack > betadata$betaplasma [1] 5.298317 4.820282 5.793014 5.030438 4.521789 4.997212 5.552960 4.158883 [9] 5.384495 4.394449 5.214936 4.510860 4.787492 4.110874 4.682131 5.351858 [17] 5.459586 5.662960 4.624973 4.727388 4.304065 4.859812 4.941642 4.927254 [25] 4.962845 6.030685 5.356586 6.666957 3.555348 4.804021 4.779123 5.204007 [33] 5.225747 5.375278 6.621406 3.663562 4.672829 4.304065 6.035481 7.254885 [41] 5.991465 4.624973 4.905275 4.574711 4.820282 5.273000 4.672829 3.970292 [49] 4.997212 4.343805 5.755742 4.343805 5.583496 3.663562 5.416100 5.153292 [57] 4.369448 4.624973 5.062595 5.068904 5.056246 4.564348 5.075174 4.605170 [65] 5.680173 5.141664 4.488636 4.691348 4.859812 4.465908 5.793014 5.697093 [73] 5.937536 5.318120 4.317488 4.844187 4.875197 3.044522 5.451038 4.290459 [81] 3.218876 4.919981 4.406719 5.789960 4.955827 4.454347 5.010635 3.970292 [89] 4.718499 4.644391 5.135798 5.010635 5.641907 4.510860 4.828314 5.641907 [97] 2.772589 4.859812 5.192957 3.663562 3.988984 4.356709 3.526361 4.553877 [105] 5.159055 4.553877 4.574711 5.318120 3.218876 5.598422 5.652489 4.700480 [113] 5.087596 5.187386 4.875197 4.454347 5.416100 5.517453 5.537334 5.241747 [121] 4.682131 4.795791 5.472271 4.844187 4.948760 6.056784 5.720312 4.304065 [129] 5.049856 5.123964 4.753590 5.669881 5.717028 5.288267 5.533389 4.997212 [137] 6.198479 5.049856 3.295837 3.951244 5.347108 4.418841 5.204007 3.688879 [145] 4.234107 5.147494 5.533389 6.075346 6.061457 5.786897 4.317488 4.795791 [153] 5.676754 5.332719 4.770685 4.682131 5.953243 6.011267 4.574711 4.770685 [161] 4.094345 5.877736 6.754604 4.644391 5.389072 5.690359 5.099866 6.188264 [169] 4.248495 3.761200 5.613128 5.442418 5.846439 5.198497 4.753590 5.968708 [177] 4.442651 6.684612 5.655992 4.465908 4.304065 6.131226 5.036953 5.327876 [185] 2.944439 5.123964 4.682131 5.613128 4.787492 3.970292 4.653960 5.068904 [193] 4.418841 6.052089 4.595120 5.068904 4.709530 5.755742 4.653960 5.758902 [201] 5.918894 4.753590 5.433722 3.931826 5.655992 4.700480 4.962845 7.100027 [209] 5.159055 4.454347 4.882802 4.060443 4.343805 5.468060 3.713572 4.634729 [217] 5.262690 5.030438 7.237778 4.488636 4.430817 3.583519 6.202536 4.356709 [225] 4.624973 3.912023 5.351858 5.068904 4.488636 4.682131 5.236442 4.317488 [233] 2.639057 5.105945 4.962845 5.484797 4.574711 4.330733 5.129899 5.402677 [241] 4.406719 5.780744 4.983607 4.836282 5.680173 5.209486 5.135798 4.859812 [249] 4.859812 4.521789 3.784190 3.931826 4.634729 4.615121 5.918894 4.356709 [257] -Inf 4.430817 5.081404 5.802118 5.902633 6.897705 6.917706 5.463832 [265] 5.164786 4.204693 4.859812 5.758902 5.123964 6.418365 5.613128 4.543295 [273] 4.804021 5.446737 5.117994 3.465736 4.852030 5.017280 5.327876 4.317488 [281] 6.102559 5.826000 4.488636 3.663562 4.477337 4.736198 4.189655 6.008813 [289] 4.653960 4.941642 5.010635 4.553877 4.304065 5.308268 4.890349 4.143135 [297] 3.091042 5.017280 6.159095 4.060443 4.465908 4.727388 4.762174 5.043425 [305] 3.713572 4.290459 4.727388 4.605170 5.579730 4.969813 5.099866 4.382027 [313] 5.703782 4.795791 5.451038 > betadata _ betadata[-257,] > sw _ stepwise(betadata[,-12],betadata[,12],method="ex") > plot(sw$size[-c(32,33)],sw$rss[-c(32,33)]) > sum.step(sw,betadata,"betaplasma") numeric matrix: 33 rows, 13 columns. BIC R2a age sex smokstat quetelet vituse calories fat fiber alcohol 6(#1) -333.9 0.210 1 1 1 1 1 0 0 1 0 5(#1) -334.0 0.197 0 0 1 1 1 1 0 1 0 5(#2) -334.2 0.196 1 1 0 1 1 0 0 1 0 4(#1) -334.3 0.183 0 0 0 1 1 1 0 1 0 5(#3) -334.7 0.194 0 0 1 1 1 0 1 1 0 6(#3) -335.0 0.204 1 0 1 1 1 1 0 1 0 6(#2) -335.0 0.204 1 1 0 1 1 1 0 1 0 4(#2) -335.1 0.179 0 0 1 1 1 0 0 1 0 4(#3) -335.3 0.178 0 0 0 1 1 0 1 1 0 7(#1) -335.4 0.214 1 1 1 1 1 1 0 1 0 7(#2) -335.5 0.214 1 1 1 1 1 0 1 1 0 7(#3) -335.8 0.212 1 1 1 1 1 0 0 1 1 8(#1) -336.8 0.219 1 1 1 1 1 1 0 1 1 3(#1) -337.0 0.157 0 0 1 1 1 0 0 0 0 8(#2) -337.2 0.217 1 1 1 1 1 0 1 1 1 3(#2) -337.3 0.155 0 0 0 1 1 0 0 1 0 8(#3) -337.4 0.216 1 1 1 1 1 1 0 1 0 3(#3) -338.1 0.151 0 0 0 1 1 0 0 0 0 9(#1) -338.9 0.220 1 1 1 1 1 1 0 1 1 9(#2) -339.2 0.219 1 1 1 1 1 0 1 1 1 9(#3) -339.5 0.217 1 1 1 1 1 1 0 1 1 2(#1) -340.4 0.125 0 0 0 1 1 0 0 0 0 cholesterol betadiet 6(#1) 0 0 5(#1) 0 0 5(#2) 0 0 4(#1) 0 0 5(#3) 0 0 6(#3) 0 0 6(#2) 0 0 4(#2) 0 0 4(#3) 0 0 7(#1) 0 0 7(#2) 0 0 7(#3) 0 0 8(#1) 0 0 3(#1) 0 0 8(#2) 0 0 3(#2) 0 0 8(#3) 0 1 3(#3) 0 1 9(#1) 0 1 9(#2) 0 1 9(#3) 1 0 2(#1) 0 0 BIC R2a age sex smokstat quetelet vituse calories fat fiber alcohol 2(#2) -340.6 0.124 0 0 1 1 0 0 0 0 0 10(#1) -341.7 0.218 1 1 1 1 1 1 0 1 1 10(#2) -341.8 0.218 1 1 1 1 1 1 1 1 1 10(#3) -342.1 0.216 1 1 1 1 1 0 1 1 1 2(#3) -342.3 0.114 0 0 0 1 0 0 0 1 0 11(#1) -344.6 0.216 1 1 1 1 1 1 1 1 1 1(#1) -346.3 0.078 0 0 0 1 0 0 0 0 0 1(#2) -349.6 0.058 0 0 0 0 1 0 0 0 0 1(#3) -352.0 0.044 0 0 0 0 0 0 0 1 0 1(#2) -353.9 0.032 0 0 0 0 0 0 0 0 0 0(#3) -356.6 0.000 0 0 0 0 0 0 0 0 0 cholesterol betadiet 2(#2) 0 0 10(#1) 1 1 10(#2) 0 1 10(#3) 1 1 2(#3) 0 0 11(#1) 1 1 1(#1) 0 0 1(#2) 0 0 1(#3) 0 0 1(#2) 0 1 0(#3) 0 0 > sum.step(sw,betadata,"betaplasma",includeAIC=T,includeR=T) Problem in sum.step: argument includeR= not matched: sum.step(sw, betadata, "betapla sma", includeAIC = T, includeR = T) Use traceback() to see the call stack > sum.step(sw,betadata,"betaplasma",includeAIC=T,includeR2a=T) numeric matrix: 33 rows, 14 columns. BIC AIC R2a age sex smokstat quetelet vituse calories fat fiber 6(#1) -333.9 -320.8 0.210 1 1 1 1 1 0 0 1 5(#1) -334.0 -322.7 0.197 0 0 1 1 1 1 0 1 5(#2) -334.2 -322.9 0.196 1 1 0 1 1 0 0 1 4(#1) -334.3 -325.0 0.183 0 0 0 1 1 1 0 1 5(#3) -334.7 -323.4 0.194 0 0 1 1 1 0 1 1 6(#3) -335.0 -321.9 0.204 1 0 1 1 1 1 0 1 6(#2) -335.0 -321.9 0.204 1 1 0 1 1 1 0 1 4(#2) -335.1 -325.7 0.179 0 0 1 1 1 0 0 1 4(#3) -335.3 -326.0 0.178 0 0 0 1 1 0 1 1 7(#1) -335.4 -320.5 0.214 1 1 1 1 1 1 0 1 7(#2) -335.5 -320.5 0.214 1 1 1 1 1 0 1 1 7(#3) -335.8 -320.8 0.212 1 1 1 1 1 0 0 1 8(#1) -336.8 -320.0 0.219 1 1 1 1 1 1 0 1 3(#1) -337.0 -329.5 0.157 0 0 1 1 1 0 0 0 8(#2) -337.2 -320.3 0.217 1 1 1 1 1 0 1 1 3(#2) -337.3 -329.8 0.155 0 0 0 1 1 0 0 1 8(#3) -337.4 -320.5 0.216 1 1 1 1 1 1 0 1 3(#3) -338.1 -330.6 0.151 0 0 0 1 1 0 0 0 9(#1) -338.9 -320.1 0.220 1 1 1 1 1 1 0 1 9(#2) -339.2 -320.5 0.219 1 1 1 1 1 0 1 1 9(#3) -339.5 -320.8 0.217 1 1 1 1 1 1 0 1 2(#1) -340.4 -334.7 0.125 0 0 0 1 1 0 0 0 alcohol cholesterol betadiet 6(#1) 0 0 0 5(#1) 0 0 0 5(#2) 0 0 0 4(#1) 0 0 0 5(#3) 0 0 0 6(#3) 0 0 0 6(#2) 0 0 0 4(#2) 0 0 0 4(#3) 0 0 0 7(#1) 0 0 0 7(#2) 0 0 0 7(#3) 1 0 0 8(#1) 1 0 0 3(#1) 0 0 0 8(#2) 1 0 0 3(#2) 0 0 0 8(#3) 0 0 1 3(#3) 0 0 1 9(#1) 1 0 1 9(#2) 1 0 1 9(#3) 1 1 0 2(#1) 0 0 0 BIC AIC R2a age sex smokstat quetelet vituse calories fat fiber 2(#2) -340.6 -335.0 0.124 0 0 1 1 0 0 0 0 10(#1) -341.7 -321.1 0.218 1 1 1 1 1 1 0 1 10(#2) -341.8 -321.2 0.218 1 1 1 1 1 1 1 1 10(#3) -342.1 -321.5 0.216 1 1 1 1 1 0 1 1 2(#3) -342.3 -336.7 0.114 0 0 0 1 0 0 0 1 11(#1) -344.6 -322.1 0.216 1 1 1 1 1 1 1 1 1(#1) -346.3 -342.5 0.078 0 0 0 1 0 0 0 0 1(#2) -349.6 -345.8 0.058 0 0 0 0 1 0 0 0 1(#3) -352.0 -348.2 0.044 0 0 0 0 0 0 0 1 1(#2) -353.9 -350.1 0.032 0 0 0 0 0 0 0 0 0(#3) -356.6 -354.7 0.000 0 0 0 0 0 0 0 0 alcohol cholesterol betadiet 2(#2) 0 0 0 10(#1) 1 1 1 10(#2) 1 0 1 10(#3) 1 1 1 2(#3) 0 0 0 11(#1) 1 1 1 1(#1) 0 0 0 1(#2) 0 0 0 1(#3) 0 0 0 1(#2) 0 0 1 0(#3) 0 0 0 > sum.step(sw,betadata,"betaplasma",includeAIC=T,includeR2=T) numeric matrix: 33 rows, 15 columns. BIC AIC R2 R2a age sex smokstat quetelet vituse calories fat 6(#1) -333.9 -320.8 0.225 0.210 1 1 1 1 1 0 0 5(#1) -334.0 -322.7 0.210 0.197 0 0 1 1 1 1 0 5(#2) -334.2 -322.9 0.209 0.196 1 1 0 1 1 0 0 4(#1) -334.3 -325.0 0.194 0.183 0 0 0 1 1 1 0 5(#3) -334.7 -323.4 0.207 0.194 0 0 1 1 1 0 1 6(#3) -335.0 -321.9 0.219 0.204 1 0 1 1 1 1 0 6(#2) -335.0 -321.9 0.219 0.204 1 1 0 1 1 1 0 4(#2) -335.1 -325.7 0.190 0.179 0 0 1 1 1 0 0 4(#3) -335.3 -326.0 0.189 0.178 0 0 0 1 1 0 1 7(#1) -335.4 -320.5 0.232 0.214 1 1 1 1 1 1 0 7(#2) -335.5 -320.5 0.231 0.214 1 1 1 1 1 0 1 7(#3) -335.8 -320.8 0.230 0.212 1 1 1 1 1 0 0 8(#1) -336.8 -320.0 0.239 0.219 1 1 1 1 1 1 0 3(#1) -337.0 -329.5 0.165 0.157 0 0 1 1 1 0 0 8(#2) -337.2 -320.3 0.237 0.217 1 1 1 1 1 0 1 3(#2) -337.3 -329.8 0.163 0.155 0 0 0 1 1 0 0 8(#3) -337.4 -320.5 0.236 0.216 1 1 1 1 1 1 0 3(#3) -338.1 -330.6 0.159 0.151 0 0 0 1 1 0 0 9(#1) -338.9 -320.1 0.243 0.220 1 1 1 1 1 1 0 9(#2) -339.2 -320.5 0.241 0.219 1 1 1 1 1 0 1 9(#3) -339.5 -320.8 0.240 0.217 1 1 1 1 1 1 0 2(#1) -340.4 -334.7 0.131 0.125 0 0 0 1 1 0 0 fiber alcohol cholesterol betadiet 6(#1) 1 0 0 0 5(#1) 1 0 0 0 5(#2) 1 0 0 0 4(#1) 1 0 0 0 5(#3) 1 0 0 0 6(#3) 1 0 0 0 6(#2) 1 0 0 0 4(#2) 1 0 0 0 4(#3) 1 0 0 0 7(#1) 1 0 0 0 7(#2) 1 0 0 0 7(#3) 1 1 0 0 8(#1) 1 1 0 0 3(#1) 0 0 0 0 8(#2) 1 1 0 0 3(#2) 1 0 0 0 8(#3) 1 0 0 1 3(#3) 0 0 0 1 9(#1) 1 1 0 1 9(#2) 1 1 0 1 9(#3) 1 1 1 0 2(#1) 0 0 0 0 BIC AIC R2 R2a age sex smokstat quetelet vituse calories fat 2(#2) -340.6 -335.0 0.129 0.124 0 0 1 1 0 0 0 10(#1) -341.7 -321.1 0.243 0.218 1 1 1 1 1 1 0 10(#2) -341.8 -321.2 0.243 0.218 1 1 1 1 1 1 1 10(#3) -342.1 -321.5 0.241 0.216 1 1 1 1 1 0 1 2(#3) -342.3 -336.7 0.120 0.114 0 0 0 1 0 0 0 11(#1) -344.6 -322.1 0.243 0.216 1 1 1 1 1 1 1 1(#1) -346.3 -342.5 0.081 0.078 0 0 0 1 0 0 0 1(#2) -349.6 -345.8 0.061 0.058 0 0 0 0 1 0 0 1(#3) -352.0 -348.2 0.047 0.044 0 0 0 0 0 0 0 1(#2) -353.9 -350.1 0.035 0.032 0 0 0 0 0 0 0 0(#3) -356.6 -354.7 0.000 0.000 0 0 0 0 0 0 0 fiber alcohol cholesterol betadiet 2(#2) 0 0 0 0 10(#1) 1 1 1 1 10(#2) 1 1 0 1 10(#3) 1 1 1 1 2(#3) 1 0 0 0 11(#1) 1 1 1 1 1(#1) 0 0 0 0 1(#2) 0 0 0 0 1(#3) 1 0 0 0 1(#2) 0 0 0 1 0(#3) 0 0 0 0 >