[R] Question about splines in R

2010-10-04 Thread Yan Li
Dear all, I wanted to fit a penalized logistic model to obtain knots-based basis matrix as well as basis coefficients. I was wondering if there is a package in R that can generate a natural cubic spline and construct the corresponding penalty matrix? Thank you! Yan _

[R] a question about mgcv package

2010-09-26 Thread Yan Li
Dear all, I have a question about the basis functions of cubic regression spline in mgcv. Are there some ways I can get the exact forms of the basis functions and the penalty matrix that are used in the mgcv package? Thanks in advance! Yan PS. Sorry for sending this message twice. The header

[R] Basis functions of cubic regression spline in mgcv

2010-09-26 Thread Yan Li
I have a question about the basis functions of cubic regression spline in mgcv. Are there some ways I can get the exact forms of the basis functions and the penalty matrix that are used in mgcv? Thanks in advance! Yan [[alternative HTML version deleted]] ___

[R] A problem in allocation of vector of size

2010-05-18 Thread Yan Li
Hi, r-users I happen to a problem in allocation of vector of size. When I run my R script, an error appears: Error: cannot allocate vector of size 450 Mb Could anyone happen to the same problem? Thank you for your help. Lee [[alternative HTML version deleted]]

[R] How to get the penalty matrix for natural cubic spline?

2010-04-08 Thread Yan Li
Hi, all I am trying to get the basis matrix and penalty matrix for natural cubic splines. In the "splines" package of R,"ns" can generate the B-spline basis matrix for a natural cubic spline. How can I get the basis matrix and penalty matrix for natural cubic spline. Thanks a lot! Lee [

[R] How to choose a proper smoothing spline in GAM of mgcv package?

2009-10-12 Thread Yan Li
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. I used "cr" in one covariate, but it can only smooth w.r.t 1 covari

[R] mvmeta function in GAP package

2009-09-30 Thread Yan Li
Hi, I am using mvmeta function in GAP package. Could you please tell me the algorithm applied in this function and the relevant references? Thanks. Lee [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.eth

[R] How to choose knots for GAM?

2009-09-20 Thread Yan Li
Hi, all I want to choose same knots in GAM for 10 different studies so that they has the same basis function. Even though I choose same knots and same dimensions of basis smoothing, the basis representations are still not same. My command is as follows: data.gam<-gam(y~s(age,bs='cr',k=10)+male,f

[R] Why residual=T doesn't work in plot.gam?

2009-09-18 Thread Yan Li
Hi, all In mgcv package, I tried to plot data.gam. However, residuals=TRUE doesn't work for my data. No data points appear on the plot. What is the reason? The number of the observation of my data set is almost 2000. plot(data.gam,residuals=TRUE,shade=TRUE) Thank you, Lee [[alternative

[R] Multivariate Meta-analysis

2009-09-14 Thread Yan Li
Hi, all I happen to a question about multivariate meta-analysis. I found the function of mvmeta in gap package, but I don't know for sure how to construct a covariance matrix. Now, I have 20 studies, each having 6 coefficients for the basis functions from an additive model. I can extract the covar

[R] How to specify knots and knots boundary in GAM

2009-09-13 Thread Yan Li
Dear all, I have 10 studies. I want to fit a generalized additive model for each of 8 studies. For combining the results from 10 studies, I have to specify the same knots (30,40,50,60,70,80,90) and knots boundary, 20 and 100, in gam(mgcv). Now I just found knots= option in the gam function, so I a