Allright.. Appreciate the input on non-zero terminology (:-). What I wanted was:
rr<-data.frame(r1=rnorm(1000,10,5),r2=rnorm(1000,220,5)) with(rr,plot(r1,r2)) r3<-kde2d(r1,r2,lims=c(2,18,200,240)) filled.contour(r3) //M On 1. feb. 2011, at 21.26, David Winsemius wrote: > > On Feb 1, 2011, at 2:31 PM, moleps wrote: > >> >> My terminology is probably way off. I´ll try again in plain english. >> >> I´d like to generate a scatter plot of r1 & r2 and color code each pair >> according to the probability of observing the pair given that the two >> samples (r1 & r2) are drawn from two independent normal distributions. > > The answer is still zero. If you want to ask a different question that might > have a non-zero answer, it might be: How can I color points on the basis of > their joint density with an assumption of no correlation , you might get a > better answer. Densities are not probabilities. You would need to specify > whether the arguments to the rnorm functions (i.e. the theoretic values) were > to be used or did you intend to use sample values for mean and sd? > > >> >> rr<-data.frame(r1=-rnorm(1000,10,5),r2=-rnorm(1000,220,5)) >> >> with(rr,plot(r1,r2)) >> >> Best, >> //M >> >> >> >> >> On 31. jan. 2011, at 23.13, Peter Ehlers wrote: >> >>> On 2011-01-31 12:42, moleps wrote: >>>> Dear all, >>>> >>>> Given >>>> >>>> rr<-data.frame(r1<-rnorm(1000,10,5),r2<-rnorm(1000,220,5)) >>>> >>>> >>>> How can I add a column (rr$p) for the joint probability of each r1& r2 >>>> pair? >>> >>> If you take the values in each pair to be observations >>> from two independent Normal distributions, it's easy: >>> The "joint probability" of those values is zero. >>> >>> But I suspect you mean something else by "joint probability". >>> Can you elaborate? >>> >>> Peter Ehlers >>> >>>> I know how to add the column.. I just dont know how to compute the p value >>>> for joint probabilities given the two samples. >>>> >>>> >>>> //M >>>> >>>> ______________________________________________ >>>> R-help@r-project.org mailing list >>>> https://stat.ethz.ch/mailman/listinfo/r-help >>>> PLEASE do read the posting guide >>>> http://www.R-project.org/posting-guide.html >>>> and provide commented, minimal, self-contained, reproducible code. >>> >> >> ______________________________________________ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > David Winsemius, MD > West Hartford, CT > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.