Re: [R] Plotting an interaction with error bars

2009-12-02 Thread Dror D Lev
Hello Jim,

I have encountered a puzzling pattern of results using brkdn.plot():

 brkdn.plot(Duration,group_val,blck,data=dpp)
$mean
 [,1]  [,2] [,3]  [,4]
[1,] 0.653842 0.5679849 0.477645 0.4250087
[2,] 0.653842 0.5679849 0.477645 0.4250087
[3,] 0.653842 0.5679849 0.477645 0.4250087
[4,] 0.653842 0.5679849 0.477645 0.4250087
[5,] 0.653842 0.5679849 0.477645 0.4250087

(I've omitted the $std.error matrix to save space since the pattern is the
same)

To verify the pattern of repetitions is not in my data I made another
calculation and there is no pattern of repetition:

 with(dpp, ftable(by(Duration,list(group_val,blck),mean,na.rm=T)))
   1 2 3 4

0.015  0.7493519 0.5125178 0.4538040 0.3498578
0.02   0.5583320 0.6234520 0.5014860 0.5001596
0.028  0.5446862 0.3600077 0.2951988 0.2842502
0.035  0.4396780 0.2335916 0.1992378 0.1661076
0.045  0.2711094 0.1305614 0.0969594 0.1491294

Is there a way to make brkdn.plot() to present this data?

Thank you,
dror

-

On Wed, Nov 4, 2009 at 12:21 PM, Dror D Lev dror.te...@gmail.com wrote:

 Indeed, that seems very convenient.
 Thanks for your work and for the help.

 dror

 -

 On Wed, Nov 4, 2009 at 12:17 PM, Jim Lemon j...@bitwrit.com.au wrote:
  On 11/04/2009 06:36 PM, Dror D Lev wrote:
 
  Thank you Jim.
 
  brkdn.plot() seems to be just the function I need.
 
  Still, I wonder if there are lists of labels of the different measures
  of central tendency (mct argument) and measures of dispersion (md)?
 
 
 
  Hi Dror,
  With brkdn.plot (and several other functions in plotrix) you can use any
  existing measure or even roll your own. The only limitation is that the
  function has to return a numeric value and must accept an na.rm
 argument.
 
  Jim
 
 


[[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.


Re: [R] Plotting an interaction with error bars

2009-11-04 Thread Jim Lemon

On 11/04/2009 06:36 PM, Dror D Lev wrote:

Thank you Jim.

brkdn.plot() seems to be just the function I need.

Still, I wonder if there are lists of labels of the different measures
of central tendency (mct argument) and measures of dispersion (md)?

   

Hi Dror,
With brkdn.plot (and several other functions in plotrix) you can use any 
existing measure or even roll your own. The only limitation is that the 
function has to return a numeric value and must accept an na.rm argument.


Jim

__
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.


Re: [R] Plotting an interaction with error bars

2009-11-04 Thread Dror D Lev
Indeed, that seems very convenient.
Thanks for your work and for the help.

dror

-

On Wed, Nov 4, 2009 at 12:17 PM, Jim Lemon j...@bitwrit.com.au wrote:
 On 11/04/2009 06:36 PM, Dror D Lev wrote:

 Thank you Jim.

 brkdn.plot() seems to be just the function I need.

 Still, I wonder if there are lists of labels of the different measures
 of central tendency (mct argument) and measures of dispersion (md)?



 Hi Dror,
 With brkdn.plot (and several other functions in plotrix) you can use any
 existing measure or even roll your own. The only limitation is that the
 function has to return a numeric value and must accept an na.rm argument.

 Jim



__
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.


[R] Plotting an interaction with error bars

2009-11-03 Thread Dror D Lev
Hello.

I need to plot a two-way interaction (5 levels X 3) with error bars.
The x.factor will be the five-levels var and the trace.factor will be
the three level var.

I was able to find functions that draw error bars, but still couldn't
find a way to draw an interaction plot that looks like what is common
in psychological (and related) journals: the lines (three in my need)
are plotted in parallel and to avoid overlapping of the error bars a
small jitter is added.

I was able to make plotmeans() {from gplots} draw the interaction but
with the lines plotted side by side (not parallel), resulting in three
panes of one line each. When I tried manually super-imposing (looping
a draw of one line for each level in the trace.factor) I got the
overall look, but the error bars overlap and are hard to distinguish.

Another attempt I made was with ci.plot() {from pda}. Inputting an
aov() model resulted in a perfect plot of interaction but which is
very limited to handle - I was unable to add a legend, change symbols
etc.

Does anybody knows if there is a way to manipulate either of the above
functions more then what I was able to?
Is there another function to draw interaction plots with error bars?

Thanks for any help or comment.
dror

__
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.


Re: [R] Plotting an interaction with error bars

2009-11-03 Thread Jim Lemon

On 11/03/2009 10:15 PM, Dror D Lev wrote:

Hello.

I need to plot a two-way interaction (5 levels X 3) with error bars.
The x.factor will be the five-levels var and the trace.factor will be
the three level var.

I was able to find functions that draw error bars, but still couldn't
find a way to draw an interaction plot that looks like what is common
in psychological (and related) journals: the lines (three in my need)
are plotted in parallel and to avoid overlapping of the error bars a
small jitter is added.

I was able to make plotmeans() {from gplots} draw the interaction but
with the lines plotted side by side (not parallel), resulting in three
panes of one line each. When I tried manually super-imposing (looping
a draw of one line for each level in the trace.factor) I got the
overall look, but the error bars overlap and are hard to distinguish.

Another attempt I made was with ci.plot() {from pda}. Inputting an
aov() model resulted in a perfect plot of interaction but which is
very limited to handle - I was unable to add a legend, change symbols
etc.

Does anybody knows if there is a way to manipulate either of the above
functions more then what I was able to?
Is there another function to draw interaction plots with error bars?

   

Hi Dror,
I think you want to offset the points in a group along the x axis so 
that the points and error bars don't overlap. Try introducing an x 
offset of maybe 0.1 in your try with plotmeans. To see an example of 
what this looks like and how it is done, have a look at brkdn.plot in 
the plotrix package.


Jim

__
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.


Re: [R] Plotting an interaction with error bars

2009-11-03 Thread Dror D Lev
Thank you Jim.

brkdn.plot() seems to be just the function I need.

Still, I wonder if there are lists of labels of the different measures
of central tendency (mct argument) and measures of dispersion (md)?

dror

-

On Wed, Nov 4, 2009 at 7:41 AM, Jim Lemon j...@bitwrit.com.au wrote:
 On 11/03/2009 10:15 PM, Dror D Lev wrote:

 Hello.

 I need to plot a two-way interaction (5 levels X 3) with error bars.
 The x.factor will be the five-levels var and the trace.factor will be
 the three level var.

 I was able to find functions that draw error bars, but still couldn't
 find a way to draw an interaction plot that looks like what is common
 in psychological (and related) journals: the lines (three in my need)
 are plotted in parallel and to avoid overlapping of the error bars a
 small jitter is added.

 I was able to make plotmeans() {from gplots} draw the interaction but
 with the lines plotted side by side (not parallel), resulting in three
 panes of one line each. When I tried manually super-imposing (looping
 a draw of one line for each level in the trace.factor) I got the
 overall look, but the error bars overlap and are hard to distinguish.

 Another attempt I made was with ci.plot() {from pda}. Inputting an
 aov() model resulted in a perfect plot of interaction but which is
 very limited to handle - I was unable to add a legend, change symbols
 etc.

 Does anybody knows if there is a way to manipulate either of the above
 functions more then what I was able to?
 Is there another function to draw interaction plots with error bars?



 Hi Dror,
 I think you want to offset the points in a group along the x axis so that
 the points and error bars don't overlap. Try introducing an x offset of
 maybe 0.1 in your try with plotmeans. To see an example of what this looks
 like and how it is done, have a look at brkdn.plot in the plotrix package.

 Jim



__
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.