Skip to content

mgcv bam() with grouped binomial data

2 messages · Casey Olives, Simon Wood

#
Hi Simon, 

Thanks for your response. I am now running mgcv 1.7-13 on R-2.14. Having fixed this error, I now encounter the following when fitting this model

Error in qr.qty(qrx, yn) : 'qr' and 'y' must have the same number of rows
Calls: bam -> bgam.fit -> qr.update -> qr.qty -> qr.qty

bam(cbind(group0, temp)~1+ as.factor(AGEcat) + HSMF+BachMF+income.cpi+poverty+tobacco+tax+CigSalesPerCap+blacks+hisp+asian+native +s( year.centered , by= fips , bs='cr', k=8) +s( fips , bs='re'), gamma=1.6, family=binomial(link="logit"), data=data

My sense is that the error is coming from the term

s( year.centered , by= fips , bs='cr', k=8)

as if I run the same model with

s( year.centered, bs='cr', k=8)

I don't get the error. Thus, something about trying to fit these smooths by fips id is causing the error. 

Do you have any ideas on what might be happening? I recognize it is hard to know without seeing the data....

Thanks again
Casey

-----Original Message-----
From: Simon Wood [mailto:s.wood at bath.ac.uk] 
Sent: Tuesday, January 31, 2012 2:17 AM
To: Casey Olives
Cc: 'r-help at r-project.org'
Subject: Re: [R] mgcv bam() with grouped binomial data

upgrade to the current mgcv version (see last item in changeLog for mgcv 
1.7-12)
On 01/30/2012 10:04 PM, Casey Olives wrote:
#
Hi Casey,

any chance that you could send me the data off list (under a strict 
undertaking to not use it for anything but this de-bugging of course)? I 
can't immediately reproduce the problem by simulating similar, but it 
certainly looks like a bug.

best,
Simon
On 02/02/2012 01:54 AM, Casey Olives wrote: