similar to: Formulas in gam function of mgcv package

Displaying 20 results from an estimated 10000 matches similar to: "Formulas in gam function of mgcv package"

2009 Sep 01
3
Strange error returned or bug in gam in mgcv????
Dear friends, what is this error message in gam???? I cannot understand what it means .... is it a bug? gam_bray_scot24_pc_0505<gam(bray~s(PC1,PC2,PC3,PC4,PC5, PC1.1,PC2.1,PC3.1,PC4.1,PC5.1),data=dist_scot24_vector_with_climate) Error in if (length(data) != vl) { : missing value where TRUE/FALSE needed Calls: gam ... smooth.construct -> smooth.construct.tp.smooth.spec -> array In
2006 Jun 18
1
GAM selection error msgs (mgcv & gam packages)
Hi all, My question concerns 2 error messages; one in the gam package and one in the mgcv package (see below). I have read help files and Chambers and Hastie book but am failing to understand how I can solve this problem. Could you please tell me what I must adjust so that the command does not generate error message? I am trying to achieve model selection for a GAM which is required for
2010 Oct 27
1
GAM function in mgcv package
Hi R-users I am trying to use the GAM function of the mgcv package. But I am having problem trying to specify the k parameter. Although I managed to run some models by giving to the parameter some (random) value, and it is explained by Wood (2006) that it does not seem to "really" affect the final result, I would like to grasp better its meaning. I understand that is the
2008 Nov 20
1
gam and ordination (vegan and labdsv surf and ordisurf)
I have a general question about using thin plate splines in the surf and ordisurf routines. My rudimentary knowledge of a gam is that with each predictive variable there is a different smooth for each one and then they are added together with no real interaction term (because they don't handle this well?). Now, If I have two variables that have a high D^2 score and a low GCV score (I am
2010 Apr 14
1
Selecting derivative order penalty for thin plate spline regression (GAM - mgcv)
Hi, I am using GAMs (package mgcv) to smooth event rates in a penalized regression setting and I was wondering if/how one can select the order of the derivative penalty. For my particular problem the order of the penalty (parameter "m" inside the "s" terms of the formula argument) appears to have a larger effect on the AIC/deviance of the estimated model than the
2009 Sep 03
3
goodness of "prediction" using a model (lm, glm, gam, brt, regression tree .... )
Dear R-friends, How do you test the goodness of prediction of a model, when you predict on a set of data DIFFERENT from the training set? I explain myself: you train your model M (e.g. glm,gam,regression tree, brt) on a set of data A with a response variable Y. You then predict the value of that same response variable Y on a different set of data B (e.g. predict.glm, predict.gam and so on).
2009 May 05
1
A question about using “by” in GAM model fitting of interaction between smooth terms and factor
I am a little bit confusing about the following help message on how to fit a GAM model with interaction between factor and smooth terms from http://rss.acs.unt.edu/Rdoc/library/mgcv/html/gam.models.html: ?Sometimes models of the form: E(y)=b0+f(x)z need to be estimated (where f is a smooth function, as usual.) The appropriate formula is: y~z+s(x,by=z) - the by argument ensures that the smooth
2010 Dec 03
1
mgcv package plot superimposing smoothers
Dear R help list, I'm fitting a 'variable coefficient model' in the MGCV package and I want to plot the different smoothers I get for each factor level in one graph. So, I do something like this to fit the gam: Mtest <- gam(outcome ~ s(age, by=as.numeric(gender==0)) + s(age,by=as.numeric(gender==1))+factor(Gender)) Then I can plot the smoother for gender=0: plot(Mtest,select=1)
2008 May 06
1
mgcv::gam shrinkage of smooths
In Dr. Wood's book on GAM, he suggests in section 4.1.6 that it might be useful to shrink a single smooth by adding S=S+epsilon*I to the penalty matrix S. The context was the need to be able to shrink the term to zero if appropriate. I'd like to do this in order to shrink the coefficients towards zero (irrespective of the penalty for "wiggliness") - but not necessarily all the
2009 Oct 13
2
How to choose a proper smoothing spline in GAM of mgcv package?
Hi, there, I have 5 datasets. I would like to choose a basis spline with same knots in GAM function in order to obtain same basis function for 5 datasets. Moreover, the basis spline is used to for an interaction of two covarites. I used "cr" in one covariate, but it can only smooth w.r.t 1 covariate. Can anyone give me some suggestion about how to choose a proper smoothing spline
2011 Jun 07
2
gam() (in mgcv) with multiple interactions
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 gam(). I have five independent variables, all continuous, all uniformly
2011 Feb 23
5
mgcv: beta coefficient and 95%CI
Hi i am doing an environmental research The equation is as follow: gam(y1 ~ x1 + s(x2) + s(x3) + s(x4), family = gaussian, fit = true) I would like to obtain the beta coefficient and 95CI of x4 (or s(x4)), what should I do? Thanks, Lung -- View this message in context: http://r.789695.n4.nabble.com/mgcv-beta-coefficient-and-95-CI-tp3320491p3320491.html Sent from the R help mailing list
2008 Jun 09
1
package mgcv
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20080609/960593f6/attachment.asc>
2000 Oct 03
5
Where is gam?
I noticed that there is no generalised additive model functions in R (1.1.1) ... is there a package that implements them? Thanks Prasad ***************************************************************** Mr. Anantha Prasad, Ecologist/GIS Specialist USDA Forest Service, 359 Main Rd. Delaware OHIO 43015 USA Ph: 740-368-0103 Email: aprasad at fs.fed.us Web:
2002 Jan 28
6
Almost a GAM?
Hello: I sent this question the other day with the wrong subject heading and couple typos, with no response. So, here I go again, having made those corrections. I would like to estimate, for lack of a better description, a partially additive non-parametric model with the following structure: z~ f(x,y):w1 + g(x,y):w2 + e In other words, I'd like to estimate the marginals with respect to
2012 Feb 13
3
mgcv: increasing basis dimension
hi Using a ts or tprs basis, I expected gcv to decrease when increasing the basis dimension, as I thought this would minimise gcv over a larger subspace. But gcv increased. Here's an example. thanks for any comments. greg #simulate some data set.seed(0) x1<-runif(500) x2<-rnorm(500) x3<-rpois(500,3) d<-runif(500) linp<--1+x1+0.5*x2+0.3*exp(-2*d)*sin(10*d)*x3
2010 Aug 04
2
more questions on gam/gamm(mgcv)...
Hi R-users, I'm using R 2.11.1, mgcv 1.6-2 to fit a generalized additive mixed model. I'm new to this package...and just got more and more problems... 1. Can I include correlation and/or random effect into gam( ) also? or only gamm( ) could be used? 2. I want to estimate the smoothing function s(x) under each level of treatment. i.e. different s(x) in each level of treatment. shall I
2006 Jan 19
2
gam
Dear R users, I'm new to both R and to this list and would like to get advice on how to build generalized additive models in R. Based on the description of gam, which I found on the R website, I specified the following model: model1<-gam(ST~s(MOWST1),family=binomial,data=strikes.S), in which ST is my binary response variable and MOWST1 is a categorical independent variable. I get the
2007 Aug 08
1
prediction using gam
I am fitting a two dimensional smoother in gam, say junk = gam(y~s(x1,x2)), to a response variable y that is always positive and pretty well behaved, both x1 and x2 are contained within [0,1]. I then create a new dataset for prediction with values of (x1,x2) within the range of the original data. predict(junk,newdata,type="response") My predicted values are a bit strange
2012 Nov 05
1
Post hoc tests in gam (mgcv)
Hi. I'm analysing some fish biological traits with a gam in mgcv. After several tries, I got this model log(tle) = sexcolor + s(doy, bs = "cc", by = sexcolor) +log(tl) sexcolor is a factor with 4 levels doy is "day of year", which is modeled as a smoother tl is "total length of the fish" The summary of this models is (only parametric coefficientes): Parametric