Re: [R] Help: Beanplots calculating wrong average

2009-11-29 Thread Tom Wainwright
On 11/26/2009 02:25 AM, Michael Hopgood wrote: Hi Tom, Thank you for the friendly and informative answer. It does explain a lot of things, actually. As with any good answer, it inevitably leads to other questions. In the first place, I need the arithmetic mean. It's what we base our

Re: [R] Help: Beanplots calculating wrong average

2009-11-26 Thread Michael Hopgood
Kopia: r-help@r-project.org Ämne: Re: [R] Help: Beanplots calculating wrong average Hi Michael, Looking at the help for beanplot(), note that the 'log' option defaults to 'auto' which means the function will automatically log-transform data like yours. This also implies that the mean it shows

[R] Help: Beanplots calculating wrong average

2009-11-24 Thread Michael Hopgood
Hi there, I have a set of data that looks like this: As1988-c(1254.0, 22.0, 4.2, 1081.0, 35.0, 6.0, 1772.0, 192.0, 7.6) The mean of this (as calculated by R) is: 485.9778 The median of this (as calculated by R) is: 35 If I then make a beanplot(As1988), I find that the beanline (average)

Re: [R] Help: Beanplots calculating wrong average

2009-11-24 Thread joris meys
Hi, The log of the mean is not the same as the mean of the logs, that's a no-brainer. Guess you use the beanplot from the package with the same name. beanplot(As1988,log=) gives the correct plot. Next time, could you provide a minimal code example we can run ourselves? If we don't know what

Re: [R] Help: Beanplots calculating wrong average

2009-11-24 Thread Tom Wainwright
Hi Michael, Looking at the help for beanplot(), note that the 'log' option defaults to 'auto' which means the function will automatically log-transform data like yours. This also implies that the mean it shows is the geometric mean, not the arithmetic mean. As you note, the transformation