similar to: anova with gam?

Displaying 20 results from an estimated 10000 matches similar to: "anova with gam?"

2009 Jul 28
2
A hiccup when using anova on gam() fits.
I stumbled across a mild glitch when trying to compare the result of gam() fitting with the result of lm() fitting. The following code demonstrates the problem: library(gam) x <- rep(1:10,10) set.seed(42) y <- rnorm(100) fit1 <- lm(y~x) fit2 <- gam(y~lo(x)) fit3 <- lm(y~factor(x)) print(anova(fit1,fit2)) # No worries. print(anova(fit1,fit3)) # Likewise. print(anova(fit2,fit3)) #
2013 Apr 17
1
mgcv: how select significant predictor vars when using gam(...select=TRUE) using automatic optimization
I have 11 possible predictor variables and use them to model quite a few target variables. In search for a consistent manner and possibly non-manual manner to identify the significant predictor vars out of the eleven I thought the option "select=T" might do. Example: (here only 4 pedictors) first is vanilla with "select=F" >
2011 Jun 15
0
specifying interactions in a gam model with "by"
I?m confused by the difference in the fit of a gam model (in package mgcv) when I specify an interaction in different ways. I would appreciate it if someone could explain the cause of these differences. For example: x <- c(105, 124, 124, 124, 144, 144, 150, 176, 178, 178, 206, 206, 212, 215, 215, 227, 229, 229, 229, 234, 234, 254, 254, 290, 290, 303, 334, 334, 334, 344,
2011 Oct 06
1
anova.rq {quantreg) - Why do different level of nesting changes the P values?!
Hello dear R help members. I am trying to understand the anova.rq, and I am finding something which I can not explain (is it a bug?!): The example is for when we have 3 nested models. I run the anova once on the two models, and again on the three models. I expect that the p.value for the comparison of model 1 and model 2 would remain the same, whether or not I add a third model to be compared
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)
2011 Mar 28
2
mgcv gam predict problem
Hello I'm using function gam from package mgcv to fit splines. ?When I try to make a prediction slightly beyond the original 'x' range, I get this error: > A = runif(50,1,149) > B = sqrt(A) + rnorm(50) > range(A) [1] 3.289136 145.342961 > > > fit1 = gam(B ~ s(A, bs="ps"), outer.ok=TRUE) > predict(fit1, newdata=data.frame(A=149.9), outer.ok=TRUE) Error
2005 Jun 15
1
anova.lme error
Hi, I am working with R version 2.1.0, and I seem to have run into what looks like a bug. I get the same error message when I run R on Windows as well as when I run it on Linux. When I call anova to do a LR test from inside a function, I get an error. The same call works outside of a function. It appears to not find the right environment when called from inside a function. I have provided
2007 Jun 21
1
Result depends on order of factors in unbalanced designs (lme, anova)?
Dear R-Community! For example I have a study with 4 treatment groups (10 subjects per group) and 4 visits. Additionally, the gender is taken into account. I think - and hope this is a goog idea (!) - this data can be analysed using lme as below. In a balanced design everything is fine, but in an unbalanced design there are differences depending on fitting y~visit*treat*gender or
2011 Dec 05
1
about interpretation of anova results...
quantreg package is used. *fit1 results are* Call: rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9, tau = 0.15, data = wbc) Coefficients: (Intercept) inp1 inp2 inp3 inp4 inp5 -0.191528450 0.005276347 0.021414032 0.016034803 0.007510343 0.005276347 inp6 inp7 inp8 inp9 0.058708544
2011 Sep 07
2
reporting ANOVA for nested models
I have the following results for an ANOVA comparing two nested models. I wasn't sure how I am supposed to report this result in the area of psychology. Specifically, am I supposed to report the DF's or just the F ratio? I could manually calculate the degrees of freedoms, but there must be a reason why R does not give this information, i.e. those are not conventionally used in the
2011 May 08
1
anova.lm fails with test="Cp"
Here is an example, modified from the help page to use test="Cp": -------------------------------------------------------------------------------- > fit0 <- lm(sr ~ 1, data = LifeCycleSavings) > fit1 <- update(fit0, . ~ . + pop15) > fit2 <- update(fit1, . ~ . + pop75) > anova(fit0, fit1, fit2, test="Cp") Error in `[.data.frame`(table, , "Resid.
2011 Mar 25
2
A question on glmnet analysis
Hi, I am trying to do logistic regression for data of 104 patients, which have one outcome (yes or no) and 15 variables (9 categorical factors [yes or no] and 6 continuous variables). Number of yes outcome is 25. Twenty-five events and 15 variables mean events per variable is much less than 10. Therefore, I tried to analyze the data with penalized regression method. I would like please some of the
2008 Jan 05
1
Likelihood ratio test for proportional odds logistic regression
Hi, I want to do a global likelihood ratio test for the proportional odds logistic regression model and am unsure how to go about it. I am using the polr() function in library(MASS). 1. Is the p-value from the likelihood ratio test obtained by anova(fit1,fit2), where fit1 is the polr model with only the intercept and fit2 is the full polr model (refer to example below)? So in the case of the
2017 Dec 20
1
Nonlinear regression
You also need to reply-all so the mailing list stays in the loop. -- Sent from my phone. Please excuse my brevity. On December 19, 2017 4:00:29 PM PST, Timothy Axberg <axbergtimothy at gmail.com> wrote: >Sorry about that. Here is the code typed directly on the email. > >qe = (Qmax * Kl * ce) / (1 + Kl * ce) > >##The data >ce <- c(15.17, 42.15, 69.12, 237.7, 419.77)
2004 Jun 11
1
comparing regression slopes
Dear List, I used rlm to calculate two regression models for two data sets (rlm due to two outlying values in one of the data sets). Now I want to compare the two regression slopes. I came across some R-code of Spencer Graves in reply to a similar problem: http://www.mail-archive.com/r-help at stat.math.ethz.ch/msg06666.html The code was: > df1 <- data.frame(x=1:10, y=1:10+rnorm(10))
2003 Nov 25
1
using pdMAT in the lme function?
Hello. I want to specify a diagonal structure for the covariance matrix of random effects in the lme() function. Here is the call before I specify a diagonal structure: > fit2<-lme(Ln.rgr~I(Ln.nar-log(0.0011)),data=meta.analysis, + random=~1+I(Ln.nar-log(0.0011)|STUDY.CODE,na.action=na.omit) and this works fine. Now, I want to fix the covariance between the between-groups slopes
2004 Dec 20
2
problems with limma
I try to send this message To Gordon Smyth at smyth at vehi,edu.au but it bounced back, so here it is to r-help I am trying to use limma, just downloaded it from CRAN. I use R 2.0.1 on Win XP see the following: > library(RODBC) > chan1 <- odbcConnectExcel("D:/Data/mgc/Chips/Chips4.xls") > dd <- sqlFetch(chan1,"Raw") # all data 12000 > # > nzw <-
2009 Apr 08
2
Null-Hypothesis
Hello R users, I've used the following help two compare two regression line slopes. Wanted to test if they differ significantly: Hi, I've made a research about how to compare two regression line slopes (of y versus x for 2 groups, "group" being a factor ) using R. I knew the method based on the following statement : t = (b1 - b2) / sb1,b2 where b1 and b2 are the two slope
2008 Apr 17
1
survreg() with frailty
Dear R-users, I have noticed small discrepencies in the reported estimate of the variance of the frailty by the print method for survreg() and the 'theta' component included in the object fit: # Examples in R-2.6.2 for Windows library(survival) # version 2.34-1 (2008-03-31) # discrepancy fit1 <- survreg(Surv(time, status) ~ rx + frailty(litter), rats) fit1 fit1$history[[1]]$theta
2011 Jan 26
2
Extracting the terms from an rpart object
Hello all, I wish to extract the terms from an rpart object. Specifically, I would like to be able to know what is the response variable (so I could do some manipulation on it). But in general, such a method for rpart will also need to handle a "." case (see fit2) Here are two simple examples: fit1 <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) fit1$call fit2 <-