0

I'm facing with this fitted models list:

    Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: value ~ COND + (1 | ID)
   Data: .

REML criterion at convergence: 389.4

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-1.71940 -0.52142 -0.02861  0.43071  2.17384 

Random effects:
 Groups   Name        Variance Std.Dev.
 ID       (Intercept) 14.461   3.803   
 Residual              5.527   2.351   
Number of obs: 75, groups:  ID, 25

Fixed effects:
            Estimate Std. Error      df t value Pr(>|t|)  
(Intercept)  -1.5888     0.8942 35.1754  -1.777   0.0842 .
CONDNEG-NOC   0.1964     0.6649 48.0000   0.295   0.7690  
CONDNEU-NOC   0.1130     0.6649 48.0000   0.170   0.8658  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) CONDNEG
CONDNEG-NOC -0.372        
CONDNEU-NOC -0.372  0.500 

and other 12 elements, all embedded into an object called model_list

If I would like to present them as into an elegant tables (as it is shown singularly for each model here in these slides) with sjPlot() package or others (alternatively):

enter image description here

Does anyone know what I should do?

12666727b9
  • 1,133
  • 1
  • 8
  • 22
  • You should try `tab_model(model_list, show.ci = FALSE, show.se = TRUE)` – Onyambu Nov 02 '21 at 16:23
  • It turns back this error `> tab_model(models_list_2, show.ci = FALSE, show.se = TRUE) Error in if (fam.info$is_linear) transform <- NULL else transform <- "exp" : argument is of length zero In addition: Warning message: Could not access model information`. – 12666727b9 Nov 02 '21 at 16:25
  • Actually in this object are contained twelwe models outcomes – 12666727b9 Nov 02 '21 at 16:26
  • I don't know whether this code could fit a table a model by one – 12666727b9 Nov 02 '21 at 16:27
  • Yes there are 12 models. You did indicate that in the question. What if you try doing `tab_model(models_list[[1]])` what is the error. – Onyambu Nov 02 '21 at 16:29
  • I got the same error :-( – 12666727b9 Nov 02 '21 at 16:31
  • What type of models do you have? How did you fit them? – Onyambu Nov 02 '21 at 16:32
  • I've tried to fit them both with the method of the previous post as well as via another method: `models_list_2 <- out_long %>% group_by(signals) %>% do(fit = lmerTest::lmer(value ~ COND + (1|ID), data = .)) %>% pull(fit) %>% lapply(., function(x) summary(x)) %>% setNames(sort(unique(out_long$signals)))` – 12666727b9 Nov 02 '21 at 16:36
  • as you could see they have been fitted via lmer() – 12666727b9 Nov 02 '21 at 16:37
  • just use `models_list_3 <- out_long %>% group_by(signals) %>% do(fit = lmerTest::lmer(value ~ COND + (1|ID), data = .)) %>% pull(fit)`. Now do `tab_model(model_list_3, show.ci = FALSE, show.se = TRUE)` – Onyambu Nov 02 '21 at 16:41
  • It worked good. But if you do not mind I would rather prefer to get a singular table for each model – 12666727b9 Nov 02 '21 at 16:45
  • So I think this would require the employment of some iterative functions like for loops, map() and other. I do not know how to set them out – 12666727b9 Nov 02 '21 at 16:46
  • But the image provided in the question is just one image with all the models. Anyway to get each table, use lapply(model_list, tab_model) – Onyambu Nov 02 '21 at 16:46

1 Answers1

1

It seems you are using summary of the models rather than the models themselves. Do:

models_list_3 <- out_long %>%   
       group_by(signals) %>%   
       do(fit = lmerTest::lmer(value ~ COND + (1|ID), data = .)) %>%    
       pull(fit) 

tab_model(model_list_3, show.ci =  FALSE, show.se =  TRUE)

for each model separately, you could do:

 lapply(model_list_3, tab_model, show.ci = FALSE, show.se = TRUE)
Onyambu
  • 67,392
  • 3
  • 24
  • 53