0

I would like to plot pupil size (continuous) over time (continuous) as a function of Variable A (2 levels) and Variable B (3 levels). I would like to use different colors for A and line type for B. An example of what I would like to do is displayed is Figure 2A in this paper:

enter image description here

I tried to follow the suggestion of eipi in this thread but it does not work for me (below): this is the code

ggplot(
  make_pred_dat(nB=3),  
  aes(x=IVContinuousA, y=DV, colour=IVCategorical, linetype=factor(round(IVContinuousB,2)))
) +  
  geom_line()

Could you give me some feedback?

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
martina
  • 1
  • 1
  • 1
    Please can you include some data so your problem is reproducible with `dput(make_pred_dat(nB = 3))` – Richard Telford Jul 09 '20 at 18:14
  • I added Figure 4 from the link you gave, although it doesn't seem to match your description exactly?? What does "does not work" mean: do you get errors or warnings? Do you get a plot but not what you want? Can you provide a link to the figure that you made and explain what's wrong about it? – Ben Bolker Jul 09 '20 at 18:25

0 Answers0