search for: countlist

Displaying 2 results from an estimated 2 matches for "countlist".

Did you mean: mountlist
2005 Mar 17
1
Cross validation, one more time (hopefully the last)
...----- logcv <- function(mdata, formula, rvar, fvar) { require(Hmisc) # sort by fold variable sorted <- mdata[order(mdata$fvar), ] # get fold values and count for each group vardesc <- describe(sorted$fvar)$values fvarlist <- as.integer(dimnames(vardesc)[[2]]) k <- length(fvarlist) countlist <- vardesc[1,1] for (i in 2:k) { countlist[i] <- vardesc[1,i] } n <- length(sorted$fvar) # fit to all the mdata fit.all <- glm(formula, sorted, family=binomial) pred.all <- ifelse( predict(fit.all, type="response") < 0.5, 0, 1) #setup pred.c <- list() error.i <-...
2005 Mar 18
2
logistic model cross validation resolved
...require(Hmisc) require(ipred) # determine index of variables rpos <- match(rvar, names(mdata)) fpos <- match(fvar, names(mdata)) # get fold values and count for each group vardesc <- describe(mdata[[fpos]])$values fvarlist <- as.integer(dimnames(vardesc)[[2]]) k <- length(fvarlist) countlist <- vardesc[1,1] for (i in 2:k) { countlist[i] <- vardesc[1,i] } n <- length(mdata[[fpos]]) # get index list for each fold cc <- list() for (i in 1:k) { cc[[i]] <- as.integer(rownames(mdata[mdata[[fpos]] == fvarlist[i], ])) } # determine root mean squared error ee <- errorest(fo...