Displaying 1 result from an estimated 1 matches for "contrastvar".
Did you mean:
contrastar
2012 Jan 03
1
returning information from functions via attributes rather than return list
...dm: design matrix, only includes intercept and predictors
dm <- model.matrix(model, data=rdf, contrasts.arg =
model$contrasts, xlev = model$xlevels)
##contrastIdx: indexes of contrast variables in dm
contrastIdx <- which(attr(dm, "assign")== match(isFac, tl))
contrastVars <- colnames(dm)[contrastIdx]
nc <- c(nc, contrastVars)
dm <- as.data.frame(dm)
hasIntercept <- attr(t, "intercept")
if (hasIntercept) dm <- dm[ , -1] # removes intercept, column 1
dv <- rdf[ ,names(tmdc)[1]] #tmdc[1] is response variable...