Message-ID: <201001251506.19921.s.wood@bath.ac.uk>
Date: 2010-01-25T15:06:19Z
From: Simon Wood
Subject: How to define degree=1 in mgcv
In-Reply-To: <382e94521001241840y23faeec1v9a55e0bad027a2b@mail.gmail.com>
On Monday 25 January 2010 02:40, hellen lee wrote:
> Hi, all
>
> I have a question on mgcv and ns. Now I want to compare the results from
> glm, gam and ns. Take a simple model y~x for example.
>
> glm1 = glm(y~x, data=data1)
> gam1 = gam(y~s(x), data=data1)
> ns1 = glm(y~ns(x),data=data1)
>
> In order to confirm the result from glm1 is consistent to those from gam1
> and ns1, I want to define degree=1 in mgcv and ns. I am wondering if there
> is somebody can give me some suggestions? I appreciate.
gam(y~x,data=data1)
or
gam(y~s(x,sp=1e6),data=data1)
you might need to increase the value supplied in `sp' in order to get the EDF
for the smooth term close enough to 1 for your liking.
best,
Simon
--
> Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK
> +44 1225 386603 www.maths.bath.ac.uk/~sw283