search for: gam1

Displaying 18 results from an estimated 18 matches for "gam1".

Did you mean: gam
2010 Jan 24
2
How to define degree=1 in mgcv
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. Hellen [[alternative HTML version...
2009 Dec 13
0
cross validation/GAM/package Daim
Dear r-helpers, I estimated a generalized additive model (GAM) using Hastie's package GAM. Example: gam1 <- gam(vegetation ~ s(slope), family = binomial, data=aufnahmen_0708, trace=TRUE) pred <- predict(gam1, type = "response") vegetation is a categorial, slope a numerical variable. Now I want to assess the accurancy of the model using k-fold cross validation. I found the package Da...
2011 Feb 04
1
GAM quasipoisson in MuMIn
...n help file. In MuMIn help they advise "include only models with smooth OR linear term (but not both) for each variable". Their example is: # Example with gam models (based on "example(gam)") require(mgcv) dat <- gamSim(1, n = 500, dist="poisson", scale=0.1) gam1 <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3) + (x1+x2+x3)^2, family = poisson, data = dat, method = "REML") cat(dQuote(getAllTerms(gam1)), "\n") # include only models with smooth OR linear term (but not both) for each variable: dd <- dredge(gam1, subset=(!`s(x1)`...
2011 Feb 04
0
GAM quasipoisson in MuMIn - SOLVED
...models with smooth OR linear term > (but not both) for each variable". Their example is: > > # Example with gam models (based on "example(gam)") > > require(mgcv) > > > > dat <- gamSim(1, n = 500, dist="poisson", scale=0.1) > > > > gam1 <- gam(y ~ s(x0) + s(x1) + s(x2) + s(x3) + (x1+x2+x3)^2, family = > poisson, data = dat, method = "REML") > > > > cat(dQuote(getAllTerms(gam1)), "\n") > > > > > > # include only models with smooth OR linear term (but not both) for each > va...
2002 Oct 08
2
sem (lisrel) - starting problems
...personcar','lamx22',NA, + 'loyalty -> satisfaction','lamy1',1, + 'compcar <-> personcar','beta',NA, + 'compcar -> loyalty','gam1',NA, + 'personcar -> loyalty','gam2',NA), + ncol=3, byrow=TRUE) $ $ $ $ sem.h <- sem(h.semModel,h.sem, 2802,debug=T) observed variables: [1] "1:nemploy" "2:sales" "3:s...
2009 Jul 12
1
variance explained by each predictor in GAM
Hi, I am using mgcv:gam and have developed a model with 5 smoothed predictors and one factor. gam1 <- gam(log.sp~ s(Spr.precip,bs="ts") + s(Win.precip,bs="ts") + s( Spr.Tmin,bs="ts") + s(P.sum.Tmin,bs="ts") + s( Win.Tmax,bs="ts") +factor(site),data=dat3) The total deviance explained = 70.4%. I would like to extract the variance explained...
2010 Aug 05
1
plot points using vis.gam
Hello, I'm trying to illustrate the relationships between various trait and environment data gathered from a number of sites. I've created a GAM to do this: gam1=gam(trait~s(env1)+s(env2)+te(env1,env2)) and I know how to create a 3D plot using vis.gam. I want to be able to show points on the 3D plot indicating the sites that the data came from. I can do this on a 2D plot when there is one term, e.g. gam2=gam(trait~s(env1)) but cannot figure it out for the...
2008 Aug 14
1
autocorrelation in gams
Hi, I am looking at the effects of two explanatory variables on chlorophyll. The data are an annual time-series (so are autocorrelated) and the relationships are non-linear. I want to account for autocorrelation in my model. The model I am trying to use is this: Library(mgcv) gam1 <-gam(Chl~s(wintersecchi)+s(SST),family=gaussian, na.action=na.omit, correlation=corAR1(form =~ Year)) the result I get is this: Family: gaussian Link function: identity Formula: CPRChl ~ s(wintersecchi) + s(SST) Parametric coefficients: Estimate Std. Error t v...
2010 Oct 25
1
structural equation modeling in sem, error, The model has negative degrees of freedom = -3, and The model is almost surely misspecified...
...70157 > ), ncol = 3, byrow = T) >rownames(S_matrix) = colnames(S_matrix) = c("dec_mean_EVI", "density", "ALL_Jack1") I then construct a model using a symbolic ram specification as follows >tmodel <- specify.model() >dec_mean_EVI -> density, gam1, NA >density -> ALL_Jack1, gam2, NA >dec_mean_EVI -> ALL_Jack1, gam3, NA >dec_mean_EVI <-> dec_mean_EVI, ps1, NA >density <-> density, ps2, NA >ALL_Jack1 <-> ALL_Jack1, theta1, NA >dec_mean_EVI <-> density, theta2, NA >dec...
2008 Jul 12
4
problem
Hi -- I just got your book FXRuby and am trying to get it working on Leopard -- I had no problems getting it to work on Vista or Ubuntu but when I tried to follow the post on your blog for Leopard I got the following error -- I don''t know enough about Leopard or Ruby for that matter to troubleshoot this myself so I was hoping someone may have run into this before and can offer a solution.
2007 Jun 27
1
SEM model fit
...<-> oicon1, theta11, 0.2 oicon2 <-> oicon2, theta12, 0.3 gender -> con, a5, 0.1 incomex -> con, a6, -0.1 oftdrnkr -> con, a7, -0.2 attn -> con, gam1, 0.2 sev -> aophys, NA, 1 sev -> mvphys, NA, 1 sev -> oiphys, NA, 1 sev <-> sev, psi6, 0.5 aophys <-> aophys, theta13, 0.5 mvphys &l...
2012 May 08
2
mgcv: inclusion of random intercept in model - based on p-value of smooth or anova?
...p-value s(Country) 36.127 58.551 0.644 0.982 Can I interpret this as there being no support for a random intercept for country? However, when I compare the simpler model to the model including the random intercept, the latter appears to be a significant improvement. > anova(gam1,gam2,test="F") Model 1: .... Model 2: .... + s(BirthNation, bs="re") Resid. Df Resid. Dev Df Deviance F Pr(>F) 1 789.44 416.54 2 753.15 373.54 36.292 43.003 2.3891 1.225e-05 *** I hope somebody could help me in how I should proceed in these situ...
2006 Aug 22
1
Total (un)standardized effects in SEM?
Hi there, as a student sociology, I'm starting to learn about SEM. The course I follow is based on LISREL, but I want to use the SEM-package on R parallel to it. Using LISREL, I found it to be very usable to be able to see the total direct and total indirect effects (standardized and unstandardized) in the output. Can I create these effects using R? I know how to calculate them
2010 Mar 04
2
which coefficients for a gam(mgcv) model equation?
Dear users, I am trying to show the equation (including coefficients from the model estimates) for a gam model but do not understand how to. Slide 7 from one of the authors presentations (gam-theory.pdf URL: http://people.bath.ac.uk/sw283/mgcv/) shows a general equation log{E(yi )} = ?+ ?xi + f (zi ) . What I would like to do is put my model coefficients and present the equation used. I am an
2012 Mar 23
0
Fixing error variance in a path analysis to model measurement error in scales using sem package
...ch's alpha, which is a measure of reliability. What follows is the following path analysis model in theory (i.e., in practice the formulas are replaced with actual numbers): path.inf.final <- specifyModel() pRU -> sRU, test1 pRU -> rRU, test2 sRU -> rRU, test3 sRU -> power_alt, gam1 pRU -> power_alt, gam2 rRU -> power_alt, gam3 sRU -> ms_alt, gam7 pRU -> ms_alt, gam8 rRU -> ms_alt, gam9 sRU <-> sRU, NA, (1 - alpha(sRU))*(variance(sRU)) pRU <-> pRU, NA, (1 - alpha(pRU))*(variance(pRU)) rRU <-> rRU, NA, (1 - alpha(rRU))*(variance(rRU)) power_alt...
2011 Nov 24
0
sem package (version 2.1-1)
...ather than path) format, and cfa() facilitates compact specification of simple confirmatory factor analysis models. For example, from ?sem, the Duncan, Haller, and Portes peer-influences model can now be specified as model.dhp.1 <- specifyEquations(covs="RGenAsp, FGenAsp") RGenAsp = gam11*RParAsp + gam12*RIQ + gam13*RSES + gam14*FSES + beta12*FGenAsp FGenAsp = gam23*RSES + gam24*FSES + gam25*FIQ + gam26*FParAsp + beta21*RGenAsp ROccAsp = 1*RGenAsp REdAsp = lam21(1)*RGenAsp # to illustrate setting start values, not necessary here FOccAsp = 1*FGenAsp FEdAsp = lam42(1)*FGenAsp and t...
2011 Nov 24
0
sem package (version 2.1-1)
...ather than path) format, and cfa() facilitates compact specification of simple confirmatory factor analysis models. For example, from ?sem, the Duncan, Haller, and Portes peer-influences model can now be specified as model.dhp.1 <- specifyEquations(covs="RGenAsp, FGenAsp") RGenAsp = gam11*RParAsp + gam12*RIQ + gam13*RSES + gam14*FSES + beta12*FGenAsp FGenAsp = gam23*RSES + gam24*FSES + gam25*FIQ + gam26*FParAsp + beta21*RGenAsp ROccAsp = 1*RGenAsp REdAsp = lam21(1)*RGenAsp # to illustrate setting start values, not necessary here FOccAsp = 1*FGenAsp FEdAsp = lam42(1)*FGenAsp and t...
2001 Nov 25
2
another optimization question
Dear R list members, Since today seems to be the day for optimization questions, I have one that has been puzzling me: I've been doing some work on sem, my structural-equation modelling package. The models that the sem function in this package fits are essentially parametrizations of the multinormal distribution. The function uses optim and nlm sequentially to maximize a multinormal