R Observatory
Search
install.packages("stdReg2")
CRAN 30-day downloads, method
319−31.8% down on the 30 days before, the worse direction
Test coverage, method
59%of lines run by tests

Contains more modern tools for causal inference using regression standardization. Four general classes of models are implemented; generalized linear models, conditional generalized estimating equation models, Cox proportional hazards models, and shared frailty gamma-Weibull models.

Full description

Contains more modern tools for causal inference using regression standardization. Four general classes of models are implemented; generalized linear models, conditional generalized estimating equation models, Cox proportional hazards models, and shared frailty gamma-Weibull models. Methodological details are described in Sjölander, A. (2016) <doi:10.1007/s10654-016-0157-3>. Also includes functionality for doubly robust estimation for generalized linear models in some special cases, and the ability to implement custom models.

Maintainer
Michael C Sachs
Latest release
14 May 2026
First release
13 Sep 2024

Compare with another package

More details
Releases
3
Needs compilation
No
Needs R
>= 4.1.0
Config/testthat/edition
3
Date
2026-05-13
LazyData
true
RoxygenNote
7.3.3
Subjects (1) Method, Subjects
Cite

Package

Run in R for the authors' entry:

citation("stdReg2")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1016/j.annepidem.2025.04.002.

R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA
Balamuta, J. J. (2026). R Observatory: Metrics for stdReg2 version 1.0.7 [Data set]. HJJB, LLC. Data release v2026-10-28. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-28, which the citation names so these numbers can be found later.

All 13 check platforms pass.

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    OK

    Version checked
    1.0.7
    Time taken
    130 s
  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    OK

    Version checked
    1.0.7
    Time taken
    93 s
  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    1.0.7
    Time taken
    115 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    1.0.7
    Time taken
    86 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    1.0.7
    Time taken
    138 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    1.0.7
    Time taken
    39 s
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    1.0.7
    Time taken
    117 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    1.0.7
    Time taken
    165 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    1.0.7
    Time taken
    119 s
  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    OK

    Version checked
    1.0.7
    Time taken
    118 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    1.0.7
    Time taken
    35 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    1.0.7
    Time taken
    145 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    1.0.7
    Time taken
    135 s
  • 13 OK

Over time

No change since 25 Oct 2026

As a list (7)
ChangedWorst statusOKNotesWarningsErrors
25 Oct 2026OK13000
24 Oct 2026Error12001
4 Aug 2026OK13000
1 Aug 2026Note12100
21 May 2026OK13000
8 May 2026Error11002
10 Mar 2026OK14000

Since March 2026

Check results on CRAN

Total downloads in the last 30 days
324−33.3% down on the 30 days before, the worse directionIt is the sum of 3 channels: CRAN, r2u and autoCRAN.

CRAN rank

12,362 of 26,530

CRAN

319 downloads in the last 30 days

Rank
12,362 of 26,530
Change
−31.8% down on the 30 days before, the worse direction

It is in the total. Take it out

r2u

1 downloads in the last 30 days

Rank
19,986 of 30,526
Change
−80% down on the 30 days before, the worse direction

It is in the total. Take it out

autoCRAN

4 downloads in the last 30 days

Rank
13,992 of 29,212
Change
−69.2% down on the 30 days before, the worse direction

It is in the total. Take it out

Over time

All channels
2513

Compare downloads

Needs
5
Dependent packages
0
Suggested by
1
Needs (5)
Installing it adds
8 packages, 10.7 MB of source
Of those, need compilation
6
Optional extras (5)

summary_std_coxph

Kind
Internal R function
File
R/coxph_methods.R, line 586
Lines
104
Complexity
19
Covered by tests
66%

Called by 1

Functions
38
Public exports
16
Lines of R code
3,963
Median complexity
4.5
Functions (38)
FunctionKindFileLinesComplexityCovered
parfrailtyPublicR/parfrailty_methods.R310499%
plot.std_glmPublicR/glm_methods.R132300%
plot.std_survPublicR/coxph_methods.R132220%
print.std_customPublicR/standardize_custom.R39981%
print.std_glmPublicR/glm_methods.R2850%
print.std_survPublicR/coxph_methods.R620%
sandwichPublicR/utils.R1851353%
standardizePublicR/standardize_custom.R981077%
standardize_coxphPublicR/coxph_methods.R4352835%
standardize_geePublicR/gee_methods.R1791486%
standardize_glmPublicR/glm_methods.R1641196%
standardize_glm_drPublicR/glm_methods.R123999%
Size and composition

Lines by kind (6,832)

KindLinesShare
R code3,96358%
Tests4747%
Documentation1,87827%
Guides5178%

Lines by language

LanguageLinesShare
R4,43765%
Rd1,87828%
Vignettes3565%
Other1612%

Languages are counted from file extensions.

Files
56
R functions
38
Object systems
S3: 10 methods
Complexity
Median
4.5
Mean
8.47
Highest
30
Median lines per function
28
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
38
Calls
45
Unconnected
8
Groups
2
Growth (3 releases)
Total lines by release
6,252 on 13 Sep 20246,832 on 14 May 2026
Release changes

Both releases side by side

1.0.3 to 1.0.7, 28 Feb 2025 to 14 May 2026

Files changed
29
Lines added
412
Lines deleted
120
Exports
No change
Changed measures (10)
MeasureSubjectBeforeAfter
Total linesStructure6,5976,832
Lines of R codeStructure3,8723,963
Lines of testsStructure461474
Lines of documentationDocumentation1,7801,878
Help pages citing referencesDocumentation42%48%
Help pages with examples (share)Documentation68%62%
Test casesTesting1617
Test lines per line of codeTesting0.120.12
Lines per function (mean)Complexity74.5374.55
Direct dependenciesDependencies45
Most changed files (12 of 29)
FileLines addedLines deleted
inst/doc/overview.html4746
R/data.R690
MD52822
README.md2821
man/clslowbwt.Rd420
man/singapore.Rd350
vignettes/references.bib330
tests/testthat/test-standardize_glm.R218
inst/doc/custom.html203
DESCRIPTION119
R/parfrailty_methods.R200
NEWS.md130

Datasets: 2 added.

The tests ran and coverage was measured.

Lines run by tests
59%
Expressions run by tests
57.1%
Test cases
17
Exports named in tests
50%
Coverage by file (6)

6 files measured, least covered first.

FileLinesRun by testsNot runCoverage
R/coxph_methods.R 6 functions
46715631133%
plot.std_surv920920%
print_summary_std_coxph190190%
print.std_surv3030%
standardize_coxph2639217135%
summary_std_coxph77512666%
tidy.std_surv13130100%
R/standardize_custom.R 6 functions
28212515744%
standardize_level750750%
tidy.std_custom9090%
summary_standardize94435146%
standardize66511577%
print.std_custom2621581%
fit_helper1210283%
R/glm_methods.R 7 functions
40524715861%
plot.std_glm920920%
print.std_glm220220%
tidy.std_glm9090%
summary_std_glm67452267%
fit_glm5445983%
standardize_glm8380396%
standardize_glm_dr7877199%
R/utils.R 14 functions
2211408163%
rowcumSums3030%
rsum3030%
logit1010%
odds1010%
Hfun2161529%
sandwich110585253%
is.binary64267%
CI108280%
get_outcome_exposure1110191%
estfun_glm1312192%
aggr220100%
check_values_data880100%
expand550100%
format_result_standardize27270100%
R/gee_methods.R 1 function
1171011686%
standardize_gee1171011686%
R/parfrailty_methods.R 4 functions
3793354488%
summary.parfrailty210210%
print.summary.parfrailty130130%
standardize_parfrailty9891793%
parfrailty247244399%
Coverage run
Lines counted
1,871
Lines the tests ran
1,104
Tests passed
Yes
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
testthat
Test cases
17
Lines of tests
474
Test lines per line of code
0.12
Exports documented
100%
Arguments documented
90%
Return value documented
92.9%
Help pages with examples
61.9%
Examples run in checks
84.6%
Guides (2)
Other documentation
README
Yes, 252 words
Release notes file
Yes
Help pages
21
Lines of documentation
1,878
DatasetSizeColumns
clslowbwtBirthweight data clustered on the mother.also in 1 other package487 × 10id, birth, smoke, race, age, lwt and 4 more
singaporeCase-control study on oesophageal cancer in Chinese Singapore men.also in 1 other package400 × 9Set, CC, Age, Dial, Samsu, Cigs and 3 more

sachsmc / stdreg2 on github.com

Stars
6no change on 30 days ago
Forks
0
Open issues
2
Last commit
28 May 2026
Activity
Commits
84
Open pull requests
0
Tagged releases
0
Latest tagged release
–
In development
Default branch at 1.0.8, ahead of CRAN 1.0.7 (checked 2026-10-25)
Issues closed in
14 days (median)
Pull requests closed in
0 days (median)
Pull requests merged
100%
Created
1 Sep 2023
Licence file reads as
AGPL-3.0
Development practices (8)
KindFound
Continuous integrationGitHub Actions, R CMD check workflow
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Docs sourceREADME.Rmd, pkgdown
GitHub Pages site last deployed 2026-05-28
pkgdown site last built 2026-05-28
CRAN release processcran-comments.md, CRAN-SUBMISSION
Lint, format, editorRStudio project

Method, repository practices

Across sachsmc

R releases
  • On CRAN
  • Release
VersionReleasedR
1.0.7 current14 May 20264.6.0
1.0.328 Feb 20254.4.3
1.0.113 Sep 20244.4.1
Release notes (1.0.7)
  • setDtthreads for examples