On Oct 12, 2009, at 10:10 PM, Yan Li wrote:

Hi, there,

I have 5 datasets. I would like to choose a basis spline with same knots in
GAM function in order to obtain same basis function for 5 datasets.
Moreover, the basis spline is used to for an interaction of two covarites.

It is possible to specify the knots for cr splines in the gam function (... not GAM). You have not described the sampling process that resulted in these 5 datasets, but the naive approach would be to cbind them and estimate for the super-group as a whole. After finding knots for a pooled dataset you could perhaps refit individually with the knots being fixed at the group values, assuming this makes sense for you sampling design.

I used "cr" in one covariate, but it can only smooth w.r.t 1 covariate. Can anyone give me some suggestion about how to choose a proper smoothing spline
(bs='?') and knots for two covariates?

Multiple terms in the model require vectors for the argument to sp or else inclusion within each smoothing term. See the docs and examples in:

library(mgcv)
?gam

Have you yet looked at:

?te

--

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to