similar to: A question about using “by” in GAM model fitting of interaction between smooth terms and factor

Displaying 20 results from an estimated 1000 matches similar to: "A question about using “by” in GAM model fitting of interaction between smooth terms and factor"

2009 Apr 28
2
Why there is no p-value from likelihood ratio test using anova in GAM model fitting?
Hello, everybody, There is the first time for me to post a question, because I really cannot find answer from books, websites or my colleagues. Thank you in advance for your help! I am running likelihood ratio test to find if the simpler model is not significant from more complicated model. However, when I run LRT to compare them, the test did not return F value and p-value for me. What's the
2009 Feb 23
1
"autonumber" for grouping variable
Dear R users, my dataframe looks like this head(dat) Id sex byear age 1 300 m 2003 50 2 300 m 2003 36 3 402 f 2003 29 4 402 f 2003 21 5 402 f 2003 64 6 150 m 2005 43 ... ...(where Id is just the Identification number of Individual, sex (male or female), byear (=birthyear)) now, I 'd like to add a column, where each Individual gets an automated number starting
2011 Nov 17
1
how to read a free text file into individual variables
hi ,I am writing a soft package based on R. But when I try to read a configure file showed as below. How can I read the parameter in this text file. How can I read the parameter into each variable in this file ? configinfo<-scan(file(configfile),ok=TRUE,n=-1) scan seems need every line have same column ? configinfo <- readLines(configfile,ok=TRUE,n=-1) methodnum <-
2009 Aug 16
1
How to deal with multicollinearity in mixed models (with lmer)?
Dear R users, I have a problem with multicollinearity in mixed models and I am using lmer in package lme4. From previous mailing list, I learn of a reply "http://www.mail-archive.com/r-help at stat.math.ethz.ch/msg38537.html" which states that if not for interpretation but just for prediction, multicollinearity does not matter much. However, I am using mixed model to interpret something,
2008 Jun 05
1
Smooth Spline
Hi, I have three original curves as follows, n<-seq(20,200,by=10) t<-c(0.1138, 0.1639, 0.2051, 0.2473, 0.2890, 0.3304, 0.3827, 0.4075, 0.4618, 0.4944, 0.5209, 0.5562, 0.5935, 0.6197, 0.6523, 0.6771, 0.6984, 0.7209, 0.7453) es<-c(0.3682, 0.4268, 0.5585, 0.6095, 0.7023, 0.7534, 0.8225, 0.8471, 0.8964, 0.9098, 0.9371, 0.9514, 0.9685, 0.9747, 0.9812, 0.9859, 0.9905, 0.9923, 0.9940)
2007 Sep 06
1
smooth functions
Hi , I am trying to get the estimate of smooth functions from a gam model by in the library(gam). What I get by constructing this model below are " edf. values ...and p-values" for the smooths functions and intercept. model <- gam(y~ s(height)+ s(weight)+s(time)+s(pol)) and I also get the smoothing parameters estimation by typing coef(model). The difficulty I am having
2010 Sep 08
1
pairs and panel.smooth for two groups
Hi, I have modified the USJudgeRatings data (available in R) to illustrate my question. # Use the first 4 variables of USJudgeRatings and add a group variable with two levels USJudgeRatings <- USJudgeRatings[,1:4] USJudgeRatings$group <- factor(c(rep(1, 22), rep(0, 21))) # I can draw a pairs graph where members of each group are drawn in different colors: pairs(USJudgeRatings[,1:4], col
2012 May 08
2
mgcv: inclusion of random intercept in model - based on p-value of smooth or anova?
Dear useRs, I am using mgcv version 1.7-16. When I create a model with a few non-linear terms and a random intercept for (in my case) country using s(Country,bs="re"), the representative line in my model (i.e. approximate significance of smooth terms) for the random intercept reads: edf Ref.df F p-value s(Country) 36.127 58.551 0.644
2011 Oct 21
1
lattice::xyplot/ggplot2: plotting weighted data frames with lmline and smooth
In the HistData package, I have a data frame, PearsonLee, containing observations on heights of parent and child, in weighted form: library(HistData) > str(PearsonLee) 'data.frame': 746 obs. of 6 variables: $ child : num 59.5 59.5 59.5 60.5 60.5 61.5 61.5 61.5 61.5 61.5 ... $ parent : num 62.5 63.5 64.5 62.5 66.5 59.5 60.5 62.5 63.5 64.5 ... $ frequency: num 0.5 0.5
2010 Aug 05
2
compare gam fits
Hi folks, I originally tried R-SIG-Mixed-Models for this one (https://stat.ethz.ch/pipermail/r-sig-mixed-models/2010q3/004170.html), but I think that the final steps to a solution aren't mixed-model specific, so I thought I'd ask my final questions here. I used gamm4 to fit a generalized additive mixed model to data from a AxBxC design, where A is a random effect (human participants in
2005 Apr 13
0
GAMM in mgcv - significance of smooth terms
In the summary of the gam object produced by gamm, the "Approximate significance of smooth terms" appears to be a test of the improvement in fit over a linear model, rather than a test of the significance of the overall effect of x on y: test.gamm<-gamm(y~te(x, bs="cr"), random=list(grp=~1)) summary(test.gamm$gam) . . . Approximate significance of smooth terms:
2007 Apr 16
1
Does the smooth terms in GAM have a functional form?
Hi, all, Does anyone know how to get the functional form of the smooth terms in GAM? eg. I fit y=a+b*s(x) where s is the smooth function. After fitting this model with GAM in R, I want to know the form of the s(x). Any suggestion is appreciated. Thanks, Jin --------------------------------- Ahhh...imagining that irresistible "new car" smell?
2005 Sep 23
1
Smooth terms significance in GAM models
hi, i'm using gam() function from package mgcv with default option (edf estimated by GCV). >G=gam(y ~ s(x0, k = 5) + s(x1) + s(x2, k = 3)) >SG=summary(G) Formula: y ~ +s(x0, k = 5) + s(x1) + s(x2, k = 3) Parametric coefficients: Estimate std. err. t ratio Pr(>|t|) (Intercept) 3.462e+07 1.965e+05 176.2 < 2.22e-16 Approximate significance of smooth
2013 Jul 19
0
mgcv: Impose monotonicity constraint on single or more smooth terms
Dear R help list, This is a long post so apologies in advance. I am estimating a model with the mgcv package, which has several covariates both linear and smooth terms. For 1 or 2 of these smooth terms, I "know" that the truth is monotonic and downward sloping. I am aware that a new package "scam" exists for this kind of thing, but I am in the unfortunate situation that I am
2009 Aug 24
2
Formulas in gam function of mgcv package
Dear R-experts, I have a question on the formulas used in the gam function of the mgcv package. I am trying to understand the relationships between: y~s(x1)+s(x2)+s(x3)+s(x4) and y~s(x1,x2,x3,x4) Does the latter contain the former? what about the smoothers of all interaction terms? I have (tried to) read the manual pages of gam, formula.gam, smooth.terms, linear.functional.terms but
2009 Aug 24
2
Formulas in gam function of mgcv package
Dear R-experts, I have a question on the formulas used in the gam function of the mgcv package. I am trying to understand the relationships between: y~s(x1)+s(x2)+s(x3)+s(x4) and y~s(x1,x2,x3,x4) Does the latter contain the former? what about the smoothers of all interaction terms? I have (tried to) read the manual pages of gam, formula.gam, smooth.terms, linear.functional.terms but
2006 Nov 07
1
gamm(): nested tensor product smooths
I'd like to compare tests based on the mixed model representation of additive models, testing among others y=f(x1)+f(x2) vs y=f(x1)+f(x2)+f(x1,x2) (testing for additivity) In mixed model representation, where X represents the unpenalized part of the spline functions and Z the "wiggly" parts, this would be: y=X%*%beta+ Z_1%*%b_1+ Z_2%*%b_2 vs y=X%*%beta+ Z_1%*%b_1+ Z_2%*%b_2 + Z_12
2011 Mar 23
1
how to add in interaction terms in gamm
I want to use gamm to generate smoothed trend line for three groups identified by dummy variable genea and geneb. My question is how to add in an interaction term between the time and another dummy variable such as gender? fitm<-gamm(change_gfr~ genea+geneb+s(timea_n,bs="ps")+s(timeb_n,bs="ps")+s(timec_n,bs="ps"),data=mm,random=list(time_n=~1|PID)) -- View this
2009 Mar 01
2
smoothing a matrix (interpolate in plane)
Hi R-users, I'd like to smooth a matrix to dismiss spikes and to interpolate in plane example of a matrix: Map[1:3,1:3] [,1] [,2] [,3]... [1,] 34.4 34.2 35.1 [2,] 33.4 34.2 35.4 [3,] 34.1 33.2 32.1 .... dim(Map)[1] =/= dim(Map)[2] What functions can I use? Thanks a lot for any response, M [[alternative HTML version deleted]]
2010 May 28
4
Matrix interesting question!
hi, I have been trying to do this in R (have implemented it in Excel) but I have been using a very inefficent way (loops etc.). I have matrix A (columns are years and ages are rows) and matrix B (columns are birth yrs and rows are ages) I would like to first turn matrix A into matrix B And then I would like to convert matrix B back again to the original matrix A. (I have left out details of