Displaying 20 results from an estimated 5000 matches similar to: "Conflict between gam::gam and mgcv::gam"
2008 Jun 11
1
mgcv::gam error message for predict.gam
Sometimes, for specific models, I get this error from predict.gam in library
mgcv:
Error in complete.cases(object) : negative length vectors are not allowed
Here's an example:
model.calibrate <-
gam(meansalesw ~ s(tscore,bs="cs",k=4),
data=toplot,
weights=weight,
gam.method="perf.magic")
> test <- predict(model.calibrate,newdata)
Error in
2008 Aug 19
0
gam.check in gam (mgcv)
Hallo
I need some help with the output provided by gam.check after a gam fit (using the package mgcv).
To give a brief description of my data, I have
claims: a vector of values, which include NA's and one large negative value - otherwise all positive (55 values in total that are not NA).
origin: a factor with 10 levels
j : taking the values 1, 2, ...., 10
I have fitted a gam, with:
>
2007 Dec 13
1
Two repeated warnings when runing gam(mgcv) to analyze my dataset?
Dear all,
I run the GAMs (generalized additive models) in gam(mgcv) using the
following codes.
m.gam
<-gam(mark~s(x)+s(y)+s(lstday2004)+s(ndvi2004)+s(slope)+s(elevation)+disbinary,family=binomial(logit),data=point)
And two repeated warnings appeared.
Warnings$B!'(B
1: In gam.fit(G, family = G$family, control = control, gamma = gamma, ... :
Algorithm did not converge
2: In gam.fit(G,
2012 Feb 03
1
GAM (mgcv) warning: matrix not positive definite
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 "matrix not positive
definite"
So my question is: Do I have to worry about those warnings and
2012 Oct 27
0
[gam] [mgcv] Question in integrating a eiker-white "sandwich" VCV estimator into GAM
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 ask whether it is possible
to do what I want to do using "canned" commands
2012 Aug 14
1
Random effects in gam (mgcv 1.7-19)
Hi,
I am using the gam function in the mgcv package, I have random effects in
my model (bs="re") this has worked fine, but after I updated the mgcv
package to version 1.7-19 I recive an error message when I run the model.
>
fit1<-gam(IV~s(RUTE,bs="re")+s(T13)+s(H40)+factor(AAR)+s(V3)+s(G1)+s(H1)+s(V1)+factor(LEDD),data=data5,method="ML")
> summary.gam(fit1)
2012 Jul 23
1
mgcv: Extract random effects from gam model
Hi everyone,
I can't figure out how to extract by-factor random effect adjustments from a
gam model (mgcv package).
Example (from ?gam.vcomp):
library(mgcv)
set.seed(3)
dat <- gamSim(1,n=400,dist="normal",scale=2)
a <- factor(sample(1:10,400,replace=TRUE))
b <- factor(sample(1:7,400,replace=TRUE))
Xa <- model.matrix(~a-1) ## random main effects
Xb <-
2007 Dec 13
1
Probelms on using gam(mgcv)
Dear all,
Following the help from gam(mgcv) help page, i tried to analyze my
dataset with all the default arguments. Unfortunately, it can't be run
successfully. I list the errors below.
#m.gam<-gam(mark~s(x,y)+s(lstday2004)+s(slope)+s(ndvi2004)+s(elevation)+s(disbinary),family=binomial(logit),data=point)
2010 Apr 13
0
Help in gam() in MGCV
Hello,
We have a question about how to retrieve the nonparametric curve in gam() function. Now, we get the estimates and draw the fitted curve using the following code. You can see that our fitted curve is parallel to the output from gam() function but differs by a constant shift. However, the magnitude of the shift is not the intercept term. Also, gam's estimate appears more close to the
2012 Mar 10
0
Help with confidence intervals for gam model using mgcv
Hi,
I would be very grateful for advice on getting confidence
intervals for the ordinary (non smoothed) parameter
estimates from a gam.
Motivation
I am studying hospital outcomes in a large data set. The
outcomes of interest to me are all binary variables. The one
in the example here, Dead30d, is death within 30 days of
admission. Sexf is gender (M or F), Age is age in years at
the start
2013 Jan 10
0
mgcv: Plotting probabilities for binomial GAM with crossed random intercepts and factor by variable
mgcv: Constructing probabilities for binomial GAM with crossed random
intercepts and factor by variable
Hello,
(I'm sorry if this has been discussed elsewhere; I may not have been
looking in the right places.)
I ran a binomial GAM in which "Correct" is modelled in terms of the
participant's age and the modality in which the stimulus is presented
(written vs spoken).
2011 Feb 16
1
retrieving partial residuals of gam fit (mgcv)
Dear list,
does anybody know whether there is a way to easily retrieve the so called "partial residuals" of a gam fit with package mgcv? The partial residuals are the residuals you would get if you would "leave out" a particular predictor and are the dots in the plots created by
plot(gam.object,residuals=TRUE)
residuals.gam() gives me whole model residuals and
2009 Mar 24
2
help: what are the basis functions in {mgcv}: gam?
I am writing my thesis with the function gam(), with the package {mgcv}.
My command is: gam(y~s(x1,bs="cr")+s(x2, bs="cr")).
I need help to know what are the default basis funcitons for gam. I have not
found any detailed reference for this.
Can anyone help me with this??
--
View this message in context:
2013 Dec 05
0
mgcv gam modeling trend variation over cases
Dear R-Helpers,
I posted two days ago on testing significance of random effects in mgcv,
but realize I did not make my overall purpose clear. I have a series of
N short time series, where N might range from 3-10 and short means a
median of 20 time points. The sample data below (PCP) has N = 4 cases
with 9, 13, 16 and 16 observations over time respectively. The data set
contains four
2003 May 26
0
knots fixed in gam(), library(mgcv)
Dear all,
I have a problem with specifying the no. of knots in our function which
include gam(). I last worked with this in mid September but since then I
have reinstalled R and Simon Wood's library(mgcv), which he has changed
since then. The statistician (and good R-coder) with whom I co-operate is
now unfortunately overloaded with teaching, and I'm in the sprut of my
thesis.... I
2011 Apr 11
0
Question about GAM (mgcv)
Dear list,
i'm using the GAM function from mgcv package. I'm using this syntax:
model=gam(y~offset(x)+s(log1p(x1))+s(log1p(x2))+s(x3)+s(x4)+s(5),family=quasipoisson,data=data)
and I'm sequentially dropping the single term with the highest
non-significant p-value from the model and re-fitting until all term are
significant. Now I have:
2005 Feb 27
1
prediction, gam, mgcv
I fitted a GAM model with Poisson distribution
using the function gam() in the mgcv package.
My model is of the form:
mod<-gam(y~s(x0)+s(x1)+s(x2),family=poisson).
To extract estimates at a specified set of covariate
values I used the gam `predict' method.
But I want to get
estimate and standard error of the difference of two fitted values.
Can someone explain what should I do?
Thank
2018 Jan 17
1
mgcv::gam is it possible to have a 'simple' product of 1-d smooths?
I am trying to test out several mgcv::gam models in a scalar-on-function regression analysis.
The following is the 'hierarchy' of models I would like to test:
(1) Y_i = a + integral[ X_i(t)*Beta(t) dt ]
(2) Y_i = a + integral[ F{X_i(t)}*Beta(t) dt ]
(3) Y_i = a + integral[ F{X_i(t),t} dt ]
equivalents for discrete data might be:
1) Y_i = a + sum_t[ L_t * X_it * Beta_t ]
(2) Y_i
2012 May 23
0
gam (mgcv) vs. multiple regression breakpoint analysis: inconsistencies?
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 of AOA before the
breakpoint (at a certain AOA) is different from the slope past the
2002 Jan 28
1
residuals in plot.gam (mgcv)
Is there a way to add residuals to plots produced by plot.gam in the mgcv
package? I'm looking for something like what you get using resid=T in Splus
plot.gam.
Thanks in advance
Toby
-----Original Message-----
From: Simon Wood [mailto:snw at mcs.st-and.ac.uk]
Sent: 23 January, 2002 8:14 PM
To: Toby.Patterson at csiro.au
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] multiple surfaces in