[R] cdplot????

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Thu Oct 1 18:05:32 CEST 2009


On Thu, 1 Oct 2009, kayj wrote:

> I am having difficulties interpreting a cdplot, I have a binary variable y
> that I want to cdplot against a continuous variable x,below is the R command
>
> cdplot(y~x, data=mydata)
>
> you get a plot with a dark shaded area and a light shaded area. what do
> these areas mean? and how to interpret the plot?
>
> you help is greatly appreciated

See ?cdplot. It's a display that graphs (an approximation of) P(y | x) 
against x. The areas above and below the line are simply shaded in 
different levels of gray.

To obtain P(y | x), the idea is to use

   f(y | x) = f(x | y) * f(x)/f(y)

where for f(x) and f(x | y) are obtained by (unconditional and 
conditional, respectively) kernel density smoothers from density().
f(y) is simply the unconditional proportion of the category y.

hth,
Z

>
> -- 
> View this message in context: http://www.nabble.com/cdplot-----tp25696905p25696905.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>
>




More information about the R-help mailing list