Hello, I am modeling some survival data wih cph (Design). I have modeled a predictor which showed non linear effect with restricted cubic splines. I would like to retrieve the se(coef) for other, linear, predictors. This is just to make nice LateX tables automatically. I have the coefficients with coef(). How do I do that? Thanks, David Biau. [[alternative HTML version deleted]]
On Aug 5, 2010, at 4:03 PM, Biau David wrote:> Hello, > > I am modeling some survival data wih cph (Design). I have modeled a > predictor > which showed non linear effect with restricted cubic splines. I > would like to > retrieve the se(coef) for other, linear, predictors.The cph object has a "var". The vcov function is an extractor function. You would probably be using something like: diag(vcov(fit))^(1/2)> This is just to make nice > LateX tables automatically.Are you sure Frank has not already programed that for you somewhere? Perhaps latex.cph?> I have the coefficients with coef(). > > How do I do that? > > Thanks, > > David Biau. >-- David Winsemius, MD West Hartford, CT
if the cph model fit is m1, you can try sqrt(diag(m1$var)) This is coded in print.cph.fit (library(rms)) On 08/05/2010 04:03 PM, Biau David wrote:> Hello, > > I am modeling some survival data wih cph (Design). I have modeled a predictor > which showed non linear effect with restricted cubic splines. I would like to > retrieve the se(coef) for other, linear, predictors. This is just to make nice > LateX tables automatically. I have the coefficients with coef(). > > How do I do that? > > Thanks, > > David Biau. > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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. >-- Abhijit Dasgupta, PhD Director and Principal Statistician ARAASTAT Ph: 301.385.3067 E: adasgupta at araastat.com W: http://www.araastat.com
In an upcoming release of the rms package, all fit objects can be printed using LaTeX if putting LaTeX code directly to the console (this is optimized for Sweave). You will be able to say print(fit, latex=TRUE). Frank E Harrell Jr Professor and Chairman School of Medicine Department of Biostatistics Vanderbilt University On Thu, 5 Aug 2010, David Winsemius wrote:> > On Aug 5, 2010, at 4:03 PM, Biau David wrote: > >> Hello, >> >> I am modeling some survival data wih cph (Design). I have modeled a >> predictor >> which showed non linear effect with restricted cubic splines. I >> would like to >> retrieve the se(coef) for other, linear, predictors. > > The cph object has a "var". The vcov function is an extractor > function. You would probably be using something like: > > diag(vcov(fit))^(1/2) > >> This is just to make nice >> LateX tables automatically. > > Are you sure Frank has not already programed that for you somewhere? > Perhaps latex.cph? > >> I have the coefficients with coef(). >> >> How do I do that? >> >> Thanks, >> >> David Biau. >> > > -- > > David Winsemius, MD > West Hartford, CT > > ______________________________________________ > R-help at 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. >