On 2010-04-24 21:30, Anthony Lopez wrote:
Hello R folks,
I am encountering a problem with the following scatterplot function from the
car package:
scatterplot(y~x|z)
where y and x are continuous (interval) random variables and z is a
categorical variable. When z is a categorical variable coded 1 or 2, I
(appropriately) get a scatterplot of y by x, coded by z. Similarly, when z
is a categorical variable coded 1, 2, or 3, there is again, no problem.
However, when z is a categorical variable coded 0 or 1, the scatterplot
scatterplot(y~x|z)
is exactly identical to the one generated by
scatterplot(y~x)
It is not possible that this is due to the fact that there is no difference
between the categories. It is as if R doesn't "see" that I want it coded by
z. But this only happens when one of the categories of z is coded "0" (i.e.
zero). Any ideas why this is so, or how I can fix this without recoding my
variable?
Make z a factor (which it really should be anyway).
-Peter Ehlers
Thank you!
Anthony
[[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.
--
Peter Ehlers
University of Calgary
______________________________________________
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.