AMOVA with single stratum data

113 views
Skip to first unread message

Martin Boys

unread,
Oct 23, 2022, 2:08:17 PM10/23/22
to po...@googlegroups.com
Good Evening All!

May someone please explain to me step by step how I  can do AMOVA with data that only has one stratum without having to stratify the data, especially when the data is too difficult to assign strata to. I read the paper by Kamvar et al on population genetics and genomics but, the demonstrations were based on stratified data only. I will really appreciate your inputs on this and I thank you wholeheartedly in advance.

Kindest regards
Martin

Zhian Kamvar

unread,
Oct 24, 2022, 8:28:53 PM10/24/22
to Martin Boys, po...@googlegroups.com
Hi Martin,

You can assign a single stratum to your data by using the `strata(myData) <- dataFrame` syntax. 
If you already have a population factor for your data (you can check this by running `nPop(myData) > 0` to make sure you have a population set), then you can assign the strata with that.

Here's an example using the nancycats data set. I've highlighted the line that sets the strata in bold:
library("poppr")
data(nancycats) # embedded data set of cat colonies from Nancy, FR
strata(nancycats) <- data.frame(colony = pop(nancycats)) # create a strata from the one population factor
poppr.amova(nancycats, ~colony) # run AMOVA, using the colony as the single stratum
#> 
#> Found 617 missing values.
#> 
#> 2 loci contained missing values greater than 5%
#> 
#> Removing 2 loci: fca8, fca45
#> Warning in is.euclid(xdist): Zero distance(s)
#> Distance matrix is non-euclidean.
#> Using quasieuclid correction method. See ?quasieuclid for details.
#> Warning in is.euclid(distmat): Zero distance(s)
#> $call
#> ade4::amova(samples = xtab, distances = xdist, structures = xstruct)
#> 
#> $results
#>                                Df    Sum Sq   Mean Sq
#> Between colony                 16  288.5021 18.031384
#> Between samples Within colony 220 1235.8990  5.617723
#> Within samples                237 1015.6256  4.285340
#> Total                         473 2540.0268  5.370035
#> 
#> $componentsofcovariance
#>                                               Sigma          %
#> Variations  Between colony                0.4476284   8.290705
#> Variations  Between samples Within colony 0.6661912  12.338794
#> Variations  Within samples                4.2853402  79.370501
#> Total variations                          5.3991598 100.000000
#> 
#> $statphi
#>                           Phi
#> Phi-samples-total  0.20629499
#> Phi-samples-colony 0.13454246
#> Phi-colony-total   0.08290705

--
You received this message because you are subscribed to the Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/CAKiZ3%3DuANU%2BAz5vhpt-u9TmGm2JXqrXt%2B-10_9xAoBVU9bBpyA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages