[R-sig-ME] MCMCglmm Poisson with an offset term and splines

dani orchidn at live.com
Fri Sep 22 02:52:31 CEST 2017


Hello everyone,

I have a Poisson model with an offset term that involves repeated observations nested into two cross-classified groups.

The model includes
- four categorical variables
- 6 continuous variables (for one of them I would like to include a smoother)
- the offset=log(duration)

I first used the spl2 function to create the fixed ((x6numspline1) and random terms (x6numspline2) for the smoother. I added the random smoother term to the other two random intercepts (for student ID and classroom) that I have (which are cross-classified).

My question is: Do you find my model sound? Before I study the priors, I just wanted to run a default model - is my inclusion of an offset ok? Also, given that the observations are repeated and nested into both Student ID and classroom, I am not sure how to specify the variance structure in MCMCglmm (beginner here:))

mc_spl0 <- MCMCglmm(number_events ~ x1cat+x2cat+x8cat+x9cat+x3num+x4num+x5num+x6numspline1+x7num+x8num+log(duration),
                    random =~ ID+class+idv(x6numspline2),
                    data   = newdat,
                    family = "poisson",
                    thin   = 100,
                    burnin = 10000,
                    nitt   = 150000,
                    saveX=TRUE, saveZ=TRUE, saveXL=TRUE, pr=TRUE, pl=TRUE)

In addition, I am not sure what to make of the results for the offset term (included as a covariate in the model) in the output - how should I discuss them?

Thank you all so much!
Best regards,
N-M.
<http://aka.ms/weboutlook>

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list