Sunday, December 13, 2009

R and LaTex working together in the automatic report generation of survey sampling tables

Christmas is coming and this time the gift is for those who work in the generation of statistical tables and do so by using R. We propose a procedure and a function in R language to prepare the automatic editing of large amounts of tables with similar structures that are generated during the survey applications.

These new features TbLatex and DataFr, incorporated in the new versión of the TeachingSampling package (v. 1.1.9), which allows defining the implementation of variables, categories, population subgroups, labels, estimates, coefficients of variation, titles, headers and tables resulting from a study to include in a report of statistical work. This tedious work is carried out, most of the time, using MS Excel or MS Access and its final implementation may take several weeks, if you have a team of several guys. In addition to tha task of avoiding human error, the presentation of the tables is very important. The resulting format from the application of these functions (see image and see here) is clean, clear and standard.

The result of the functions is a file with .tex extension. This is a file that is ready to compile into your favorite LaTeX editor. If you are dealing with a technical report, you can create a vertical document easily. If it's a slide show, you can do it horizontally. If you only need the output tables, for example in an appendix, simply execute the function in R and compile and it is ready. If you want to add text and explanations and references, simply open the generated file and, before compiling, add explanations or whatever you want to add.

This implementation is the result of this article by Professor Ortiz to be released in a few days in the Revista Comunicaciones en Estadística journal. In this manuscript, Professor Ortiz uses a fictional example for automatic table generation. Moreover, this manual of the related functions will be in a few weeks in the CRAN of R, available in the package TeachingSampling. In this manual, the functions were integrated with the package and, as a result, we have a software that selects samples of most known sampling designs, estimating totals, averages, quantiles and regression coefficients - for multiple variables interest - through expansion or calibration and all these estimates are concentrated in LaTeX by generating sampling reports.

1 comment:

  1. comparador seguros motos...

    [...]R and LaTex working together in the automatic report generation of survey sampling tables[...]...

    ReplyDelete