<div dir="ltr">Hello All,<div><br></div><div>I'm pretty new to R and this forum. I've spent the last 2 days searching through the archive but to no avail. </div><div><br></div><div>I've run an spca on my data which includes 5 populations with fragment sizes for 9 microsatellite loci. Each population has between 22 and 39 individuals. The xy coordinates for the 5 populations has been loaded to the "other" slot the genepop file containing my data. I however keep getting warning messages and I haven't been able to figure out why. I've been trying to wrap my head around statistics and R for a while now and I'm making some improvements but this one has me stumped. There are two issues:</div><div><br></div><div>1. I'm trying to edit the connection network using edit.nb but R keeps aborting and restarts the session when I begin to interact with the graph to select the connection I want to delete.</div><div><br></div><div>spca<- spca(obj, edit.nb=TRUE)</div><div><br></div><div>2.The spca runs without a hitch when I use spca(). The problem is that I get the warning messages when I plot it using plot (spca). I have also run the Global and Local tests as well before I plot the spca the result.  Below is the script I use and the resulting errors:</div><div><br></div><div><div>> spca <- spca(obj)</div><div><br></div><div>Choose a connection network:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> Delaunay triangulation (type 1)</div><div><span class="Apple-tab-span" style="white-space:pre">     </span> Gabriel graph (type 2)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span> Relative neighbours (type 3)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> Minimum spanning tree (type 4)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span> Neighbourhood by distance (type 5)</div><div><span class="Apple-tab-span" style="white-space:pre">  </span> K nearest neighbours (type 6)</div><div><span class="Apple-tab-span" style="white-space:pre">       </span> Inverse distances (type 7)</div><div>Answer: </div><div>2 - Gabriel graph</div><div><br></div><div>Keep this graph (y/n)? </div><div>y</div><div>Select the first number of axes (>=1): </div><div>1</div><div>Select the second number of axes (>=0): </div><div>2</div><div><br></div><div><img src="cid:152cd08c945d0cad2201" alt="pasted1" class="GQ" style="max-width: 100%; opacity: 1;"><br></div><div><br></div><div>> X<- scaleGen(obj)###Gets rid of missing data</div><div>> </div><div>> myGtest <- global.rtest(X,spca$lw,nperm=50000)###Runs global stats</div><div>> myGtest</div><div>Monte-Carlo test</div><div>Call: global.rtest(X = X, listw = spca$lw, nperm = 50000)</div><div><br></div><div>Observation: 0.2588172 </div><div><br></div><div>Based on 50000 replicates</div><div>Simulated p-value: 0.647667 </div><div>Alternative hypothesis: greater </div><div><br></div><div>     Std.Obs  Expectation     Variance </div><div>-0.445824651  0.266881510  0.000327198 </div><div>> plot(myGtest)</div><div>> myLtest <- local.rtest(X,spca$lw,nperm=50000)###Runs local Stats</div><div>> myLtest</div><div>Monte-Carlo test</div><div>Call: local.rtest(X = X, listw = spca$lw, nperm = 50000)</div><div><br></div><div>Observation: 0.2573817 </div><div><br></div><div>Based on 50000 replicates</div><div>Simulated p-value: 0.7091858 </div><div>Alternative hypothesis: greater </div><div><br></div><div>      Std.Obs   Expectation      Variance </div><div>-0.6498182785  0.2675756071  0.0002460908 </div></div><div><br></div><div>plot(spca)</div><div><img src="cid:152cd0ae1dfd0cad2212" alt="pasted2" class="GQ" style="max-width: 100%; opacity: 1;"><br></div><div><div>Warning messages:</div><div>1: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :</div><div>  span too small.   fewer data values than degrees of freedom.</div><div>2: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :</div><div>  pseudoinverse used at -151.9 50.468</div><div>3: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :</div><div>  neighborhood radius 3.8482</div><div>4: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :</div><div>  reciprocal condition number  0</div><div>5: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :</div><div>  There are other near singularities as well. 14.477</div><div>6: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :</div><div>  Chernobyl! trL>n 3.5458</div><div>7: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :</div><div>  Chernobyl! trL>n 3.5458</div></div><div><br></div><div>I hope you'll be able to help me or direct me to some help. I'm a strict biologist and this is my first plunge into spatial genetic analysis.</div><div><br></div><div>Thanks</div></div><div dir="ltr">-- <br></div><p dir="ltr"><br>
Mr. Kimani Kitson-Walters BSc (Hons)<br>
Smithsonian Link Fellow 2015<br>
</p>