[R] pdIdent in smoothing regression model

2011-10-09 Thread Lei Liu
~-1+X,random=pdIdent(~-1+Z)) I got an error message: Error in getGroups.data.frame(dataMix, groups) : Invalid formula for groups I was really puzzled. I asked Dr. Ngo and he said they did it in S-plus but not R. Does anyone knows how to do it in R? Thanks! Lei Liu Associate Professor Division of B

[R] 2 questions on matrix manipulation in R

2011-08-07 Thread Lei Liu
. Can I do it without using "for" loop? Thanks a lot! Lei Liu Associate Professor Division of Biostatistics Department of Public Health Sciences University of Virginia School of Medicine http://people.virginia.edu/~ll9f/ __ R-help@r-proj

[R] multi-dimensional Gaussian quadrature

2011-08-04 Thread Lei Liu
Hi there, Does anyone know if there is a package in R for multi-demensional Gaussian quadrature? I checked out the package "gaussquad" but it can only do 1D. Thanks! Lei Liu Associate Professor Division of Biostatistics Department of Public Health Sciences University of Virginia

[R] How to install "adapt" package

2011-07-29 Thread Lei Liu
nstall it using "install packages from local zip files". I also tried to unzip these files in R library directory. But still I couldn't load the package in R. Is there any way to install this package? Thanks! Lei Liu Associate Professor Division of Biostatistics Department of Publi

[R] help on pspline in coxph

2011-04-06 Thread Lei Liu
-09 My question is how to extract the linear coefficient (0.495) in pspline(data.tr[, 3]). I tried coef(fit) but it fails to display this term. Your help is greatly appreciated! Lei Liu Associate Professor Division of Biostatistics and Epidemiology Department of Public Health Sciences University

[R] trajectory plot (growth curve)

2010-08-23 Thread Lei Liu
the y axis, and time in the x axis. I would like to have all growth curves in the same plot. Is there a simple way in R to do it? Thanks a lot! Lei Liu Associate Professor Division of Biostatistics and Epidemiology Department of Public Health Sciences University of Virginia School of Medicine

[R] a question in coxph

2009-11-08 Thread Lei Liu
Hi there, I tried to fit a penalized spline for a continuous risk factor in recurrent events data. I found that I can include both pspline and frailty terms in coxph. So I use code like fit1 <- coxph(Surv(start, end, event)~pspline(age, df=0) + male + white +frailty(id), data.all) It yie

[R] package to do inverse probability weighting in longitudinal data

2009-07-17 Thread Lei Liu
Hi there, I have a dataset from a longitudinal study with a lot of drop-out. I want to implement the inverse probability weighting method by Robins 1995 JASA paper "Analysis of semiparametric regression models for repeated outcomes in the presence of missing data". Does anyone know if there i

[R] a question on matrix manipulation

2009-06-16 Thread Lei Liu
Hi there, I have a question on manipulating a matrix. Say I have a matrix A with 3 rows. I want to generate a new matrix B with 3 duplicates of the first row of A, 2 duplicates of the second row, and 4 duplicates of the third row. So B is a matrix with 9 rows. Or more general, I want to gener