[R-meta] meta-regression: categorical

P. Roberto Bakker robertob@kker @end|ng |rom gm@||@com
Thu Jan 9 16:26:48 CET 2020


Dear Michael,

Thank you for you explanation.

Best wishes,
Roberto


Op ma 6 jan. 2020 om 17:37 schreef Michael Dewey <lists using dewey.myzen.co.uk>:

> 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
> not
> > need 'factor()' in 'mods', i.e. 'mods = ~ factor-var'. I also tried
> 'mods =
> > ~ 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
> difference:
> > 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 using 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 using 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 using r-project.org] On Behalf Of P. Roberto
> Bakker
> >>> Sent: Tuesday, 24 April, 2018 11:14
> >>> To: r-sig-meta-analysis using r-project.org
> >>> Subject: [R-meta] meta-regression: categorical
> >>>
> >>> Hi everybody,
> >>>
> >>> In:
> >>> http://www.metafor-project.org/doku.php/analyses:vanhouwelingen2002
> >>> 'allocation' is put in syntax without dummy coding
> >>>
> >>> rma <http://finzi.psych.upenn.edu/library/metafor/html/rma.uni.html
> >(yi,
> >>> vi, mods = ~ alloc, data
> >>> <http://stat.ethz.ch/R-manual/R-devel/library/utils/html/data.html
> >=dat,
> >>> method="ML")
> >>>
> >>> If I am not wrong, 'allocation' is a catergorical variabel, and I
> suppose
> >>> the R handles the coding of dummy automatically.
> >>> Correct?
> >>>
> >>> I found this information in:
> >>> https://cran.r-project.org/web/packages/metafor/metafor.pdf
> >>> *Categorical moderator variables can be included in the model via the
> mods
> >>> argument in the same way that appropriately (dummy) coded categorical
> >>> independent variables can be included in linear models. One can either
> do
> >>> the dummy coding manually or use a model formula together with the
> factor
> >>> function to let R handle the coding automatically.   *
> >>>
> >>> *Best wishes and thank you in advance*
> >>> *Roberto*
> >>>
> >>
> >>
> >
> >       [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-meta-analysis mailing list
> > R-sig-meta-analysis using r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
> >
>
> --
> Michael
> http://www.dewey.myzen.co.uk/home.html
>

	[[alternative HTML version deleted]]



More information about the R-sig-meta-analysis mailing list