Viechtbauer, Wolfgang (SP)
wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Tue Jun 29 13:10:01 CEST 2021
The factor() function is not something from metafor, but is part of R itself.
String variables are automatically converted to factors, so using factor() on them doesn't change anything.
As for the interpretation of results when including factor variables in models, see:
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On
>Behalf Of angelo solarino
>Sent: Tuesday, 29 June, 2021 12:21
>To: r-sig-meta-analysis using r-project.org
>Subject: [R-meta] mods~factor
>I am having some trouble with the "factor" command in metafor.
>I am not able to get the split for the variable field. it is a string
>value. whether i add "mods~factor(field)" or not I get the same main
>effect results, and there is no error message. Can anyone help me figure
>out what I am doing wrong?
>res <- rma(yi,vi, mods~factor(field), data=Outcomes1, method = "HS",
>subset=(ID=="XX" | ID=="XY"))
>Thanks a lot for your help,
More information about the R-sig-meta-analysis