<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=TR link=blue vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Wonderful.. <br><br>Again thank you sir.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='background:white'><b><span style='font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222'>---</span></b><span style='font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222'><o:p></o:p></span></p><p class=MsoNormal style='background:white'><b><span style='font-family:"Arial",sans-serif;color:#222222'>İyi çalışmalar dilerim…<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:12.0pt'>Yours sincerely…</span></b><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>Kimden: </b><a href="mailto:wolfgang.viechtbauer@maastrichtuniversity.nl">Viechtbauer, Wolfgang (NP)</a><br><b>Gönderilme: </b>17 Mart 2023 Cuma 23:03<br><b>Kime: </b><a href="mailto:fatihcelik2842@gmail.com">Fatih ÇELİK</a>; <a href="mailto:r-sig-meta-analysis@r-project.org">R Special Interest Group for Meta-Analysis</a><br><b>Konu: </b>RE: predict error in metafor</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>That is correct.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Best,</p><p class=MsoNormal>Wolfgang</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>>-----Original Message-----</p><p class=MsoNormal>>From: Fatih ÇELİK [mailto:fatihcelik2842@gmail.com]</p><p class=MsoNormal>>Sent: Friday, 17 March, 2023 20:34</p><p class=MsoNormal>>To: Viechtbauer, Wolfgang (NP); R Special Interest Group for Meta-Analysis</p><p class=MsoNormal>>Subject: Ynt: predict error in metafor</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>Dear Viechtbauer,</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>Firstly, thank you for your interest.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>I performed the analyses in line with your recommendations and obtained the</p><p class=MsoNormal>>following output.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>table(dat$publication)</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>conference paper book section articles Thesis</p><p class=MsoNormal>> 1 1 58</p><p class=MsoNormal>> 25</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>Test of Moderators (coefficients 2:4):</p><p class=MsoNormal>>QM(df = 3) = 2.4308, p-val = 0.4879</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>Model Results:</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> estimate se zval</p><p class=MsoNormal>> pval ci.lb ci.ub</p><p class=MsoNormal>>intrcpt 0.8700 0.0467 18.6136 <.0001 0.</p><p class=MsoNormal>>7784 0.9616</p><p class=MsoNormal>>publicationbook section -0.0100 0.0665 -0.1505 0.8804 -0.1402 0.1202</p><p class=MsoNormal>>publicationArticle -0.0487 0.0472 -1.0320 0.3020 -</p><p class=MsoNormal>>0.1411 0.0438</p><p class=MsoNormal>>publicationthesis -0.0571 0.0478 -1.1962 0.2316 -</p><p class=MsoNormal>>0.1507 0.0365</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>> predict(res1, newmods=rbind(0,diag(3)), digits=3)</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> pred se ci.lb ci.ub pi.lb pi.ub</p><p class=MsoNormal>>1 0.870 0.047 0.778 0.962 0.741 0.999</p><p class=MsoNormal>>2 0.860 0.047 0.767 0.953 0.731 0.989</p><p class=MsoNormal>>3 0.821 0.006 0.809 0.834 0.730 0.912</p><p class=MsoNormal>>4 0.813 0.010 0.794 0.832 0.721 0.905</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>In this case, should I evaluate the predict results according to the order that</p><p class=MsoNormal>>appears after the table function? In other words, should I report the red number</p><p class=MsoNormal>>1 as "conference paper", the blue number 2 as "book section", the green number 3</p><p class=MsoNormal>>as "article", and the yellow number 4 as "thesis"?</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>---</p><p class=MsoNormal>>İyi çalışmalar dilerim…</p><p class=MsoNormal>>Yours sincerely…</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>Kimden: Viechtbauer, Wolfgang (NP)</p><p class=MsoNormal>>Gönderilme: 17 Mart 2023 Cuma 18:32</p><p class=MsoNormal>>Kime: R Special Interest Group for Meta-Analysis</p><p class=MsoNormal>>Bilgi: Fatih ÇELİK</p><p class=MsoNormal>>Konu: RE: predict error in metafor</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>Dear Fatih,</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>First of all, given that the error message says that the model matrix contains 4</p><p class=MsoNormal>>columns, there must be four levels to the 'publications' factor, not three (i.e.,</p><p class=MsoNormal>>aside from article, book sections, and thesis, there must be another level).</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>table(dat$publications)</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>will tell you what the levels are.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>And if you look at the output from 'res', you will see that the model contains</p><p class=MsoNormal>>three dummy variables, one for each level except the reference level,</p><p class=MsoNormal>>corresponding to the model intercept.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>So, to use predict(), you have to specify the values for the three dummy</p><p class=MsoNormal>>variables. In particular,</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>predict(res, newmods=c(0,0,0), digits=3)</p><p class=MsoNormal>>predict(res, newmods=c(1,0,0), digits=3)</p><p class=MsoNormal>>predict(res, newmods=c(0,1,0), digits=3)</p><p class=MsoNormal>>predict(res, newmods=c(0,0,1), digits=3)</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>will give you the predicted average effect (or in this case, alpha) for each</p><p class=MsoNormal>>level (including the reference level). Or more compactly:</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>predict(res, newmods=rbind(0,diag(3)), digits=3)</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>Best,</p><p class=MsoNormal>>Wolfgang</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>>-----Original Message-----</p><p class=MsoNormal>>>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces@r-project.org] On</p><p class=MsoNormal>>>Behalf Of Fatih ÇELIK via R-sig-meta-analysis</p><p class=MsoNormal>>>Sent: Friday, 17 March, 2023 15:30</p><p class=MsoNormal>>>To: r-sig-meta-analysis@r-project.org</p><p class=MsoNormal>>>Cc: Fatih ÇELİK</p><p class=MsoNormal>>>Subject: [R-meta] predict error in metafor</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>Respected members,</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>While doing meta-analysis (reliability generalization) on R metafor, I am</p><p class=MsoNormal>>having</p><p class=MsoNormal>>>trouble and I can't get over it.</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>I want to do moderator analysis with a categorical variable feature over</p><p class=MsoNormal>>>"publications" (i.e. article, book sections, and thesis). For this, I use the</p><p class=MsoNormal>>>following code</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>res<- rma(measure="ARAW", ai=ai, mi=mi, ni=ni, mods = ~ publications, data=dat)</p><p class=MsoNormal>>>res</p><p class=MsoNormal>>>predict(res, newmods=c(0, 1), digits=3)</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>However, when I run predict code (recent code), it gives the following error.</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>Error in predict.rma(res4, newmods = c(0, 1), digits = 3) :</p><p class=MsoNormal>>>Dimensions of 'newmods' (3) do not the match dimensions of the model (4).</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>As far as I understand, it gives this error because there are more than two</p><p class=MsoNormal>>>categories. Because when I analyse a different variable with two categories</p><p class=MsoNormal>>(like</p><p class=MsoNormal>>>female and male), it does the “predict” operation without giving an error. Can</p><p class=MsoNormal>>>you help me, please? How else can I edit and run this code (predict)?</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>Sincerely….</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>Ph.D. Fatih ÇELİK</p><p class=MsoNormal>>>Trabzon Üniversitesi/Trabzon University</p><p class=MsoNormal>>>Vakfıkebir Meslek Yüksekokulu/Vakfikebir Vocational School</p><p class=MsoNormal>>>Pazarlama ve Reklamcılık Bölümü/Department of Marketing and Advertising</p><p class=MsoNormal>>><o:p> </o:p></p><p class=MsoNormal>>>Contact</p><p class=MsoNormal>>>0462 455 46 80-----4687-4685</p><p class=MsoNormal>>>fatihcelik@trabzon.edu.tr fatihcelik2842@gmail.com</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>