On Wed, 14 Sep 2011, Mauricio Cornejo wrote:
Hello,
I'm wondering if the 'mosaic' plot of the vcd package (or any other
function for that matter) can be used with a continuous variable that
should be represented via various categorical variables.? All the
documentation I've read lead me to believe that it only works with
counts of categories.
Alternatively, I've thought of first creating a contingency table where
the frequencies would really be the values of my continuous variable as
opposed to counts ... but I don't know how to do that.
Well, you can always use cut() to create a categorical variable from a
continuous variable. But you have to do that in advance before calling
mosaic().
For a bivariate display with a continuous x and a categorical y, you can
use spine() which does the categorization for you.
hth,
Z
Any insight would be appreciated.
Thanks,
Mauricio
[[alternative HTML version deleted]]
______________________________________________
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.