[R-sig-ME] zibinomial in MCMCglmm
Adrian Jaeggi
ajaeggi at anth.ucsb.edu
Thu Dec 29 18:20:48 CET 2011
Dear list,
I have a data set where the successes part of a binomial response
variable are zero-inflated:
str(mydata)
'data.frame': 30 obs. of 12 variables:
$ approacher : Factor w/ 6 levels "Dj","Ja","Lc",..: 2 3
4 5 6 1 3 4 5 6 ...
$ owner : Factor w/ 6 levels "Dj","Ja","Lc",..: 1 1
1 1 1 2 2 2 2 2 ...
$ Successes : int 0 1 1 5 0 0 1 0 0 0 ...
$ Failures : int 25 16 14 22 6 3 19 2 4 1 ...
$ owner.fgs : num 0 0 0.04 0 0 ...
$ davdif : num -1.123 -2.18 1.288 0.534 -2.663 ...
$ matkin : int 0 0 0 0 0 0 0 0 0 0 ...
$ sexcom : Factor w/ 4 levels "ff","fm","mf",..: 1 3
1 3 3 1 3 1 3 3 ...
$ relq : num 0.962 -0.878 -0.324 -0.65 -0.672 ...
$ polq : num 2.6378 0.16 -0.0731 -0.3261 0.0379 ...
y<- cbind(mydata$Successes, mydata$Failures)
summary(y)
V1 V2
Min. : 0.000 Min. : 0.00
1st Qu.: 0.000 1st Qu.: 4.00
Median : 0.000 Median :15.00
Mean : 3.310 Mean :20.66
3rd Qu.: 1.000 3rd Qu.:24.00
Max. :72.000 Max. :80.00
Running analyses in lme4() with family=binomial yields warnings:
glmm<-
glmer(y~owner.fgs+relq+polq+matkin+davdif+sexcom+(1|approacher)+(1|owner),
data=mydata, family=binomial)
Error messages:
1: glm.fit: fitted probabilities numerically 0 or 1 occurred
2: In mer_finalize(ans) : singular convergence (7)
Furthermore, using glm() with family=quasibinomial indicates high
overdispersion:
glm<-
glm(y~Owner.vol.success+relq+polq+matkin+davdif+sexcom+approacher+owner,
data=PLD2010bags, family=quasibinomial)
summary(glm)
> (Dispersion parameter for quasibinomial family taken to be 8.624607e+15)
Hence, I am trying to run a zero-inflated binomial model in MCMCglmm,
but I am getting an error message:
priorzi <- list(R = list(V = diag(2), fix=2), G = list(G1 = list(V =
diag(2), nu = 0.002), G2 = list(V = diag(2), nu= 0.002)))
glmm<-
MCMCglmm(y~trait:owner.fgs+trait:relq+trait:polq+trait:matkin+trait:davdif+trait:sexcom,
random=~idh(trait):approacher+idh(trait):owner, data=mydata,
family="zibinomial", rcov=~idh(trait):units, prior=priorzi)
> Error in `[<-.data.frame`(`*tmp*`, , response.names, value = c(0L,
> 1L, : missing values are not allowed in subscripted assignments of
> data frames
There are no missing values in the data frame and I couldn't figure
out what the error message refers to.
Thanks for any help!
Suggestions for more appropriate prior specifications are also
welcome, I am never quite sure if I get them right..
Cheers,
Adrian
--
Adrian Jaeggi, PhD
Postdoctoral Researcher
Sage Center for the Study of Mind /
Department of Anthropology
University of California Santa Barbara
Santa Barbara, CA 93106-3210
Phone: 805-455-8587
More information about the R-sig-mixed-models
mailing list