[R] Question about coplot() ...

Thomas Lumley thomas at biostat.washington.edu
Thu Dec 21 17:02:09 CET 2000


On Thu, 21 Dec 2000, C. Joseph Lu wrote:

> Thanks kind suggestions from Bendix Carstensen and Emmanuel Paradis
> for my question about coplot():
> 
> > >> coplot(y ~ x|i, data=xy)
> > >coplot gives 3 panels, rather than 2, namely one for i=1 and one for
> > >i=2.
> > Try:
> >         coplot(y ~ x|factor(i), data=xy)
> 
> Actually, my question is on:
> 
>     Is this appropriate (with default settings of coplot)?
>                        ^^^^^^^^^^^^^^^^^

Yes it is.  If you are conditioning on a numeric variable you will get a
set of overlapping conditioning sets (I believe they are called 'shingles'
for this reason). If you are conditioning on a factor then this doesn't
make sense.  The default is to treat factors as factors and numeric
variables as numeric. It would be possible to assume that a variable with
only 2 levels, say, was a factor, but this wouldn't help much. A variable
with 4 levels might be a factor but might not, so it's better to be
consistent and rely on the type of variable.


	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list