[R] mgcv: bam(), error in models with random intercepts and random slopes

Fotis Fotiadis fotisfotiadis at gmail.com
Tue Sep 20 18:22:48 CEST 2016

Hi all

I am using the bam function of the mgcv package to model behavioral data of
a learning experiment. To model individual variation in learning rate, I am
testing models with (a) by-participant random intercepts of trial, (b)
by-participant random slopes and random intercepts of trial, and (c)
by-participant random smooth terms.

While all (a) and (c) models converge, I am getting an error for every
possible variation of a model with random intercepts and random slopes. For

m1.rs<-bam(acc~ 1 + igc + s(ctrial) + s(sbj, bs="re") + s(ctrial, sbj,
bs="re") , data=data_a, family=binomial)
Error in G$smooth[[i]]$first.para:G$smooth[[i]]$last.para :
  argument of length 0

Any idea on what that error might be?

Thank you in advance for your time.

P.S.: R version: 3.3.1, mgcv version: 1.8.15

PhD Candidate
Department of Philosophy and History of Science
University of Athens, Greece.

Notice: Please do not use this account for social networks invitations, for
sending chain-mails to me, or as it were a facebook account. Thank you for
respecting my privacy.

	[[alternative HTML version deleted]]

More information about the R-help mailing list