Hello, dear R users. What is the easiest and the most visualli understandable way to analize dependency of numerical variable on two factors? Is the boxplot(y~f1+f2) the good way? It seems that this formula does not work.
Evgeniy
6 messages · Brian Ripley, Evgeniy Kachalin
Hello, dear R users. What is the easiest and the most visualli understandable way to analize dependency of numerical variable on two factors? Is the boxplot(y~f1+f2) the good way? It seems that this formula does not work.
Evgeniy
Hello, dear R users. What is the easiest and the most visualli understandable way to analize dependency of numerical variable on two factors?
interaction.plot() is a good start.
Is the boxplot(y~f1+f2) the good way? It seems that this formula does not work.
No, nor is it documented to: the help page is there to help you. You need a single factor as the grouping, so make one via an interaction. boxplot(y ~ f1:f2) should work. E.g. library(MASS) boxplot(FL ~ sex:sp, data=crabs) Another idea is to use lattice's bwplot. E.g. library(lattice) bwplot(FL ~ sex | sp, data=crabs)
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian Ripley ?????:
On Sun, 19 Feb 2006, Evgeniy Kachalin wrote:
Hello, dear R users. What is the easiest and the most visualli understandable way to analize dependency of numerical variable on two factors?
interaction.plot() is a good start.
Is the boxplot(y~f1+f2) the good way? It seems that this formula does not work.
No, nor is it documented to: the help page is there to help you. You need a single factor as the grouping, so make one via an interaction. boxplot(y ~ f1:f2) should work. E.g. library(MASS) boxplot(FL ~ sex:sp, data=crabs)
Does not work: ???????????? ?? if (any(out[nna])) stats[c(1, 5)] <- range(x[!out], na.rm = TRUE) : ?????????????????????? ????????????????, ?? ?????????? TRUE/FALSE ????????????????: Warning messages: 1: + not meaningful for factors in: Ops.factor(x[floor(d)], x[ceiling(d)]) 2: < not meaningful for factors in: Ops.factor(x, (stats[2] - coef * iqr)) 3: > not meaningful for factors in: Ops.factor(x, (stats[4] + coef * iqr)) Hm...
Another idea is to use lattice's bwplot. E.g. library(lattice) bwplot(FL ~ sex | sp, data=crabs)
That's not the point. The scales may differ significantly, also this is not conviniet for many factors.
I carefully tested my suggestions in the current version of R, 2.2.1, before posting. They DO work, and as you have not even told us your version of R, we have no idea what you have broken on your R installation.
Prof Brian Ripley ?????:
On Sun, 19 Feb 2006, Evgeniy Kachalin wrote:
Hello, dear R users. What is the easiest and the most visualli understandable way to analize dependency of numerical variable on two factors?
interaction.plot() is a good start.
Is the boxplot(y~f1+f2) the good way? It seems that this formula does not work.
No, nor is it documented to: the help page is there to help you. You need a single factor as the grouping, so make one via an interaction. boxplot(y ~ f1:f2) should work. E.g. library(MASS) boxplot(FL ~ sex:sp, data=crabs)
Does not work: ???????????? ?? if (any(out[nna])) stats[c(1, 5)] <- range(x[!out], na.rm = TRUE) : ?????????????????????? ????????????????, ?? ?????????? TRUE/FALSE ????????????????: Warning messages: 1: + not meaningful for factors in: Ops.factor(x[floor(d)], x[ceiling(d)]) 2: < not meaningful for factors in: Ops.factor(x, (stats[2] - coef * iqr)) 3: > not meaningful for factors in: Ops.factor(x, (stats[4] + coef * iqr)) Hm...
Another idea is to use lattice's bwplot. E.g. library(lattice) bwplot(FL ~ sex | sp, data=crabs)
That's not the point. The scales may differ significantly, also this is not conviniet for many factors.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Prof Brian Ripley ?????:
I carefully tested my suggestions in the current version of R, 2.2.1, before posting. They DO work, and as you have not even told us your version of R, we have no idea what you have broken on your R installation.
I'm sorry. This works. Thank you. Are there any other visualisation ways in R? I'm sorry if this question is not good enough for this mailing list.
Evgeniy
Prof Brian Ripley ?????:
On Sun, 19 Feb 2006, Evgeniy Kachalin wrote:
Hello, dear R users. What is the easiest and the most visualli understandable way to analize dependency of numerical variable on two factors?
interaction.plot() is a good start.
Is the boxplot(y~f1+f2) the good way? It seems that this formula does not work.
No, nor is it documented to: the help page is there to help you. You need a single factor as the grouping, so make one via an interaction. boxplot(y ~ f1:f2) should work. E.g. library(MASS) boxplot(FL ~ sex:sp, data=crabs) Another idea is to use lattice's bwplot. E.g. library(lattice) bwplot(FL ~ sex | sp, data=crabs)
Ideally it would be a tree of factors with mean as leaves. May be you could hint me direction to search for a graph.