Dear Roberto
I suspect the answer is that your original factor variable has levels
which do not appear in your data-set so they are dropped when the model
matrix is formed.
If you do factor(already_existing_factor) it silently drops the levels.
This is rather hidden in the documentation as the second paragraph of Value
Michael
On 06/01/2020 09:27, P. Roberto Bakker wrote:
Hi Everybody,
I have a new question about meta-regression.
My database consists only of factors (no characters), so I suppose I do
need 'factor()' in 'mods', i.e. 'mods = ~ factor-var'. I also tried
~ factor(factor-var)' and I receive the same results as expected.
Only, there is one difference, 'mods = ~ factor-var' gives a warning
message:
*"In rma(measure = "SMCC", yi = yi, vi = vi, data = datsub, digits = 2,
* Redundant predictors dropped from the model."*
Whereas 'mods = ~ factor(factor-var)' does not give this message. What is
the reason for this?
So, my question is not why I receive this message, but why the
with/out warning message.
Best regards,
Roberto
PS the same happens with a character variable: i.e. 'mods = ~ chr-var' as
well as 'mods = ~ factor(chr-var)'.
Op do 26 apr. 2018 om 07:42 schreef P. Roberto Bakker <
robertobakker at gmail.com>:
Hi Wolfgang,
Thank you for your information and explanation.
Bw Roberto
2018-04-24 12:25 GMT+02:00 Viechtbauer, Wolfgang (SP) <
wolfgang.viechtbauer at maastrichtuniversity.nl>:
Hi Roberto,
If you put a character variable (or a factor) into a formula, it is
automatically dummy coded. Actually, the type of coding depends on:
options("contrasts")
But the default for that is:
unordered ordered
"contr.treatment" "contr.poly"
And help(contr.treatment) explains what kind of coding this is, namely
the 'usual' dummy coding where one level is the 'reference' level (and
whose dummy gets omitted).
Best,
Wolfgang
-----Original Message-----
From: R-sig-meta-analysis [mailto:
r-sig-meta-analysis-bounces at r-project.org] On Behalf Of P. Roberto
method="ML")
If I am not wrong, 'allocation' is a catergorical variabel, and I
argument in the same way that appropriately (dummy) coded categorical
independent variables can be included in linear models. One can either
the dummy coding manually or use a model formula together with the
function to let R handle the coding automatically. *
*Best wishes and thank you in advance*
*Roberto*
[[alternative HTML version deleted]]