Skip to content

EvoArt/PERMANOVA.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PERMANOVA

Build Status Build Status Coverage

PERMANOVA implementation based on the work of McArdle and Anderson. This package aims to provide similar functionality to the adonis2 in the R package vegan. Thus, implementation details are more similar to adonis2 than to the original work by McArdle and Anderson. P-values are calculated via permuting of data (not residuals) and calculating sequential sums of squares. In keeping with names from mythology, we provide an alias to the permanova function :hydra the many headed Lernaean Hydra represents the multivariate response data we aim to tackle here. Though perhaps Heracles or Iolis (the eventual slayers of the Hydra) would be more apt.

drawing

The function permanova/hydra2 expects:

  • data: a table/dataframe with a column containing the independent variables.
  • y: the dependent variables, where each row is an observation
  • metric: distance metric to be used.
  • formula: a StatsModels.jl formula

Alternatively, instead of y and metric, pass in a distance matrix D. The function retruns a PSummary struct containing table - a TexTables.jl formatted ANOVA table for display purposes and results - a NamedArray for easier access to specific results.

Example

using PERMANOVA, DataFrames,Distances
x = rand(1:4,100)
y = rand(100,5)

preds = [[rand(["a","b","c","d"]) for i in 1:100] for j in 1:3]
df = DataFrame(preds,[:X,:Y,:Z])
permanova(df,y,BrayCurtis,@formula(1~X+Y))

TODO

  • Pairwise PerMANOVA

Experimental

  • blocks (strata) e.g. permanova(df,y,BrayCurtis,@formula(1~X+Y), blocks = @formula(block ~ Z))

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages