Dear Rgurus,
To my knowledge the best way to visualize the distribution of a discrete
variable X is
plot(table(X))
The problem which I have is the following. I have to discrete variables
X and Y which distribution I would like to compare. To overlay the
distribution of Y with lines(table(Y)) gi
I'd suggest dotcharts, such as:
x1 <- sample(letters[1:4], 100, replace=TRUE, prob=c(.2, .3, .4, .1))
x2 <- sample(letters[1:4], 100, replace=TRUE, prob=c(.1, .4, .3, .2))
f1 <- table(x1) / length(x1)
f2 <- table(x2) / length(x2)
lev <- factor(c(names(f1), names(f2)))
require(lattice)
dotplot(lev
Witold Eryk Wolski ncl.ac.uk> writes:
:
: Dear Rgurus,
:
: To my knowledge the best way to visualize the distribution of a discrete
: variable X is
: plot(table(X))
:
: The problem which I have is the following. I have to discrete variables
: X and Y which distribution I would like to compar
> "AndyL" == Liaw, Andy <[EMAIL PROTECTED]>
> on Mon, 21 Mar 2005 08:14:20 -0500 writes:
AndyL> I'd suggest dotcharts, such as:
AndyL> x1 <- sample(letters[1:4], 100, replace=TRUE, prob=c(.2, .3, .4, .1))
AndyL> x2 <- sample(letters[1:4], 100, replace=TRUE, prob=c(.1, .4, .
On Monday 21 March 2005 11:08, Martin Maechler wrote:
> > "AndyL" == Liaw, Andy <[EMAIL PROTECTED]>
> > on Mon, 21 Mar 2005 08:14:20 -0500 writes:
>
> AndyL> I'd suggest dotcharts, such as:
> AndyL> x1 <- sample(letters[1:4], 100, replace=TRUE, prob=c(.2,
> .3, .4, .1)) AndyL> x