weight.IC {mmodely} | R Documentation |
Get IC weights
Description
An implementation of IC weighting that first calulates the difference in IC values by subtracting all values from the lowest IC value. Second, the changes are expoentiated divided by a sum of the same and exponentiated yet again.
Usage
weight.IC(IC)
Arguments
IC |
a vector of IC values |
Value
a vector of IC based weights
Examples
data.path <- system.file("extdata","primate-example.data.csv", package="mmodely")
data <- read.csv(data.path, row.names=1)
pvs <- names(data[3:5])
data$gn_sp <- rownames(data)
tree.path <- system.file("extdata","primate-springer.2012.tre", package="mmodely")
phyl <- ape::read.tree(tree.path)[[5]]
comp <- comp.data(phylo=phyl, df=data)
mods <- get.model.combos(predictor.vars=pvs, outcome.var='OC', min.q=2)
PGLSi <- pgls.iter(models=mods, phylo=phyl, df=data, k=1,l=1,d=1)
AICc.w <- weight.IC(IC=PGLSi$optim$AICc)
[Package mmodely version 0.2.5 Index]