Dear Thierry, Dear all,
Many thanks for your replies.
Le jeudi 16 février 2023 à 10:39:34 UTC+1, Thierry Onkelinx
a écrit :
Dear Sacha,
use glm() in this case. I'd rather code the covariable as TRUE / FALSE or as a
factor.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statisticia
Dear Sacha,
use glm() in this case. I'd rather code the covariable as TRUE / FALSE or
as a factor.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biome
Dear R-experts,
I am trying to fit a GAM with 2 binary predictors (variables coded 0,1). I
guess I cannot just smooth binary variables. By the way I code them as
0=no,1=yes, then mgcv will think those variables are numeric.
I have tried to change 0 and 1 in no and yes. It does not work.
How to
Hi,
I’m currently using R studio to analyse data - I have 3 data sets consisting of
months beginning in 02/2005-02/2020 with numbers of internet searches for 3
different countries. I have used a GAM to analyse this data and see if there
are any significant differences or trends, but I am unsure
> I try to build a model for five parameters
> But, We found these five parameters have multicollinearity. We observed a
significant correlation between these parameters. So, we performed a PCA to
convert the set of five correlated air pollution variables into a set of
linearly uncorrelated main va
Dear R-helpers,
My system: R 3.5.3 osx, mgcv 1.8-28
I try to build a model for five parameters
Model = gam( Y ~ s(x1) + s(x2) + s(x3) + s(x4) + s(x5))
But, We found these five parameters have multicollinearity. We observed a
significant correlation between these parameters. So, we performe
Hallo,
I want to use gam from the mgcv package with a mrf smoother.
This is my data set (`x`)
y id
1 0.6684496 1
2 0.6684496 2
3 0.6684496 3
4 0.6684496 4
5 0.6684496 5
6 0.6684496 6
7 0.6684496 7
8 0.5879492 8
9 0.5879492 9
Hello, I am new to R and running R version 3.4.3 (2017-11-30),
x86_64-apple-darwin15.6.0 (64-bit), macOS High Sierra 10.13.2.
I am running the gam package to model disease incidence (negative binomial
distribution) as a function of two covariates, and wish to incorporate
spatial correlation among
Not exactly, as by default you are using a log link in the Poisson
model, but not the Gaussian model. Simon
On 14/12/17 22:57, Miluji Sb wrote:
Dear all,
I apologize as this may not be a strictly R question. I am running GAM
models using the mgcv package.
I was wondering if the interpretatio
Dear all,
I apologize as this may not be a strictly R question. I am running GAM
models using the mgcv package.
I was wondering if the interpretation of the smooth splines of the 'x'
variable is the same in the following two cases:
# Linear probability model
m1 <- gam(count ~ factor(city) + fact
.
>>
>> 32.03 61.18 97.20 112.20 165.00 226.00
>>
>>
>>
>> Value range of observed data:
>>
>>
>>> summary(nb_unique)
>>>
>>Min. 1st Qu. MedianMean 3rd Qu.Max.
>>
>> 43.00 67.00 81
(nb_unique)
> Min. 1st Qu. MedianMean 3rd Qu.Max.
>
>43.00 67.00 81.00 84.16 92.75 153.00
>
>
>* By using fitted(mod), I obtain NULL.
> I am a novice in GAMs. So, I don�t know why the results are different between
> models with offset=argu
e different between
models with offset=argument and offset().
Thanks a lot for your help.
Have a nice day
Marine
De : peter dalgaard
Envoy� : mardi 22 novembre 2016 23:52
� : Bert Gunter
Cc : Marine Regis; r-help@r-project.org
Objet : Re: [R] GAM with the negative
> On 22 Nov 2016, at 23:07 , Bert Gunter wrote:
>
> Define "very different." Sounds like a subjective opinion to me, for
> which I have no response. Apparently others are similarly flummoxed.
> Of course they would not in general be identical.
Er? I don't see much reason to disagree that a ran
Well part of the issue is that the negative binomial estimates are for
means and they can differ a fair bit from the raw counts, but I'm also
guessing that part of the issue is that the offset may not be accounted for
with the predict.gam() function.
Brian
Brian S. Cade, PhD
U. S. Geological Sur
> On Nov 22, 2016, at 1:29 PM, Marine Regis wrote:
>
> Hello,
>
>> From capture data, I would like to assess the effect of longitudinal changes
>> in proportion of forests on abundance of skunks. To test this, I built this
>> GAM where the dependent variable is the number of unique skunks and
Define "very different." Sounds like a subjective opinion to me, for
which I have no response. Apparently others are similarly flummoxed.
Of course they would not in general be identical.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticki
Hello,
>From capture data, I would like to assess the effect of longitudinal changes
>in proportion of forests on abundance of skunks. To test this, I built this
>GAM where the dependent variable is the number of unique skunks and the
>independent variables are the X coordinates of the centroid
?
Dear R users,
I'm currently analysing some data with the gam function from the mgcv package.
I'm looking at the relationship between spatially referenced budburst dates
(recorded as number of days from January 1st) and two continuous variables, and
their interaction, where they are found. I
Trevor, Can I just check - were you using the new 'nb' from mgcv version
>= 1.8 or the old (and very slow) 'negbin' family? (Not that negative
binomial seems needed here, but just to know) best, Simon
On 16/07/14 21:16, Trevor Davies wrote:
Hi Simon,
Thank you so much for being active on thi
Hi Simon,
Thank you so much for being active on this list, it really is tremendously
helpful.
Thanks you for your insights, I was wondering whether both terms were
necessary.
As for 'NB wouldn't work' it was a convergence problem (and tremendously
slow). There were also issues with the models n
Trevor,
It looks like you've added a parametric COR.YEARLY.MEAN in addition to
your s(cxe,cyn,by=COR.YEARLY.MEAN) term. Because the latter includes a
linear effect of COR.YEARLY.MEAN, then the parametric COR.YEARLY.MEAN
will not be identifiable, so gam has dropped it.
I guess from the scale
I have run a quasipoisson spatial model via GAM (NB just wouldn't work) and
I am getting the following output of one of my parameters
(COR.YEARLY.MEAN). Does this suggest an error in the model fit? The model
seems to have converged. Apologies for the lack of reproducible example
but it didn't rea
Hi Katharina, what gam package are you using? With mgcv you can inspect
the results of the output variables to check whether the fixed field is
true which would indicate whether the df is fixed or floating. I'm not
sure if this is applicable to what you want.
My rough translation of your German
Dear R-Users,
I am fairly new to R and got in trouble by understanding how to run a GAM
using penalized regression splines with 4 degress of freedom (even by
reading the R Documentation).
I tried the following:
> gamreg1.2<-gam(num_FCRlong ~ s(GDP,df=4)+s(cupol_GDPpCapita,df=4)
+
Hi everyone,
I am new to additive modelling and am surprised by the results of a model
I'm working on. I wanted to check with more experienced users to make sure
I'm not misunderstanding something basic.
*Data:* I have 10 replicated runs from an evolutionary simulation model,
measuring the evolv
it's a pity, but thanks anyway!
--
View this message in context:
http://r.789695.n4.nabble.com/GAM-Assumption-Tests-tp4681670p4681857.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.eth
Hi Mike, I recently had this issue and didn't find any package that
implemented these tests directly for the gam object. I found it simplest
just to pull the residuals from it and run tests like shapiro.test
directly.
Best,
Collin.
On Thu, 5 Dec 2013, Mike.lang wrote:
> Dear all
Dear all,
currently I set up a GAM for my dataset (~32k records). I assume a normal
distribution, constant variance and no correlation effects.
With gam.check() it is possible to check those assumptions graphically. But
is there also any option to do quantitative tests like the Wald-Test,
shapi
Dear Bert,
Thanks for helping.
Your questions 'answers' why I get the expected behavior if
'group' is a factor. My question was why I don't get the expected
behavior if 'group' is not a factor.
>From a theoretical (non-programming) point of view, there is no
difference in a factor with two level
Think about it. How can one define a smooth term with a factor???
Further discussion is probably offtopic. Post on
stats.stackexchange.com if it still isn't obvious.
Cheers,
Bert
On Tue, Oct 29, 2013 at 1:16 PM, Marius Hofert
wrote:
> Dear expeRts,
>
> If I specify group = as.factor(rep(1:2, ea
Dear expeRts,
If I specify group = as.factor(rep(1:2, each=n)) in the below
definition of dat, I get the expected behavior I am looking for. I
wonder why I
don't get it if group is *not* a factor... My guess was that,
internally, factors are treated as natural numbers (and this indeed
seems to be
We would like to announce the following statistics course:
Beginner's Guide to MCMC, GAM and GAMM
When: 10-14 March 2014
Where: Elche, Alicante, Spain
For details, see: http://www.highstat.com/statscourse.htm
Course flyer: http://www.highstat.com/Courses/Flyer2014_3ElcheV2.pdf
Kind regards,
just to clarify how I see the error, it was the mis-definition of the
penalty term in the function dv. The following code corrects this error.
What is actually being minimised at this step is the penalised deviance
conditional on the smoothing parameter. A second issue is that the optim
default ("N
hi
probably a silly mistake, but I expected gam to minimise the penalised
deviance.
thanks
greg
set.seed(1)
library(mgcv)
x<-runif(100)
lp<-exp(-2*x)*sin(8*x)
y<-rpois(100,exp(lp))
plot(x,y)
m1<-gam(y~s(x),poisson)
points(x,exp(lp),pch=16,col="green3")
points(x,fitted(m1),pch=16,cex=0.5,col="bl
please ignore this, I see the error.
greg
> hi
>
> probably a silly mistake, but I expected gam to minimise the penalised
> deviance.
>
> thanks
>
> greg
>
> set.seed(1)
> library(mgcv)
> x<-runif(100)
> lp<-exp(-2*x)*sin(8*x)
> y<-rpois(100,exp(lp))
> plot(x,y)
> m1<-gam(y~s(x),poisson)
> points
For smooths the method is described in
Wood 2013 On p-values for smooth components of an extended generalized
additive model, Biometrika 100(1),221-228
http://biomet.oxfordjournals.org/content/early/2012/10/18/biomet.ass048.full.pdf+html
best,
Simon
On 08/05/13 15:12, Andrew Crane-Droesch wr
?summary.gam ## The Help page
Since the Help page is presumably not enough, why don't you look at
the code?? R is open source.
summary.gam ## at the prompt
-- Bert
On Wed, May 8, 2013 at 7:12 AM, Andrew Crane-Droesch wrote:
> Dear All,
>
> I'm using gam for a project that involves multiple i
Dear All,
I'm using gam for a project that involves multiple imputation, and it
has led me to a question about how f-statistics/p-values work in gam.
Specifically, how do the values in summary(gam) get generated? As is
made clear by the dumb example below, I'm manipul;ating gam objects to
r
On Tue, 2013-04-23 at 17:51 +0200, Lucas Holland wrote:
> Hey all,
>
> I'm using the gam() function inside the mgcv package to fit a
> penalised spline to some data. However, I don't quite understand what
> exactly the intercept it includes by default is / how to interpret
> it.
>
> Ideally I'd
Hey all,
I'm using the gam() function inside the mgcv package to fit a penalised spline
to some data. However, I don't quite understand what exactly the intercept it
includes by default is / how to interpret it.
Ideally I'd like to understand what the intercept is in terms of the B-Spline
and
Thanks!
On Mon, Mar 25, 2013 at 6:25 PM, Joshua Wiley wrote:
> Yep that's exactly right! :)
>
> On Mon, Mar 25, 2013 at 6:22 PM, Antonio P. Ramos
> wrote:
> > Just to clarify: I should include wealth - the categorical variable - as
> a
> > fixed effects *and* within the smooth using the argumen
Yep that's exactly right! :)
On Mon, Mar 25, 2013 at 6:22 PM, Antonio P. Ramos
wrote:
> Just to clarify: I should include wealth - the categorical variable - as a
> fixed effects *and* within the smooth using the argument "by". It that
> correct? thanks a bunch
>
>
> On Mon, Mar 25, 2013 at 6:18
Just to clarify: I should include wealth - the categorical variable - as a
fixed effects *and* within the smooth using the argument "by". It that
correct? thanks a bunch
On Mon, Mar 25, 2013 at 6:18 PM, Joshua Wiley wrote:
> Hi Antonio,
>
> If wealth is a factor variable, you should include the
Hi Antonio,
If wealth is a factor variable, you should include the main effect in
the model, as the smooths will be centered.
Cheers,
Josh
On Mon, Mar 25, 2013 at 6:09 PM, Antonio P. Ramos
wrote:
> Hi all,
>
> I am not sure how to handle interactions with categorical predictors in the
> GAM
Just to clarify: gam.1 has wealth inside the smooths and as a fixed effect
predictor while gam.2 only have wealth inside the smooths. Thanks
On Mon, Mar 25, 2013 at 6:09 PM, Antonio P. Ramos <
ramos.grad.stud...@gmail.com> wrote:
> Hi all,
>
> I am not sure how to handle interactions with catego
Hi all,
I am not sure how to handle interactions with categorical predictors in the
GAM models. For example what is the different between these bellow two
models. Tests are indicating that they are different but their predictions
are essentially the same.
Thanks a bunch,
> gam.1 <- gam(mortality
I have asked this question on Stackoverflow and was told it does not relate
to the sites' mission as it is statistical question, thus I brought it here.
I am fitting a gam mode in the mgcv package to study associations of
environmental pollutants and mortality. The aim is to choose a model with
l
Dear List,
I'm just teaching myself semi-parametric techniques. Apologies in
advance for the long post.
I've got observational data and a longitudinal, semi-parametric model
that I want to fit in GAM (or potentially something equivalent), and I'm
not sure how to do it. I'm posting this to as
Hi Andrew,
Could you send me a bit more information (off list, as this is likely to
get into obscure details), please?
In particular can you let me know the mgcv and R version numbers, the
server operating system and, if possible, what BLAS it has installed?
best,
Simon
On 16/10/12 07:32, An
On 16/10/12 07:32, Andrew Crane-Droesch wrote:
Hi All,
I'm running into a problem with GAM (in the MGCV package). When I try
to estimate the model, I get the following error message:
1> fit <-
gam(ndvi~s(rain)+s(temp)+s(rainl1)+s(rainl2)+s(rainxY)+s(rainl1xY)+s(rainl2xY)+s(tempxY),
Hi All,
I'm running into a problem with GAM (in the MGCV package). When I try
to estimate the model, I get the following error message:
1> fit <-
gam(ndvi~s(rain)+s(temp)+s(rainl1)+s(rainl2)+s(rainxY)+s(rainl1xY)+s(rainl2xY)+s(tempxY),
data=dsub, weights=wvec)
Error in while (m
Smooth terms are constrained to sum to zero over the covariate values.
This is an identifiability constraint designed to avoid confounding with
the intercept (particularly important if you have more than one smooth).
If you remove the intercept from you model altogether (m2) then the
smooth wil
pe it helps
Anna
Anna Freni Sterrantino
Department of Statistics
University of Bologna, Italy
via Belle Arti 41, 40124 BO.
Da: SAEC
A: r-help@r-project.org
Inviato: Giovedì 11 Ottobre 2012 0:22
Oggetto: [R] GAM without intercept
Hi everybody,
I am trying to
Hi everybody,
I am trying to fit a GAM model without intercept using library mgcv.
However, the result has nothing to do with the observed data. In fact
the predicted points are far from the predicted points obtained from the
model with intercept. For example:
#First I generate some simulated
Hi Dan,
Any chance that you could send me the data offlist and I'll take a look
(under the understanding that I'll only use the data for de-bugging of
course)?
Could you also let me know which linux distribution you are using,
whether it's 64bit or 32 bit, and, if possible, what BLAS R is us
On Sun, Oct 7, 2012 at 3:00 PM, garth wrote:
> Hello,
>
> I'm running a multimodel analysis which involves fitting several GAM models
> as implemented in package mgcv. The issue I'm having is that when I try to
> fit my model, gam gives me the following error message: 'Error in
> initial.sp(w * X
Hello,
I'm running a multimodel analysis which involves fitting several GAM models
as implemented in package mgcv. The issue I'm having is that when I try to
fit my model, gam gives me the following error message: 'Error in
initial.sp(w * X, S, off) : S[[2]] matrix is not +ve definite.' The stra
Dear R users,
apologies if this has been debated before, but I was unable to find it
anywhere (with respect to shrinkage approach).
I am trying to evaluate explained deviance of each model term in a GAM.
I am using a the mgcv library for fitting a GAM to binary data.
Thin plate regression spline
Hello fellow R users,
I would need your help on GAM/GAMM models and interpolation on a marked
spatial point process (cases and controls).
I use the mgcv package to fit a GAMM model with a binary outcome, a
parametric part (var1+..+varn), a spline used for the spatial variation, and
a random
Hi Will,
Your edf interpretation is not quite right. The smooths are subject to a
centring constraint for identifiability reasons, and this removes a
degree of freedom, so EDF=1 corresponds to a straight line fit.
On your second point and third points. anova(gamb1.1,gamb1.2,
test="Chisq") co
We are using GAM in mgcv (Wood), relatively new users, and wonder if anyone
can advise us on a problem we are encountering as we analyze many short time
series datasets. For each dataset, we have four models, each with intercept,
predictor x (trend), z (treatment), and int (interaction between x an
Geraldine,
They really are the same fit, try...
range(fitted(b)-fitted(b1))
[1] -3.333782e-10 4.173699e-10
... for example.
The edf differences are just down to differences in how identifiability
constraints are handled in the two cases. For b1 the smooths of x2 do
not have centring constr
Dear all,
I'm using the mgcv library by Simon Wood to fit gam models with interactions
and I have been reading (and running) the "factor 'by' variable example"
given on the gam.models help page (see below, output from the two first models
b, and b1).
The example explains that both b and b1 fit
Dear useRs,
I have a question with respect to fitting a non-linearity using gam
(mgcv package, version 1.7-16).
In a study I'm currently conducting, I'd like to find out if there is
a breakpoint after which the effect of Age of Acquisition (AOA) of the
second language changes. I.e. if the slope o
Solution: have package mgcv loaded when you predict...not just for the fit.
:) Silly mistake...
Thanks Simon!
Ben
On Thu, May 3, 2012 at 3:56 PM, Ben quant wrote:
> Hello,
>
> I don't understand what went wrong or how to fix this. How do I set
> qr=TRUE for gam?
>
> When I produce a fit using
Which version of gam are you using (i.e. which package and version number?)
prediction with fitted gam objects should call predict.gam, and I'm not
quite sure why this is not happening here (you do have the mgcv or gam
loaded while trying to predict, I suppose?).
On 03/05/12 22:56, Ben quant
Hello,
I don't understand what went wrong or how to fix this. How do I set qr=TRUE
for gam?
When I produce a fit using gam like this:
fit = gam(y~s(x),data=as.data.frame(l_yx),family=family,control =
list(keepData=T))
...then try to use predict:
(see #1 below in the traceback() )
> traceback()
oun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens
Ben quant
Verzonden: woensdag 14 maart 2012 19:48
Aan: Patrick Breheny
CC: r-help@r-project.org
Onderwerp: Re: [R] gam - Y axis probability scale with confidence/error lines
Thank you. The binomial()$linkinv() is good to know.
Ben
Thank you. The binomial()$linkinv() is good to know.
Ben
On Wed, Mar 14, 2012 at 12:23 PM, Patrick Breheny
wrote:
> Actually, I responded a bit too quickly last time, without really reading
> through your example carefully. You're fitting a logistic regression model
> and plotting the results o
Actually, I responded a bit too quickly last time, without really
reading through your example carefully. You're fitting a logistic
regression model and plotting the results on the probability scale. The
better way to do what you propose is to obtain the confidence interval
on the scale of th
That was embarrassingly easy. Thanks again Patrick! Just correcting a
little typo to his reply. this is probably what he meant:
pred = predict(fit,data.frame(x=xx),type="response",se.fit=TRUE)
upper = pred$fit + 1.96 * pred$se.fit
lower = pred$fit - 1.96 * pred$se.fit
# For people who are interes
The predict() function has an option 'se.fit' that returns what you are
asking for. If you set this equal to TRUE in your code:
pred <- predict(fit,data.frame(x=xx),type="response",se.fit=TRUE)
will return a list with two elements, 'fit' and 'se.fit'. The pointwise
confidence intervals will
Hello,
How do I plot a gam fit object on probability (Y axis) vs raw values (X
axis) axis and include the confidence plot lines?
Details...
I'm using the gam function like this:
l_yx[,2] = log(l_yx[,2] + .0004)
fit <- gam(y~s(x),data=as.data.frame(l_yx),family=binomial)
And I want to plot it so
Thanks for the explanation !
Happy to know there is no problem with my models.
Have a good day,
Arnaud
2012/2/3 Simon Wood
> It is completely safe to ignore this. Here is what is going on...
>
> mgcv routine 'mroot' is calling R routine 'chol' to find the *pivoted*
> Choleski factor of a posit
It is completely safe to ignore this. Here is what is going on...
mgcv routine 'mroot' is calling R routine 'chol' to find the *pivoted*
Choleski factor of a positive semi definite matrix. This is deliberate,
and completely ok to do, but 'chol' issues a warning when a matrix is
only positive s
Dear list,
I fitted the same GAM model using directly the function gam(mgcv) ... then
as a parameter of another function that capture the warnings messages (see
below).
In the first case, there is no warning message printed, but in the last
one, the function find two warning messages stating "mat
On Jan 16, 2012, at 9:17 AM, collifu wrote:
Hi all,
I constructed a GAM model with a linear term and two smooth terms,
all of
them statistically significant but the intercept was not
significant. The
adjusted r2 of this model is 0.572 and the deviance 65.3.
I decided to run the model aga
Hi all,
I constructed a GAM model with a linear term and two smooth terms, all of
them statistically significant but the intercept was not significant. The
adjusted r2 of this model is 0.572 and the deviance 65.3.
I decided to run the model again without intercept, so I used in R the
following in
Dear Simon,
I have the same problem. I understand te(a), te(b) are nested in te(a,b)
according to your paper on tensor product. I have no enough data to perform
te(a,b,d) and only care the interactions a*b and a*d, so I did
y=te(a,b)+te(a,d). The resutl is good. I am wondering if this is the
co
Thank you Simon. I already ordered your book.
Regards,
Ben
On Fri, Dec 9, 2011 at 10:49 AM, Simon Wood wrote:
> See help("mgcv-FAQ"), item 2.
>
> best,
> Simon
>
>
> On 09/12/11 15:05, Ben quant wrote:
>
>> Hello,
>>
>> I'd like to understand 'what' is predicting the response for library(mgcv)
See help("mgcv-FAQ"), item 2.
best,
Simon
On 09/12/11 15:05, Ben quant wrote:
Hello,
I'd like to understand 'what' is predicting the response for library(mgcv)
gam?
For example:
library(mgcv)
fit<- gam(y~s(x),data=as.data.frame(l_yx),family=binomial)
xx<- seq(min(l_yx[,2]),max(l_yx[,2]),len=
On Dec 9, 2011, at 10:05 AM, Ben quant wrote:
Hello,
I'd like to understand 'what' is predicting the response for
library(mgcv)
gam?
For example:
library(mgcv)
fit <- gam(y~s(x),data=as.data.frame(l_yx),family=binomial)
xx <- seq(min(l_yx[,2]),max(l_yx[,2]),len=101)
plot(xx,predict(fit,da
There is an extensive list of references given in ?gam, including an
R-news article and Simon Woods's (gam's author) website. Would that
not be the logical place to start?
-- Bert
On Fri, Dec 9, 2011 at 7:05 AM, Ben quant wrote:
> Hello,
>
> I'd like to understand 'what' is predicting the respon
Hello,
I'd like to understand 'what' is predicting the response for library(mgcv)
gam?
For example:
library(mgcv)
fit <- gam(y~s(x),data=as.data.frame(l_yx),family=binomial)
xx <- seq(min(l_yx[,2]),max(l_yx[,2]),len=101)
plot(xx,predict(fit,data.frame(x=xx),type="response"),type="l")
I want to
On 11/08/2011 11:57 AM, Gyanendra Pokharel wrote:
Hi R community!
I am analyzing the data set "motorins" in the package "faraway" by using
the generalized additive model. it shows the following error. Can some one
suggest me the right way?
library(faraway)
data(motorins)
motori<- motorins[motori
Kilometres has only 5 unique values, while Bonus has only 7, but the
default smoothing basis dimension for the s terms is 10, so there is a
problem. Solution is to reduce the basis dimension. e.g.
amgam <- gam(log(Payment) ~ offset(log(Insured))+
+ s(as.numeric(Kilometres),k=5) + s(Bonus,k=7) +
Gyanendra Pokharel wrote on 11/08/2011 10:57:38 AM:
>
> Hi R community!
> I am analyzing the data set "motorins" in the package "faraway" by using
> the generalized additive model. it shows the following error. Can some
one
> suggest me the right way?
>
> library(faraway)
> data(motorins)
> moto
Hi R community!
I am analyzing the data set "motorins" in the package "faraway" by using
the generalized additive model. it shows the following error. Can some one
suggest me the right way?
library(faraway)
data(motorins)
motori <- motorins[motorins$Zone==1,]
library(mgcv)
>amgam <- gam(log(Paymen
On 26/10/11 12:10, Achim Zeileis wrote:
On Wed, 26 Oct 2011, Kari Ruohonen wrote:
Hi,
I wonder if predict.gam is supposed to work with family=negbin()
definition? It seems to me that the values returned by
type="response" are far off the observed values. Here is an example
output from the ne
On Wed, 26 Oct 2011, Kari Ruohonen wrote:
Hi,
I wonder if predict.gam is supposed to work with family=negbin() definition?
It seems to me that the values returned by type="response" are far off the
observed values. Here is an example output from the negbin examples:
set.seed(3)
n<-400
dat<-
Hi,
I wonder if predict.gam is supposed to work with family=negbin()
definition? It seems to me that the values returned by type="response"
are far off the observed values. Here is an example output from the
negbin examples:
> set.seed(3)
> n<-400
> dat<-gamSim(1,n=n)
> g<-exp(dat$f/5)
> dat$
I'm looking for the best way to do the following:
run a set of GAM models, and then make predictions with new data.
My problem is the size of the gam model object, I would like to strip it
down to the bare minimum of information needed to apply the model to new
data. For example, if this wer
not sure if I'm missing something here, but since you are using a log
link, isn't the ratio you are looking for given by the `treatmentB'
parameter in the summary (independent of X)
> summary(gfit)
[snip]
Parametric coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.
But that just gives me the prediction of Y for treatment A or B, not the ratio.
As I stated:
# I am interested in the relationship:
# Y(treatment =="B") / Y(treatment=="A") as a function of X, with a
confidence interval!
I can get the SE for either of them using predict.gam without a
problem, b
On Jun 27, 2011, at 10:45 PM, Remko Duursma wrote:
Dear R-helpers,
I am trying to construct a confidence interval on a prediction of a
gam fit. I have the Wood (2006) book, and section 5.2.7 seems relevant
but I am not able to apply that to this, different, problem.
Any help is appreciated!
Dear R-helpers,
I am trying to construct a confidence interval on a prediction of a
gam fit. I have the Wood (2006) book, and section 5.2.7 seems relevant
but I am not able to apply that to this, different, problem.
Any help is appreciated!
Basically I have a function Y = f(X) for two different
your help!
Ben Haller
McGill University
http://biology.mcgill.ca/grad/ben/
Begin forwarded message:
> From: Simon Wood
> Date: June 9, 2011 11:35:11 AM EDT
> To: r-help@r-project.org, rh...@sticksoftware.com
> Subject: Re: [R] gam() (in mgcv) with multiple interactions
>
>
I think that the main problem here is that smooths are not constrained
to pass through the origin, so the covariate taking the value zero
doesn't correspond to no effect in the way that you would like it to.
Another way of putting this is that smooths are translation invariant,
you get essentia
Hi! I'm learning mgcv, and reading Simon Wood's book on GAMs, as recommended
to me earlier by some folks on this list. I've run into a question to which I
can't find the answer in his book, so I'm hoping somebody here knows.
My outcome variable is binary, so I'm doing a binomial fit with
1 - 100 of 179 matches
Mail list logo