<div dir="ltr"><div><div><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal">Hi Thibaut and Adegenet users,</span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"> </span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal">I have a follow-up question to one I asked back in March 2012. I have more data to appreciate what you were suggesting then (original correspondence pasted below).</span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"> </span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal">In short, we would like to test whether "groups" of genotypes are significantly separated in discriminant function space. We proposed using a MANOVA of the individual</span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"> </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal">coordinates coming from DAPC to do this. Now that I've tested another 2 datasets, Thibaut was correct that these usually come out significant regardless of actual</span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"> </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal">clustering patterns in DF space. The original code looked like this:</span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal">model <- manova(dapcobject$ind.coord~genindobject$pop) </span><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal">summary(model, test=”Wilks”) <br><br>But you mentioned that a MANOVA could be done on the retained PCs after the PCA step - the more traditional test with discriminant analysis. After trying to apply this with our new datasets, we are hoping to clarify 2 things:<br><br>1. To execute this, do you mean to use the $tab item in the dapc output (i.e. "retained PCs of PCA"), in place of the $ind.coord item? Or did you mean a step earlier in the find.clusters PC retention step? <br><br>2. If you meant the dapc step, the structure of the $tab data appears to make it much more difficult to pull into an MANOVA analysis (i.e., it is a data frame with 1 observation per genotype, and # of variables equal to PCs retained). The $ind.coord data is numeric with (not surprisingly) 2 values per genotype relating to the location in DF space. <br><br>I'm hoping you can confirm question 1 before I spend too much more time figuring out the data formatting issue in #2.    <br><br>I should also say thank you for your time and efforts developing and supporting Adegenet; I am finding it more useful through the years.<br><br>Thank you very much! <br><br>- Jon</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;line-height:normal"><br><br>_______________________<br>Archived emails:<br><br>3March2012:<div><br><div>Hello again Dr. Jombart and Adegenet users,</div><div><br></div><div>I have a follow-up question related to the grouping of individuals not using k-means.</div><div><br></div><div>We would like to test whether the group assignment (assigned by us) is significantly related to the location of individuals in the discriminant function (DF) space. To do this we have taken the following approach:</div><div><br></div><div>1. Perform a MANOVA on the individual DF coordinates with group class as the predictor variable. The idea here is that (A) the Wilks lamba test provides a metric of separation among the groups and (B) accounts for correlation among variables (DFs). The test code is:</div><div><br></div><div>model <- manova(dapcobject$ind.coord~genindobject$pop)</div><div>summary(model, test=”Wilks”)</div><div><br></div><div>2. However, we are worried that the significance value obtained by MANOVA (which was remarkably small) might be anti-conservative (i.e. high Type-I error) because DAPC has already maximized among group variation and uncovered structure that might be evident even in random datasets.</div><div><br></div><div>Therefore, we came up with a randomization test.  We first create a null DF distribution by randomizing the rows/individuals in the “genind” data object so that the number of individuals per group remains the same, but the individuals contained in each group are now randomized. We do this 1000 times and perform the DAPC and MANOVA operations on all 1000 sets to obtain the randomized distribution. Lastly, we compare our empirical Wilks lambda value with the randomized distribution to determine if our Wilks is larger than expected based on random chance.</div><div><br></div><div>Does this seem reasonable? Our hesitation is related to some initial results from our dataset. When we run the empirical dataset with 3 defined groups, the DAPC produces 3 clear clusters with some small overlap (i.e. the 3 a priori groups segregate very nicely in DF space). However, when we randomized the alleles and genotypes, the resulting DAPC with the same group sizes also results in 3 clear clusters, but that have noticeably more ellipse overlap than the empirical data. So we are wondering whether the a priori group designation (related to a substantial habitat and phenotypic difference in our case) will mandate some level of clustering – but with DAPC also looking to optimize grouping segregation in DF space the patterns become clearer and maybe somewhat spurious (at least in our case)?</div><div><br></div><div>Any insight you can provide would be greatly appreciated. Thank you in advance.</div><div><br></div><div>Jon</div><br class="">_________</div><div><br>6 March 2012:</div><div><br>Hello, <br><div>Yes, as you suggest the approach described in 1 is circular, and the test should nearly always be significant. The second approach is not ideal because the amount of discrimination - and therefore your test statistics - depends on the retained variation in the dimension-reduction/PCA step, which is likely to vary from one permutation to another.</div><div><br></div><div>I would perform the MANOVA on the retained PCs after the PCA step. This should be less computer intensive, and is the traditional test associated to discriminant analysis.</div><div><br></div><div>Cheers</div><div> </div>Thibaut </div></div></div></div></div>