Displaying 17 results from an estimated 17 matches for "gam2".
Did you mean:
gam
2006 Mar 05
1
predicted values in mgcv gam
...x1 <- runif(n, 0, 1)
x2 <- runif(n, 0, 1)
x3 <- runif(n, 0, 1)
f0 <- function(x) 2 * sin(pi * x)
f1 <- function(x) exp(2 * x)
f2 <- function(x) 0.2*x^11*(10*(1-x))^6+10*(10*x)^3*(1-x)^10
f <- f0(x0) + f1(x1) + f2(x2)
g<-exp(f/4)
y<-rpois(rep(1,n),g)
mean.y <- mean(y)
gam2 <- gam(y~ s(x2), poisson)
# to plot on the response scale
val.for.pred <- data.frame(x2=seq(min(x2), max(x2), length.out=100))
pred.2.resp <- predict.gam(gam2, val.for.pred ,type="response",
se.fit=TRUE)
lower.band <- pred.2.resp$fit - 2*pred.2.resp$se.fit
upper.band <-...
2012 Jun 20
0
formula method with "special" characters
...)). I've checked and it seems this is
done through attr(,"specials"). However, the section of code below (as
an example extracted from the gam package) gives me an error as shown at
the end. Evidently I'm missing something here...any help is much
appreciated.
Thanks,
Leo.
"gam2.slist" <-
c("s", "lo", "random")
"gam2" <-
function(formula, family = gaussian, data,
weights, subset, na.action, start = NULL, etastart, mustart,
control = gam.control(...),
model = FALSE, method="glm.fit", x =...
2007 Apr 16
2
Dealing with data frame column names beginning with a numeric
...e to someone using R for Windows. (I myself use Linux.)
The way the data is organised makes it convenient to use the boxplot
function in a manner similar to this example given in the help.
> mat <- cbind(Uni05 = (1:100)/21, Norm = rnorm(100),
+ T5 = rt(100, df = 5), Gam2 = rgamma(100, shape = 2))
> boxplot(data.frame(mat), main = "boxplot(data.frame(mat), main = ...)")
If one of those columns had a numeric beginning to its name, such as:
> colnames(mat)[3] <- "5T"
and then using boxplot the same way, it will prepend an "X&q...
2002 Oct 08
2
sem (lisrel) - starting problems
...> 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:sex" "4:age" "5:loyalty"
latent variables:
[1] "6:...
2010 Aug 05
1
plot points using vis.gam
...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 3D plot.
Any help would be much appreciated
Monica
--
View this message in context: http://r.789695.n4.nabble.com/plot-points-using-vis-gam-tp2314926p2314926.html
Sent from the R help mailing list archive at Nabble.com.
2012 Dec 13
1
Difference between real and reported disk usage
...#39;m experiencing disk usage that is much higher on the
destination PC.
The origin samba server is Debian Lenny with samba 3.2.5.
The destination samba server is Debian Wheezy with samba 3.6.9
The PC running robocopy is Windows Server 2003 with robocopy XP026.
I'm copying from //gam/c$ to //gam2/c$. Either source and destination
shares are mounted on /smbshare on the corresponding PCs, ext3 the
former and ext4 the latter.
From gam (the source):
--------------------------
# du -s -h /smbshare/
45G /smbshare/
# du -s -h --apparent-size /smbshare/
45G /smbshare/
# df -h
Filesystem...
2009 Oct 13
1
vis.gam() contour plots
Greetings,
I have what I hope is a simple question. I would like to change my
contour interval on the vis.gam( plot.type="contour") in the mgcv
package. Is this a situation where I need to modify the function or is
there a default value I can change?
Thanks
2003 Jan 07
1
help interpreting output?
...8.3915 0.0037697
s(PSD) 1 6.0234 0.014118
s(OPD) 2.289 12.745 0.0024349
s(GED) 3.791 152.68 < 2.22e-16
R-sq.(adj) = 0.885 Deviance explained = 91.1%
GCV score = 2124.9 Scale est. = 1617.3 n = 60
________________
>summary.gam(mod.gam2)
Family: gaussian
Link function: identity
Formula:
INT ~ s(IGS) + s(L2E) + s(TED) + s(PSD) + s(OPD)
Parametric coefficients:
Estimate std. err. t ratio Pr(>|t|)
constant 302.32 4.736e-14 6.384e+15 < 2.22e-16
Approximate significance of smooth terms:...
2003 Jan 30
2
mgcv, gam
...on argument, but that not the
main point.
I want to have a smooth term for time over a year, the same pattern
repeating in succesive years. It would be natural then to impose
the condition s(0)=s(12). Is this possible within mgcv?
I tried to obtain this with trigonometric terms, aca:
> Rot.gam2 <- gam(cbind(Rotavirus,Total)~ s( I(sin((MesN/12)*2*pi)),
bs="cr" )+
+ s( I(cos((MesN/12)*2*pi)), bs="cr" ),
data=na.omit(Rot),
+ family=binomial)
Warning messages:
1: Termwise estimate degrees of freedom are unreliable
but this doe...
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...
...(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_mean_EVI <-> ALL_Jack1, theta2, NA
>de...
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
situation...
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
2012 Mar 23
0
Fixing error variance in a path analysis to model measurement error in scales using sem package
...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 -> em, iota1
power_alt...
2011 Nov 24
0
sem package (version 2.1-1)
...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 the Wheaton alientation model as
model.wh <- specifyEquations()
Anomia67 = 1...
2011 Nov 24
0
sem package (version 2.1-1)
...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 the Wheaton alientation model as
model.wh <- specifyEquations()
Anomia67 = 1...
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
2006 Mar 08
0
survival
...inst x where
\sum_i f(x_i)=0, and \alpha is an intercept parameter.
So the zero line on the first plot, corresponds to the \exp(\alpha) line
on the second plot (which is not the same as the mean of the response
data).
If you replace
> abline(h=mean.y,lty=5,col=grey(0.35))
by
> abline(h=coef(gam2)[1],lty=5,col=grey(0.35))
then everything should work.
best,
Simon
On Sun, 5 Mar 2006, Denis Chabot wrote:
> Hi,
>
> In fitting GAMs to assess environmental preferences, I use the part
> of the fit where the lower confidence interval is above zero as my
> criterion for positive as...