[R] plotting positive predictive values
r2L
ruserman at gmail.com
Fri Sep 4 12:34:45 CEST 2009
Hi,
I'm trying to fit a smooth line in a plot(y ~ x) graph.
x is continuous variable
y is a proportion of success in sub-samples, 0 <= y <= 1, from a Monte
Carlo simulation.
For each x there may be several y-values from different runs. Each run
produces several sub-samples, where "0" mean no success in any sub-
sample, "0.5" means success in half of the sub-samples, and "1" means
success in all sub-samples, and so on.
As x is increased, the y-value approaches 1, and may reach it; it can,
of course never bypass it.
>From my understanding of the data at hand, each point along the x-axis
has its own beta-distribution of the y-values, then as 0 <= y <= 1,
which shift gradually through distributions similar to
curve(dbeta(x,2, 2), add=F, col="red", xlim=c(0,1), ylim=c(0,4))
curve(dbeta(x,4, 2), add=T, col="red", xlim=c(0,1), ylim=c(0,4))
curve(dbeta(x,4, 1), add=T, col="red", xlim=c(0,1), ylim=c(0,4))
curve(dbeta(x,4, .1), add=T, col="red", xlim=c(0,1), ylim=c(0,4))
as x increases.
If I plot my data using boxplot it shows also very nicely how the the
data approaches 1 and variation decreases. However, my x-axis data are
continuous.
Is there a way to produce a regression line which would smoothly
follow that trend?
It may well be easier than I believe, but my head is at a full-stop...
Thanks for any help!
More information about the R-help
mailing list