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

Jarrod Hadfield j.hadfield at ed.ac.uk
Tue Sep 26 21:01:19 CEST 2017

Hi Dani,

It is still not possible for us to diagnose the problem. You need to 
provide code+data that reproduces the error. f_lfv_c does not appear in 



On 25/09/2017 18:08, dani wrote:
> Hello again,
> Thank you so much for your prompt response. I apologize for the silly 
> questions, I am a true beginner and I am ashamed of my ignorance. I 
> guess I should explain what I did:
> I used the spl2 function and obtained the fixed and random factors 
> corresponding to the variable I needed the smoother for (named f_lfv_c).
> newdatab$l_lfvcspo<-spl2(~s(f_lfv_c,k=10), data=newdatab, p=F)
> newdatab$l_lfvcspn<-spl2(~s(f_lfv_c,k=10), data=newdatab)
> I am not sure how to attach the random effects corresponding to the 
> l_lfvcspn. I get this array of 8 variables and I am really not sure 
> how to include them in the model. Should I get forget about spl2 and 
> simply add the variable f_lfv_c as a fixed term and spl(f_lfv) in the 
> idv random term?
> Also, it seems to me that I have 11 fixed effects, I am not sure what 
> to do.
> I am really sorry about all these silly questions, I really do not 
> understand how these things work, but I would like to know more about 
> this.
> Best regards!
> Sent from Outlook <http://aka.ms/weboutlook>
> ------------------------------------------------------------------------
> *From:* Jarrod Hadfield <j.hadfield at ed.ac.uk>
> *Sent:* Monday, September 25, 2017 8:51:09 AM
> *To:* dani; Ben Bolker
> *Cc:* Matthew; r-sig-mixed-models at r-project.org
> *Subject:* Re: [R-sig-ME] MCMCglmm Poisson with an offset term and 
> splines
> Hi,
> The example is not reproducible: l_lfvcspn does not exist.
> The error is telling you that you don't have 11 fixed effects in the 
> model. Change k to the number of fixed effects in the model.
> Jarrod
> On 25/09/2017 16:39, dani wrote:
>> mc_spl1gna <- MCMCglmm(y ~ age+x2+x8+x9+x3+l_lfvcspo+x4+x5+x6+x7+offset,
>>    random =~ STUDYID+class+idv(l_lfvcspn),
>>    data   = newdatab,
>>    family = "poisson"

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20170926/df6ac8c9/attachment-0001.ksh>

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