Displaying 20 results from an estimated 10000 matches similar to: "Random effects in package mgcv"
2018 Jan 11
2
setting constraints on gam
I am fitting a model in which the response variable y is a function of
two independent, quantitative variables x1 and x2; thus: y = f(x1,
x2). For reasons I do not believe to be important for the purpose of
this post, I find it desirable to find f by means of GAM; also, I
require principal effects and interactions to be specified separately,
so I am using using te and ti tensors. Thus, I am using
2012 Apr 23
2
Problem extracting enough coefs from gam (mgcv package)
Dear useRs,
I have used using the excellent mgcv package (version 1.7-12) to
create a generalized additive model (gam) including random effects -
represented with s(...,bs="re") - on the basis of dialect data.
My model contains two random-effect factors (Word and Key - the latter
representing a speaker) and I have added both random intercepts and
various random slopes for these
2017 Dec 14
1
GAM Poisson
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) + factor(year) + s(x),
data=data,na.action=na.omit)
# Poisson
m2 <- gam(count ~ factor(city)
2018 Jan 12
0
setting constraints on gam
There probably is a way, but it involves some programming. You would
need to clone a smooth constructor (e.g. for the "cr" class), and then
modify it to add a linear constraint matrix C to the returned smooth
object. If b are the smooth coefficients then C should? be the matrix
such that s(0) = Cb (you can get this from the Predict.matrix method for
the class). Then the constraint
2018 Jan 12
1
setting constraints on gam
Thanks Simon, by cloning a smooth construct do you mean copying and
modifying the smooth constructor code? Could you pleas elaborate on
your answer? Which is the Predict.matrix method?
2018-01-12 3:20 GMT-06:00 Simon Wood <simon.wood at bath.edu>:
> There probably is a way, but it involves some programming. You would need to
> clone a smooth constructor (e.g. for the "cr"
2013 Jun 07
1
gamm in mgcv random effect significance
Dear R-helpers,
I'd like to understand how to test the statistical significance of a
random effect in gamm. I am using gamm because I want to test a model
with an AR(1) error structure, and it is my understanding neither gam
nor gamm4 will do the latter.
The data set includes nine short interrupted time series (single case
designs in education, sometimes called N-of-1 trials in medicine)
2011 Nov 09
2
Problem with simple random slope in gam and bam (mgcv package)
Dear useRs,
This is the first time I post to this list and I would appreciate any
help available. I've used the excellent mgcv package for a while now
to investigate geographical patterns of language variation, and it has
has always worked without any problems for me. The problem below
occurs using R 2.14.0 (both 32 and 64 bit versions in Windows and the
64 bit version in Unix) and mgcv (both
2011 Jun 24
2
mgcv:gamm: predict to reflect random s() effects?
Dear useRs,
I am using the gamm function in the mgcv package to model a smooth relationship between a covariate and my dependent variable, while allowing for quantification of the subjectwise variability in the smooths. What I would like to do is to make subjectwise predictions for plotting purposes which account for the random smooth components of the fit.
An example. (sessionInfo() is at
2010 Jun 27
1
mgcv out of memory
Hello, I am trying to update the mgcv package on my Linux box and I keep
getting an "Out of memory!" error. Does anyone know of a fix for this?
Below is a snippet of the message that I keep getting: Thank you. Geoff
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
>>> Building/Updating help pages for package 'mgcv'
Formats:
2013 Jul 08
1
error in "predict.gam" used with "bam"
Hello everyone.
I am doing a logistic gam (package mgcv) on a pretty large dataframe
(130.000 cases with 100 variables).
Because of that, the gam is fitted on a random subset of 10000. Now when I
want to predict the values for the rest of the data, I get the following
error:
> gam.basis_alleakti.1.pr=predict(gam.basis_alleakti.1,
+
2012 Jan 30
1
mgcv bam() with grouped binomial data
Hello,
I'm trying to use the bam() function in the R mgcv package for a large set of grouped binary data. However, I have found that this function does not take data in the format of cbind(numerator, denominator) on the left hand side of the formula. As an example, consider the following
dat1 <- data.frame(id=rep(1:6, each=3), num=rbinom(18, size=10, prob=0.8), den=rbinom(18, size=5,
2012 Jun 02
2
mgcv (bam) very large standard error difference between versions 1.7-11 and 1.7-17, bug?
Dear useRs,
I reran an analysis with bam (mgcv, version 1.7-17) originally
conducted using an older version of bam (mgcv, version 1.7-11) and
this resulted in the same estimates, but much lower standard errors
(in some cases 20 times as low) and lower p-values. This obviously
results in a larger set of significant predictors. Is this result
expected given the improvements in the new version? Or
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)
2006 Dec 04
1
package mgcv, command gamm
Hi
I am an engineer and am running the package mgcv and specifically the
command gamm (generalized additive mixed modelling), with random
effects. i have a few queries:
1. When I run the command with 1000/2000 observations, it runs ok.
However, I would like to see the results as in vis.gam command in the
same package, with the 3-d visuals. It appears no such option is
available for gamm in the
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
2012 Apr 25
1
random effects in library mgcv
Hi,
I am working with gam models in the mgcv library. My response variable (Y) is binary (0/1), and my dataset contains repeated measures over 110 individuals (same number of 0/1 within a given individual: e.g. 345-zero and 345-one for individual A, 226-zero and 226-one for individual B, etc.). The variable Factor is separating the individuals in three groups according to mass (group 0,1,2),
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
2010 Jun 16
3
mgcv, testing gamm vs lme, which degrees of freedom?
Dear all,
I am using the "mgcv" package by Simon Wood to estimate an additive mixed
model in which I assume normal distribution for the residuals. I would
like to test this model vs a standard parametric mixed model, such as the
ones which are possible to estimate with "lme".
Since the smoothing splines can be written as random effects, is it
correct to use an (approximate)
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 Jan 16
2
Object not found using GAMs in MGCV Package
This is my first time running GAMs in R.
My csv file has these column headings:
"X" "Y" "Sound" "Atlantic" "Blacktip" "Bonnet"
"Bull" "Finetooth" "Lemon" "Scalloped" "Sandbar" "Spinner"
"Abundance" "Diversity"