<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style><style type="text/css"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Kirsty,
<div><br>
</div>
<div>going through all your analyses to check that they are correct is asking for more time than most people will be ready to contribute on any given forum, especially since the outcome will benefit to a single person as opposed to the community. You are more
likely to get help asking short specific questions, or tackling general issues. <br>
<div><br>
</div>
<div>DAPC is quite extensively documented so following the steps of the online tutorial should be relatively safe. If you have specific questions then you are more than welcome to post them here forum.</div>
<div><br>
</div>
<div>After going quickly over the graphs: it looks like 3 clusters might be a good summary of your data, and that most of your data fits in a fairly small space (adding PCs past the 4th one don't add much explained variance).</div>
<div><br>
</div>
<div>Cheers</div>
<div>Thibaut</div>
<div>
<div style="font-family:Tahoma; font-size:13px">
<div class="BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="PlainText"> <br>
==============================<br>
Dr Thibaut Jombart<br>
MRC Centre for Outbreak Analysis and Modelling<br>
Department of Infectious Disease Epidemiology<br>
Imperial College - School of Public Health<br>
Norfolk Place, London W2 1PG, UK<br>
Tel. : 0044 (0)20 7594 3658<br>
http://sites.google.com/site/thibautjombart/<br>
http://sites.google.com/site/therepiproject/<br>
http://adegenet.r-forge.r-project.org/<br>
Twitter: @thibautjombart<br>
<br>
<br>
</div>
</span></font></div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF463420" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> adegenet-forum-bounces@lists.r-forge.r-project.org [adegenet-forum-bounces@lists.r-forge.r-project.org] on behalf of Kirsty Medcalf [kirsty.m.medcalf@gmail.com]<br>
<b>Sent:</b> 11 October 2015 07:25<br>
<b>To:</b> adegenet-forum@lists.r-forge.r-project.org<br>
<b>Subject:</b> [adegenet-forum] Interpretation of DAPC results<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr"><br clear="all">
<div>
<div>Dear Jombert and the adegenet forum, </div>
<div><br>
</div>
<div>I have used the function find.clusters and conducted a DAPC analysis to create a scatterplot. In addition to conducting a cross validation using a 70 % training set over 30 repeats using the function xvalDapc. If this is possible, I was wondering if I
could please ask for advice regarding the interpretation of my results. If this is possible, then I would be deeply appreciative and would hold you in the highest regard. </div>
<div><br>
</div>
<div>The code can be found on my stack overflow page and the output figures are attached. </div>
<div><br>
</div>
<div>
<div><a href="http://stackoverflow.com/questions/32704902/discriminant-analysis-of-principal-components-and-how-to-graphically-show-the-di" target="_blank">http://stackoverflow.com/questions/32704902/discriminant-analysis-of-principal-components-and-how-to-graphically-show-the-di</a><br>
</div>
</div>
<div><br>
</div>
<div>After running a DAPC analysis, as well as a basic PCA and LDA analysis. The PCA output describes two PC's to explain the models variance, and the LDA found one discriminant function to describe the variance of the data. My data is a multivariate analysis
rather than an exploration of genetic clusters. The reproducible data can be found in the link above. If this is possible, I was wondering if anyone can explain why the DAPC found more structure in the data by finding 3 clusters. More specifically I was wondering
if anyone would mind reading my stack overflow page to see if I have followed the correct steps to create an accurate model. </div>
<div><br>
</div>
<div>My code for the cross validation (below) shows the probability of assigning the correct PC's more than random chance. Would I be right in saying that the accuracy rate of selecting the right number of PC's is 61 % and that the most optimal model would
only contain an assignment of only one PC. My goal is to completely understand each step of this analysis. </div>
<div><br>
</div>
<div><br>
</div>
<div>Thank you so much for your patience If you read the whole content of this post if someone has the ability to provide advice regarding the interpretation of these result, then thank you in advance. </div>
<div><br>
</div>
<div>Best wishes</div>
<div><br>
</div>
<div>Kirsty</div>
<div><br>
</div>
<div>My cross validation code and results are: <br>
</div>
<div><br>
</div>
<div>
<div>xval <- xvalDapc(x, grp1$grp, n.pca.max = 2, training.set = 0.7,</div>
<div> result = "groupMean", center = TRUE, scale = FALSE,</div>
<div> n.pca = NULL, n.rep = 30, xval.plot = TRUE)</div>
</div>
<div><br>
</div>
<div>
<div>$`Cross-Validation Results`</div>
<div> n.pca success</div>
<div>1 1 0.5833333</div>
<div>2 1 0.6000000</div>
<div>3 1 0.6000000</div>
<div>4 1 0.6666667</div>
<div>5 1 0.5833333</div>
<div>6 1 0.6666667</div>
<div>7 1 0.6000000</div>
<div>8 1 0.5833333</div>
<div>9 1 0.6666667</div>
<div>10 1 0.5833333</div>
<div>11 1 0.6000000</div>
<div>12 1 0.5833333</div>
<div>13 1 0.5833333</div>
<div>14 1 0.6666667</div>
<div>15 1 0.6000000</div>
<div>16 1 0.6666667</div>
<div>17 1 0.5833333</div>
<div>18 1 0.6666667</div>
<div>19 1 0.5833333</div>
<div>20 1 0.6000000</div>
<div>21 1 0.6666667</div>
<div>22 1 0.6666667</div>
<div>23 1 0.5833333</div>
<div>24 1 0.4666667</div>
<div>25 1 0.6666667</div>
<div>26 1 0.6666667</div>
<div>27 1 0.5166667</div>
<div>28 1 0.6666667</div>
<div>29 1 0.6000000</div>
<div>30 1 0.5166667</div>
<div><br>
</div>
<div>$`Median and Confidence Interval for Random Chance`</div>
<div> 2.5% 50% 97.5% </div>
<div>0.2360938 0.3270833 0.4355208 </div>
<div><br>
</div>
<div>$`Mean Successful Assignment by Number of PCs of PCA`</div>
<div> 1 </div>
<div>0.6094444 </div>
<div><br>
</div>
<div>$`Number of PCs Achieving Highest Mean Success`</div>
<div>[1] "1"</div>
<div><br>
</div>
<div>$`Root Mean Squared Error by Number of PCs of PCA`</div>
<div> 1 </div>
<div>0.3939708 </div>
<div><br>
</div>
<div>$`Number of PCs Achieving Lowest MSE`</div>
<div>[1] "1"</div>
<div><br>
</div>
<div>$DAPC</div>
<div><span style="white-space:pre-wrap"></span>#################################################</div>
<div><span style="white-space:pre-wrap"></span># Discriminant Analysis of Principal Components #</div>
<div><span style="white-space:pre-wrap"></span>#################################################</div>
<div>class: dapc</div>
<div>$call: dapc.data.frame(x = x, grp = grp, n.pca = n.pca, n.da = n.da)</div>
<div><br>
</div>
<div>$n.pca: 1 first PCs of PCA used</div>
<div>$n.da: 1 discriminant functions saved</div>
<div>$var (proportion of conserved variance): 0.605</div>
<div><br>
</div>
<div>$eig (eigenvalues): 54.9 vector length content </div>
<div>1 $eig 1 eigenvalues </div>
<div>2 $grp 80 prior group assignment </div>
<div>3 $prior 3 prior group probabilities </div>
<div>4 $assign 80 posterior group assignment</div>
<div>5 $pca.cent 12 centring vector of PCA </div>
<div>6 $pca.norm 12 scaling vector of PCA </div>
<div>7 $pca.eig 12 eigenvalues of PCA </div>
<div><br>
</div>
<div> data.frame nrow ncol content </div>
<div>1 $tab 80 1 retained PCs of PCA </div>
<div>2 $means 3 1 group means </div>
<div>3 $loadings 1 1 loadings of variables </div>
<div>4 $ind.coord 80 1 coordinates of individuals (principal components)</div>
<div>5 $grp.coord 3 1 coordinates of groups </div>
<div>6 $posterior 80 3 posterior membership probabilities </div>
<div>7 $pca.loadings 12 1 PCA loadings of original variables </div>
<div>8 $var.contr 12 1 contribution of original variables </div>
<div><br>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Kirsty Medcalf</div>
<div> </div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>