[ADMB Users] help with predict function in glmmADMB

Rodrigo Barreto rodrigorpbarreto at gmail.com
Sat May 24 12:07:27 PDT 2014


Dear all,
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...

#simulating df

dat <- data.frame(y = sample(x = 1:10, 100, replace=TRUE),
                   x1 = as.factor(sample(x = 1:6, 100, replace=TRUE)),
                   x2 = rnorm(100), x3 = as.factor(sample(x=1:2, 100,
replace=TRUE)))


#packages


library(MASS)
library(glmmADMB)


# models

mod1 <- glmmadmb(y ~ x1 + x2 + x3, data=dat)

mod2 <- glm.nb(y ~ x1 + x2 + x3, data=dat)


#newdata

newdata <- data.frame(x1 = as.factor(6), x2 = 2.5, x3 = as.factor(2))



#using MASS

predict.glm(mod2, newdata=newdata)


#using glmmadmb

predict(mod1, newdata=newdata)



Rodrigo.



-- 





*Doutorando Rodrigo R.P.Barreto Laboratório de Dinâmica de Populações
Marinhas,DIMAR, Universidade Federal Rural de Pernambuco UFRPE Departamento
de Pesca e Aquicultura, DEPAq. Av. Dom Manoel de Medeiros, S/N, Dois
Irmãos, Recife-PE Fone:+**55 **(81) 3320-6518; +55 (11) 4033-9274*
*FAX: +55 (81) 3320-6501*
*skype: rrpbarreto*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20140524/77f92402/attachment.html>


More information about the Users mailing list