Link Search Menu Expand Document

POST-PROCESSING

In phrapl each model in a given set of models can be explored independently (by specifying the modelRange in `GridSearch). Then, the output files can be concatenated to calculate model-averaged parameter values and positive Akaike weights (wAIC). These weights are calculated to normalize the AIC values and can be interpreted as model probabilities, where the sum of all wAIC values in a given set of models is equal to 1. The following example will guide through this process.

#############################################
### Post-process phrapl RDA output files  ###

# Set working Directory
setwd("/your_working_directory/")

# Load phrapl
library(phrapl)

# Concatenate results
totalData<-ConcatenateResults(rdaFilesPath=path_to_phrapl_RDA_output_files,
rdaFiles=NULL,
outFile=NULL,
addAICweights=TRUE,
rmNaParameters=TRUE,
addTime.elapsed=FALSE)

# Calculate model averages
modelAverages<-CalculateModelAverages(totalData,parmStartCol=9)

# Save output
write.table(totalData, file=totalData.txt, sep="\t", row.names=FALSE)