-----Original Message-----
From: angelo solarino [mailto:angelosolarino at gmail.com]
Sent: Tuesday, 29 June, 2021 20:14
To: Viechtbauer, Wolfgang (SP)
Cc: r-sig-meta-analysis at r-project.org
Subject: Re: [R-meta] mods~factor
Wolfgang,
thanks again for your time.
when running the metaregression with a categorical variable (field) I should see
the levels of the variable in the regression output with the following labels:
Etrep; Finance, IB, and Manag.
the code used:
res <- rma(yi,vi, mods ~ field, data=cells, method = "HS")
res
Random-Effects Model (k = 122; tau^2 estimator: HS)
tau^2 (estimated amount of total heterogeneity): 0.0037 (SE = 0.0010)
tau (square root of estimated tau^2 value): 0.0612
I^2 (total heterogeneity / total variability): 87.69%
H^2 (total variability / sampling variability): 8.12
Test for Heterogeneity:
Q(df = 121) = 1015.5701, p-val < .0001
Model Results:
estimate se zval pval ci.lb ci.ub
0.0025 0.0065 0.3821 0.7024 -0.0103 0.0153
---
Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
the examples work just fine, with other datasets , it works as well.
so I'm trying to understand what is different here and why I am getting neither
the expected results nor an error message.
any hint is welcome!
Thanks again,
Angelo
Il giorno mar 29 giu 2021 alle ore 16:15 Viechtbauer, Wolfgang (SP)
<wolfgang.viechtbauer at maastrichtuniversity.nl> ha scritto:
Please always cc the mailing list when responding.
You haven't actually stated what the problem is. What exactly do you mean by "I
can't get the factors in the metaregression"? What error do you get? Or what is
the output that you get that is not in accordance with what you were expecting?
Best,
Wolfgang
-----Original Message-----
From: angelo solarino [mailto:angelosolarino at gmail.com]
Sent: Tuesday, 29 June, 2021 17:03
To: Viechtbauer, Wolfgang (SP)
Subject: Re: [R-meta] mods~factor
Dear Wolfgan,
thank you for your quick reply.
Unfortunately, I still can't get the factors in the metaregression. In other
projects with metafor, it never encountered this issue before, so i am not
what is causing it.
I have re-started the project in a new space after having updated R, Rtools, and
metafor to the most recent versions. The issue persists.
Have you ever encountered this issue before? all the other parts works, it just
the meta regressions that is causing some troubles.
Thanks a lot for having developed such a great tool, and let me know if you have
any advice on how to overcome this problem.
All the best,
Angelo
Il giorno mar 29 giu 2021 alle ore 12:10 Viechtbauer, Wolfgang (SP)
<wolfgang.viechtbauer at maastrichtuniversity.nl> ha scritto:
Dear Angelo,
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
-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces at r-project.org] On
Behalf Of angelo solarino
Sent: Tuesday, 29 June, 2021 12:21
To: r-sig-meta-analysis at r-project.org
Subject: [R-meta] mods~factor
DA,
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,
Angelo