[R] latex.rms and models fit with GLS

Frank E Harrell Jr f.harrell at Vanderbilt.Edu
Fri May 28 23:28:09 CEST 2010


On 05/28/2010 03:49 PM, Dylan Beaudette wrote:
> Hi,
>
> I have fit a model using the rms package with the Gls() function.
>
> Is there a way to get the model estimates, std errors, and p-values (i.e. what
> you get with print(fit)) into latex format?
>
> I have tried:
>
> f<- Gls(...)
> latex(f, file='')
>
> ... but I get the following error
>
> Error in replace.substring.wild(s, old, new, test = test, front = front,  :
>    does not handle>  1 * in old
>
> I think that this might have something to do with the fact that I fit the
> model with GLS. (?)

What is GLS?  I thought you fit the model with Gls.  And please follow 
the posting guide instead of submitting only parts of lines of code.

The latex method for a Gls object typesets the mathematical form of the 
fitted model formula.  To get what you want:

w <- nlme:::summary.gls(f)$tTable
w
latex(w, ....)

Frank

>
> I am looking for a simple way to get a table of estimated coeficients without
> hand-making a table in a text editor for inclusion within a LATEX document.
>
> Thanks!
>
>


-- 
Frank E Harrell Jr   Professor and Chairman        School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list