tag:blogger.com,1999:blog-6232819486261696035.post4645337786345003486..comments2018-10-05T08:05:00.315-05:00Comments on Getting Genetics Done: More on Exploring Correlations in RStephen Turnerhttp://www.blogger.com/profile/06656711316726116187noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-6232819486261696035.post-52551877713779346012015-02-15T06:31:20.053-06:002015-02-15T06:31:20.053-06:00Just load the package and type the name of the fun...Just load the package and type the name of the function and look around for where it's doing the lowess fitting and mod that to use lm instead. Something like that.<br /><br />library(PerformanceAnalytics)<br /><br />chart.CorrelationStephen Turnerhttps://www.blogger.com/profile/06656711316726116187noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-64202359334817405982015-02-14T13:35:25.291-06:002015-02-14T13:35:25.291-06:00I just started learning R (on my own) so I am not ...I just started learning R (on my own) so I am not sure where to find the source code, is it in the "PerformanceAnalytics" package? Do you have a recommendation as to what code to add/replace?Teenahttps://www.blogger.com/profile/06870895962235401478noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-28410134233840733542015-02-14T09:11:26.309-06:002015-02-14T09:11:26.309-06:00Probably. Have a look at the source code for the c...Probably. Have a look at the source code for the chart.Correlation() function.Stephen Turnerhttps://www.blogger.com/profile/06656711316726116187noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-25695542737754828882015-02-13T17:14:36.834-06:002015-02-13T17:14:36.834-06:00Thank you for the beautiful scatterplot matrix cod...Thank you for the beautiful scatterplot matrix code! For my agricultural data, I would like to replace the lowess overlay line in the lower left scatterplots with a linear regression line and show the slope (m= ) and intercept (y=). is this possible?Teenahttps://www.blogger.com/profile/06870895962235401478noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-77733861908019823422014-05-27T08:34:35.913-05:002014-05-27T08:34:35.913-05:00Hm, you'll probably want to modify the code in...Hm, you'll probably want to modify the code in the chart.Correlation function in the PerformanceAnalytics package. I didn't write this code.Stephen Turnerhttps://www.blogger.com/profile/06656711316726116187noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-89633189248435533892014-05-25T23:42:43.819-05:002014-05-25T23:42:43.819-05:00Great piece of code...thanks!!! Is there a way to ...Great piece of code...thanks!!! Is there a way to show the sign of the correlations instead of absolute values?<br />Akshatahttps://www.blogger.com/profile/03236758894012545888noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-17862312937153967662012-09-20T12:03:42.250-05:002012-09-20T12:03:42.250-05:00Thanks so much, Stephen! Now I've got a place ...Thanks so much, Stephen! Now I've got a place to start! Much appreciated.Markhttps://www.blogger.com/profile/05731792764270401584noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-83589562658732709102012-09-19T06:13:25.814-05:002012-09-19T06:13:25.814-05:001. If you type the name of the function without th...1. If you type the name of the function without the parentheses, you'll see the source code in there. Try modifying or passing a parameter like cex.labels=0.5.<br /><br />2. Best to try the cex.labels argument or else change the variable names.<br /><br />3. This could be any number of things. Sounds like something's wrong with your data. Try using small subsets of your data to nail down the problem. Look for NA's. Look for zeros. Look for NaN's or Inf's. This is part of why data visualization is important - it immediately tells you when you have issues with your data!Stephen Turnerhttps://www.blogger.com/profile/06656711316726116187noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-25799164672831352332012-09-18T12:17:30.147-05:002012-09-18T12:17:30.147-05:00Hey, Stephen!
After working a little more with th...Hey, Stephen!<br /><br />After working a little more with the chart.correlation function, I've got a number of issues that I've encountered:<br /><br />1. I'm working with a somewhat large matrix of traits, such that when the chart is generated, each cell is super small. Is there any way to increase the absolute size of the chart, so that the data are actually visible?<br /><br />2. Similarly, some of my traits have long-ish names, and I was wondering whether there would be a way to wrap the text in the histogram cells (I could change the names of the traits, of course)...<br /><br />3. Finally, I'm noticing that my correlation chart is not a symmetrical matrix in the end (there are several extra columns that don't respond to any additional rows, and it's unclear what trait correlation coefficients are being displayed in them). I'm wondering whether this has something to do with missing data in my dataset (I got several "the standard deviation is zero" warnings, and also an "Error in cor.test.default(x, y) : not enough finite observations" message).<br /><br /><br />Any help or suggestions that you might have would be extremely appreciated! (And I'd be more than happy to send you my data and/or pictures of the chart I have so far privately).Markhttps://www.blogger.com/profile/05731792764270401584noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-88090081646980751212012-09-17T14:32:39.845-05:002012-09-17T14:32:39.845-05:00*facePalm*. Of course. Thank you.*facePalm*. Of course. Thank you.Markhttps://www.blogger.com/profile/05731792764270401584noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-13494549715096921822012-09-17T14:21:48.077-05:002012-09-17T14:21:48.077-05:00The plots below the diagonal are just scatterplots...The plots below the diagonal are just scatterplots. E.g., if you want to see how dispersion and weight relate, follow the "wt" to the left, and "disp" down, and where they intersect is the scatterplot (with a lowess smooth overlay). E.g. circled in blue <a href="http://i.imgur.com/B1oFF.png" rel="nofollow">in this image</a>.Stephen Turnerhttps://www.blogger.com/profile/06656711316726116187noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-41779230550047081242012-09-17T14:09:21.229-05:002012-09-17T14:09:21.229-05:00Hey, Stephen! This is amazing! I'm a total sta...Hey, Stephen! This is amazing! I'm a total statistics noob, and I'm confused about what information the plots in the lower half of the circle are actually giving. Any help?Markhttps://www.blogger.com/profile/05731792764270401584noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-58317727336896395752012-09-14T08:30:23.579-05:002012-09-14T08:30:23.579-05:00cor() gives you correlations for all pairwise nume...cor() gives you correlations for all pairwise numeric vectors, and the cor.prob() function above extends this to give you both the correlation and cor.test() for pairwise combination. Stephen Turnerhttps://www.blogger.com/profile/06656711316726116187noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-13596000803636671932012-09-14T05:34:23.285-05:002012-09-14T05:34:23.285-05:00Was there any particular reason for reinventing co...Was there any particular reason for reinventing cor.test()?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-82364813651836798572012-09-06T02:49:16.115-05:002012-09-06T02:49:16.115-05:00Thanks for sharing Stephen! Your blog is always a ...Thanks for sharing Stephen! Your blog is always a solid read.Emil Rehnberghttps://www.blogger.com/profile/04740762860737608311noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-41878228745477598332012-09-02T23:33:48.060-05:002012-09-02T23:33:48.060-05:00Thanks for the post. chart.Correlation is very us...Thanks for the post. <em>chart.Correlation</em> is very useful. <a href="http://pisqually.wordpress.com/2012/09/03/dimensionality-and-correlation/" rel="nofollow">Here's</a> a little piece I wrote about using the correlation dimension to get a feeling for the distortions caused by groups of highly correlated variables, assuming one is looking for (groups of high) correlations as something to eliminate.ndronenhttps://www.blogger.com/profile/00041745378317892827noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-43831241036290353572012-08-28T18:34:36.278-05:002012-08-28T18:34:36.278-05:00Amazing graphic ! I'll put this in my preferen...Amazing graphic ! I'll put this in my preference list. Thanks for share. :)Evandro Lopeshttps://www.blogger.com/profile/13074109321857133369noreply@blogger.comtag:blogger.com,1999:blog-6232819486261696035.post-24458865773766926382012-08-28T18:33:09.558-05:002012-08-28T18:33:09.558-05:00This comment has been removed by the author.Evandro Lopeshttps://www.blogger.com/profile/13074109321857133369noreply@blogger.com