0

I want to plot some results from an afex_aov object with papaja apa_lineplot

this ist my code so far:

papaja::apa_lineplot(data = anova_hyp1a_ACC
                 , id = "Subject"
                 , dv = "meanACC"
                 , factor = c("UpdatingSteps", "MemSetSize")
                 , ylab = "Proportion Correct"
                 , xlab = "Memory Set Size"
                 , dispersion = within_subjects_conf_int
                 ,level=.99)

Despite I have coded the factor "UpdatingSteps" first in the factor argument, it is assigned to the grouping line visualization, instead of being on the x-axis. This is not very helpful because the effects aren't visible in this vis-style.

so: how can I change the factor assignment ? Any ideas? I read the papaja doc, but I didn't found the answer.

thanks

jan

crsh
  • 1,699
  • 16
  • 33
Jan
  • 21
  • 1
  • 2
  • Hi Jan, I have tried with an example here and it worked as expected. Could you provide a fully reproducible example? – crsh Oct 31 '18 at 19:26

1 Answers1

0

It is currently not possible to change the arrangement of factors if you directly plot an afex object. Therefore, if you want to change the arrangement, you would have to plot the raw data, not the afex object. In your example, it should be sufficient to use the following:

```
papaja::apa_lineplot(
  data = replace_with_your_data_frame_containing_raw_data
  , id = "Subject"
  , dv = "meanACC"
  , factor = c("UpdatingSteps", "MemSetSize")
  , ylab = "Proportion Correct"
  , xlab = "Memory Set Size"
  , dispersion = within_subjects_conf_int
  , level = .99
  , use = "complete.obs"
)
```

The additional parameter use = "complete.obs" ensures that apa_lineplot() uses listwise deletion of missing values, which is the same as in standard ANOVA.

P.S: I really like the idea of being able to change the arrangement, so I will definitely try to implement this in a future release.

Marius Barth
  • 596
  • 2
  • 9
  • yeah, i figured it out with the afex objects, which lead me to my other issue we discussed this week. thanks anyway for your answer ! I like using papaja, looking forward for future releases! – Jan Feb 07 '19 at 13:08
  • Hi Jan, the current development version of papaja (`devtools::install_github("crsh/papaja@devel")`) now allows to change the assingment of factors to axes (with similar code that you tried initially). – Marius Barth May 02 '19 at 11:35
  • hey! just tried to do it, unfortunately, I got this error when knitting: `pandoc: unrecognized option --lua-filter' Try pandoc --help for more information. Error: pandoc document conversion failed with error 2` – Jan May 20 '19 at 13:08
  • Hi Jan, due to some more nice stuff that Frederik implemented, the current development version of papaja relies on Pandoc 2.0, which is only recently delivered with RStudio. After installing the newest (stable) release of RStudio, this error should not occur, anymore. – Marius Barth May 21 '19 at 14:06