-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Hewitt, Charlotte
Sent: Tuesday, March 19, 2013 19:17
To: r-help at R-project.org
Subject: [R] Error when adding lines to a plot using the mixed-effect
model and metafor package
Hi,
I am a student using R for my final year project, with the metafor package
being particularly helpful. I have been following the steps laid out in
the manual 'Conducting Meta-analysis in R with the Metafor package'
(Viechtbauer, 2010) and applying it to my own data of infected Anopheles
mosquitoes across Africa.
In particular, I am attempting to apply a mixed-effect model to my data
with absolute latitude as a moderator as per the example in the manual. I
am able to generate a plot of Relative Risk against absolute latitude
without issue, but when I try to add lines in from the predicted values
generated I continually get an error:
Error in xy.coords(x, y) : 'x' and 'y' lengths differ
However, I have used the length function on both my x and y co-ordinates
and found no difference in lengths. If anyone could shed some light on
this I'd really appreciate it. The code I used can be found below:
mixed<-read.delim("regressiontest.txt")
mixed
study year ablat mosq1pos mosq1neg mosq2pos mosq2neg
1 Cano et al. 2006 2 42 237 148 629
2 Kerah - Hinzoumbe et al. 2009 10 103 7260 3 215
3 Konate et al. 1994 13 83 5714 48 3609
4 Mwanzia et al. 2011 4 2 8971 0 100