Closed teindor closed 5 months ago
You need to include the grouping variable in select
:
wf$id <- factor(wf$id)
correlation::correlation(wf, select = c("id", "inflated", "gender"), multilevel = TRUE)
#> Parameter1 | Parameter2 | r | CI | t(539) | p
#> ---------------------------------------------------------------
#> inflated | gender | 0.07 | [-0.02, 0.15] | 1.56 | 0.120
#>
#> Observations: 541
Hello, I tried using this simple code: wf %>% correlation(select = "inflated", select2 = "gender",multilevel = TRUE) I get this message: Error: No random effects terms specified in formula
I tried tweaking the code like this: wf %>% group_by(id) %>% correlation(select = "inflated", select2 = "gender",multilevel = TRUE) or this: wf %>% correlation(select = "inflated", select2 = "gender",multilevel = TRUE, formula = infalted ~ gender + (1|id), with the same error. I haven't find any explanation here or in the documentation.
The random factor should be "id" Enclosed is the data file Any ideas? wf.csv