Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205399

Calculate probability of value based on 2D density plot in R

$
0
0

I'm looking to work out a function to calculate the likelihood of a certain combination for B and R. The current illustration of the data looks like so:

ggplot(df, aes(R,B)) +
geom_bin2d(binwidth = c(1,1))

enter image description here

Is there a way to calculate the probabilities of each combination (e.g. R = 23, B = 30) based on these two discrete correlated variables that are positively skewed?

Could it be possible to use the stat_density_2d to solve or could there be a better way?

Thanks.


Viewing all articles
Browse latest Browse all 205399

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>