Skip to content
Back to formatted view

Raw Message

Message-ID: <50B6711E.8030504@ucalgary.ca>
Date: 2012-11-28T20:16:30Z
From: Peter Ehlers
Subject: Plot with residuals in mgcv
In-Reply-To: <CAFimTdL+nUiCdTGB8vr27ntwhUrOWYc-9jwUnjeQDJ4EQy2v6g@mail.gmail.com>

On 2012-11-28 05:02, silje sk?r wrote:
> Hi,
>
> I am using the mgcv package (version 1.7-22.) running the model works fine,
> but when I want to have a plot with residuals I get an error.
>
> fit29<-gam(IV~s(G3)+s(V3)+factor(AAR)+s(D3)+s(RUTE,bs="re"),data=subsf,gamma=1.4,method="ML")
>
>
> plot(fit29,residuals=T)
> Error in X[, first:last] %*% object$coefficients[first:last] :
>    non-conformable arguments
>
> does some one know what this error means? the subsf matrix is 35x27.
>
> Silje

Well, the error means that the matrix X[, first:last] and
the vector object$coefficients[first:last] don't have
'matching' dimensions. I don't see why, but since the
'residuals' argument to plot.gam() can be an array
_of the correct length_ (see ?plot.gam), it just might be
that you have an object called 'T' hanging around, in which
case using 'T' in place of 'TRUE' is a bad idea.
Actually, it's _always_ a bad idea.

Peter Ehlers