Skip to content

Problems producing quantreg-Tables

2 messages · Jan Henckens

#
Hi Folks,

I've got a question regarding the 'quantreg' package maintained by Roger 
Koenker:

I tried to produce LaTeX tables using the longtable and dcolumn options 
as decribed in the manual, but the function latex() doesn't seem to 
react on _any_ other options than 'digits' and 'transpose'.

To reproduce these results the following minimal example may be used:

require(quantreg)
setwd("c:/temp")
data(engel)
fit2 <- 
summary(rq(foodexp~income,tau=c(0.05,0.25,0.5,0.75,0.95),data=engel))
# This code produces a table with _no_ caption
latex(fit2, caption="Engel's Law")

I already tried to use different versions of the package but this 
problem seems to be persistent. The usage of latex() should be correct 
since I adapted it to the vignette (p. 6, 
http://cran.r-project.org/web/packages/quantreg/vignettes/rq.pdf).

I'm using R 2.12.1 with 'quantreg' v4.53 on Windows XP.

I hope anyone can help?



Best regards,
Jan Henckens
#
I think I found out about the existing problem with generation of tables 
done by latex():

Checking the source code of 'table.R' I noticed any optional arguments 
specified seem to be discarded when calling the function latex.table() 
after preprocessing the summary.rqs-output

So unlike stated in the reference manual (p. 25)

 > latex.summary.rqs Make a latex table from a table of rq results
[...]
 > ...       optional arguments for latex.table

it is not possible to pass any preferences regarding the layout to 
latex.table().


The solution is extremely simple:

by changing line 36 in the code 'table.R':

latex.table(table, caption = caption, rowlabel = rowlabel, file = file)

into:

latex.table(table, caption = caption, rowlabel = rowlabel, file = file, ...)

the funcionality described in the reference manual is implemented.


Maybe this helps someone who is confronted with the same problem...


Jan