Re: [R] 2 D density plot interpretation and manipulating the data

2020-10-09 Thread David Winsemius
I’m wondering if you do any searching of the Web or use the help facilities before asking questions? When I posed the question to Google’s search facilities I immediately was directed to, unsurprisingly, the help page text in a webpage format: https://ggplot2.tidyverse.org/reference/geom_densit

Re: [R] 2 D density plot interpretation and manipulating the data

2020-10-09 Thread Abby Spurdle
> SNP$density <- get_density(SNP$mean, SNP$var) > > summary(SNP$density) >Min. 1st Qu. MedianMean 3rd Qu.Max. > 0 383 696 73811701789 This doesn't look accurate. The density values shouldn't all be integers. And I wouldn't expect the smallest density to be ze

Re: [R] 2 D density plot interpretation and manipulating the data

2020-10-09 Thread Ana Marija
Hi Abby, Thanks for getting back to me, yes I believe I did that by doing this: SNP$density <- get_density(SNP$mean, SNP$var) > summary(SNP$density) Min. 1st Qu. MedianMean 3rd Qu.Max. 0 383 696 73811701789 where get_density() is function from here: https://

Re: [R] 2 D density plot interpretation and manipulating the data

2020-10-09 Thread Abby Spurdle
You could assign a density value to each point. Maybe you've done that already...? Then trim the lowest n (number of) data points Or trim the lowest p (proportion of) data points. e.g. Remove the data points with the 20 lowest density values. Or remove the data points with the lowest 5% of densit

Re: [R] 2 D density plot interpretation and manipulating the data

2020-10-09 Thread Ana Marija
Hi Bert, Another confrontational response from you... You might have noticed that I use the word "outlier" carefully in this post and only in relation to the plotted ellipses. I do not know the underlying algorithm of geom_density_2d() and therefore I am having an issue of how to interpret the pl

Re: [R] 2 D density plot interpretation and manipulating the data

2020-10-09 Thread Bert Gunter
I recommend that you consult with a local statistical expert. Much of what you say (outliers?!?) seems to make little sense, and your statistical knowledge seems minimal. Perhaps more to the point, none of your questions can be properly answered without subject matter context, which this list is no

Re: [R] 2 D density plot interpretation and manipulating the data

2020-10-09 Thread Ana Marija
Hi Abby, thank you for getting back to me and for this useful information. I'm trying to detect the outliers in my distribution based of mean and variance. Can I see that from the plot I provided? Would outliers be outside of ellipses? If so how do I extract those from my data frame, based on whi

Re: [R] 2 D density plot interpretation and manipulating the data

2020-10-09 Thread Abby Spurdle
> My understanding is that this represents bivariate normal > approximation of the data which uses the kernel density function to > test for inclusion within a level set. (please correct me) You can fit a bivariate normal distribution by computing five parameters. Two means, two standard deviation

Re: [R] 2 D density plot interpretation and manipulating the data

2020-10-08 Thread Ana Marija
My understanding is that this represents bivariate normal approximation of the data which uses the kernel density function to test for inclusion within a level set. (please correct me) In order to exclude the outlier to these ellipses/contours is it advisable to do something like this: SNP$densit

[R] 2 D density plot interpretation and manipulating the data

2020-10-08 Thread Ana Marija
Hello, I have a data frame like this: > head(SNP) mean var sd FQC.10090295 0.0327 0.002678 0.0517 FQC.10119363 0.0220 0.000978 0.0313 FQC.10132112 0.0275 0.002088 0.0457 FQC.10201128 0.0169 0.000289 0.0170 FQC.10208432 0.0443 0.004081 0.0639 FQC.10218466 0.0116 0.000131 0.