0

sorry to ask, but it's all day I am trying to plot this and I am unable. My model is:

f.e.model = lmer(Score ~ Relation_PenultimateLast*ExpertiseType + (1|TrajectoryType) + (1|StimulusType), data=datasheet.complete)

In my model I find an interaction between two effects (ExpertiseType and Relation_PenultimateLast):

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-2.37256 -0.89147 -0.04263  0.76205  2.03113 

Random effects:
 Groups         Name        Variance Std.Dev.
 TrajectoryType (Intercept) 0.02033  0.1426  
 StimulusType   (Intercept) 0.02467  0.1571  
 Residual                   1.29905  1.1398  
Number of obs: 8200, groups:  TrajectoryType, 25; StimulusType, 8

Fixed effects:
                                         Estimate Std. Error         df t value
(Intercept)                               3.34776    0.11432   60.00000  29.285
Relation_PenultimateLast                 -0.08628    0.03489   75.00000  -2.473
ExpertiseType                            -0.09776    0.03647 8166.00000  -2.680
Relation_PenultimateLast:ExpertiseType    0.05219    0.01274 8166.00000   4.097
                                       Pr(>|t|)    
(Intercept)                             < 2e-16 ***
Relation_PenultimateLast                0.01568 *  
ExpertiseType                           0.00737 ** 
Relation_PenultimateLast:ExpertiseType 4.22e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

In the plot I would like to see:

x axis: Relation_PenultimateLast
y.axis: effect
colour: ExpertiseType

so to have 3 lines that show me the preference for each Relation_PenultimateLast (without random effects)

is it possible? (I have installed: interplot, ggplot, ggplot2, sjPlot)

TakeMeToTheMoon
  • 527
  • 1
  • 8
  • 25
  • It would be easier to help you if you provided a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data so we could run the model and test. This seems possible using the `predict()` function – MrFlick Jan 10 '18 at 22:24
  • You can use package [ggeffects](https://cran.r-project.org/package=ggeffects). Your call would look like `dat <- ggpredict(f.e.model, terms = c("Relation_PenultimateLast", "ExpertiseType"))` and then `plot(dat)`. See package vignette and help for details on plotting options. – Daniel Jan 22 '18 at 07:52
  • Or use `sjPlot::plot_model(..., type = "pred", terms = ...)` (same arguments as in `ggpredict()`). – Daniel Jan 22 '18 at 07:54

0 Answers0