<div dir="ltr"><div>Dear all, <br></div>My name is Rodrigo, im trying to fit some models in glmmADMB and cant understand what happen with predict function. Please find below an reproducible example of my problem, basically when using pakcage MASS, my goal works, but with glmmADMB i cant ....can you guys help me? my best...<br clear="all">
<div><div><br>#simulating df<br><br>dat <- data.frame(y = sample(x = 1:10, 100, replace=TRUE), <br> x1 = as.factor(sample(x = 1:6, 100, replace=TRUE)), <br> x2 = rnorm(100), x3 = as.factor(sample(x=1:2, 100, replace=TRUE)))<br>
<br><br>#packages<br><br><br>library(MASS)<br>library(glmmADMB)<br><br><br># models<br><br>mod1 <- glmmadmb(y ~ x1 + x2 + x3, data=dat)<br><br>mod2 <- glm.nb(y ~ x1 + x2 + x3, data=dat)<br><br><br>#newdata<br><br>newdata <- data.frame(x1 = as.factor(6), x2 = 2.5, x3 = as.factor(2))<br>
<br><br><br>#using MASS<br><br>predict.glm(mod2, newdata=newdata)<br><br><br>#using glmmadmb<br><br>predict(mod1, newdata=newdata)<br><br><br><br></div><div>Rodrigo. <br></div><div><br><br><br>-- <br><div dir="ltr"><span style="font-size:13px;background-color:rgb(255,255,255)"><font color="#000099" face="'comic sans ms', sans-serif"><b>Doutorando Rodrigo R.P.Barreto <br>
Laboratório de Dinâmica de Populações Marinhas,DIMAR, <br>Universidade Federal Rural de Pernambuco UFRPE <br>Departamento de Pesca e Aquicultura, DEPAq. <br>Av. Dom Manoel de Medeiros, S/N, Dois Irmãos, Recife-PE <br>Fone:+</b></font></span><span style="font-size:13px;background-color:rgb(255,255,255)"><font color="#000099" face="'comic sans ms', sans-serif"><b>55 </b></font></span><b style="color:rgb(0,0,153);font-family:'comic sans ms',sans-serif;font-size:13px;background-color:rgb(255,255,255)">(81) 3320-6518; +55 (11) 4033-9274</b><div>
<span style="font-size:13px;background-color:rgb(255,255,255)"><font color="#000099" face="'comic sans ms', sans-serif"><b>FAX: +55 (81) 3320-6501</b></font></span></div><div><span style="font-size:13px;background-color:rgb(255,255,255)"><font color="#000099" face="'comic sans ms', sans-serif"><b>skype: rrpbarreto</b></font></span></div>
</div>
</div></div></div>