Trending

World technology news

→
An annotated RStudio screenshot showing its code, console, and data panes.
CRAN gtsummaryIn-depth report

Open-source gtsummary 2.7.0 released with continuous summaries for survey designs

The R package can summarize a continuous variable by category from a survey design object. The release also changes hierarchical results and table headings.

·CRAN gtsummary
Reading progress0%

A survey table for continuous variables

Version 2.7.0 of the open-source gtsummary package reached CRAN on November 28. The source archive records publication at 03:50:02 UTC, or 06:50:02 in Istanbul. Its new tbl_svycontinuous function summarizes a continuous variable by one or more categories from a survey design object. CRANberries published its own file comparison against version 2.6.1. We verified that the new archive contains the implementation, help, tests, and expected output files. The function makes a survey-aware continuous summary available through the same table workflow that teams use for other analysis results.

Travel time is one example

A transport survey might record journey duration in minutes and classify each trip by mode. If neighborhoods were sampled at different rates, the design object can carry the weights. The new function can place grouped summaries for buses, cars, and bicycles into one table. A weighted estimate can differ from the simple average of the recorded trips. The release notes describe the function as a survey counterpart to tbl_continuous. They also list support for the resulting table in add_overall, add_stat, and inline_text. An overall value or a number placed in report prose can then be drawn from the same table.

Validation for hierarchical results

The release changes tbl_ard_hierarchical, which consumes precomputed analysis results. An overall_row option can put a suitable overall result at the top. The function checks the structure of the supplied results against requested variables, groupings, and statistics. Certain mismatches previously produced incomplete output, according to the notes. They now yield an informative error. The default variable labels can come from attributes saved in the results. The change helps a report author trace a missing row back to the input structure rather than discover it by inspecting a completed document.

Updating the numbers used in headings

The new update_header_stats function can replace the statistics available to a heading template with values from a supplied analysis result. Counts or proportions in headers may refer to the full study or to a subset. Teams still need to document the population and denominator behind each figure. The release also allows individual labels to be replaced in tables with several continuous statistics. For instance, a template can rename a range without repeating every other label. The printed table and its source results need to remain aligned when a reporting pipeline applies several filters.

What the release evidence establishes

The archive and independent diff confirm that the added survey functions and tests are part of the published package. The estimates still depend on the sample design, weights, and treatment of missing records. A weighted mean and an unweighted count describe different aspects of the same survey. Some Windows binary channels on the CRAN page still showed 2.6.1 at review time. The new function requires 2.7.0. Keeping the package version alongside the survey design gives a report reader enough information to trace how its numbers were computed.

Archive photo · Rcragun / Wikimedia Commons ↗ · CC BY-SA 4.0 · Illustrative archive image of the R working environment, resized and converted to WebP under the same license.

Sources and verification
Be the first reader ✎ Write a comment

Reader discussion

Discussion prompt

How would you measure this development's real-world impact?

No comments yet. Be the first to contribute.

Write a comment

Comments are real visitor contributions. Repeated, link-heavy or abusive submissions may be limited.