diff --git a/main/404.html b/main/404.html index 893e3421..7398e595 100644 --- a/main/404.html +++ b/main/404.html @@ -1,5 +1,4 @@ - - + @@ -40,7 +39,17 @@ +
+ + @@ -34,65 +70,80 @@
-

Our Pledge

+

Our Pledge +

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

-

Our Standards

+

Our Standards +

Examples of behavior that contributes to a positive environment for our community include:

-
+ +
-

Enforcement Responsibilities

+

Enforcement Responsibilities +

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

-

Scope

+

Scope +

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

-

Enforcement

+

Enforcement +

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

-

Enforcement Guidelines

+

Enforcement Guidelines +

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

-

1. Correction

+

1. Correction +

Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

-

2. Warning

+

2. Warning +

Community Impact: A violation through a single incident or series of actions.

Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

-

3. Temporary Ban

+

3. Temporary Ban +

Community Impact: A serious violation of community standards, including sustained inappropriate behavior.

Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

-

4. Permanent Ban

+

4. Permanent Ban +

Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

Consequence: A permanent ban from any sort of public interaction within the community.

-

Attribution

+

Attribution +

This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

@@ -100,17 +151,19 @@

Attribution

+ + - + + - + + diff --git a/main/CONTRIBUTING.html b/main/CONTRIBUTING.html index 70fd85a4..ff797e4b 100644 --- a/main/CONTRIBUTING.html +++ b/main/CONTRIBUTING.html @@ -1,5 +1,26 @@ - -Contribution Guidelines • cardx + + + + + + +Contribution Guidelines • cardx + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +36,27 @@ + + @@ -36,7 +72,8 @@

🙏 Thank you for taking the time to contribute!

Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

-

Table of contents

+

Table of contents +

👶 Getting started

📔 Code of Conduct

🗃 License

@@ -47,38 +84,47 @@

Table of contents❓ Questions

-

Getting started

+

Getting started +

Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.

-

Code of Conduct

+

Code of Conduct +

A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.

-

License

+

License +

All your contributions will be covered by this project’s license.

-

Issues

+

Issues +

We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

-

Pull requests

+

Pull requests +

-

GitHub Flow

+

GitHub Flow +

This repository uses the GitHub Flow model for collaboration. To submit a pull request:

-
  1. +
      +
    1. Create a branch

      Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.

    2. Make changes

      Make sure your code

      -
      • passes all checks imposed by GitHub Actions
      • +
          +
        • passes all checks imposed by GitHub Actions
        • is well documented
        • is well tested with unit tests sufficiently covering the changes introduced
        • -
        +
      +
    3. Create a pull request (PR)

      In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

      @@ -92,76 +138,93 @@

      GitHub Flow -

      Branch naming convention

      +

      Branch naming convention +

      Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>. Please use underscore (_) as a delimiter for word separation. For example, 420_fix_ui_bug would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420 in the current project.

      If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>. For example, 69_awesomeproject_fix_spelling_error would reference issue 69 reported in project awesomeproject and aims to resolve one or more spelling errors in multiple (likely related) repositories.

monorepo and staged.dependencies -

+ +

Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies functionality to simulate a monorepo behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.

Please refer to the staged.dependencies package documentation for more details.

-

Coding guidelines

+

Coding guidelines +

This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

-

Style guide

+

Style guide +

This repository follows the standard tidyverse style guide and uses lintr for lint checks. Customized lint configurations are available in this repository’s .lintr file.

-

Dependency management

+

Dependency management +

Lightweight is the right weight. This repository follows tinyverse recommedations of limiting dependencies to minimum.

-

Dependency version management

+

Dependency version management +

If the code is not compatible with all (!) historical versions of a given dependenct package, it is required to specify minimal version in the DESCRIPTION file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000).

- +
-

R & package versions

+

R & package versions +

We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check GitHub Action execution log - there is a step that prints out the R sessionInfo().

If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

-

pre-commit

+

+pre-commit +

We highly recommend that you use the pre-commit tool combined with R hooks for pre-commit to execute some of the checks before committing and pushing your changes.

Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml file.

-

Recognition model

+

Recognition model +

As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:

- +

*Excluding auto-generated code, including but not limited to roxygen comments or renv.lock files.

The package maintainer also reserves the right to adjust the criteria to recognize contributions.

-

Questions

+

Questions +

If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

+ + - + + - + + diff --git a/main/LICENSE-text.html b/main/LICENSE-text.html index 54195a66..f4d09deb 100644 --- a/main/LICENSE-text.html +++ b/main/LICENSE-text.html @@ -1,5 +1,26 @@ - -License • cardx + + + + + + +License • cardx + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +36,27 @@ + + @@ -46,17 +82,19 @@ limitations under the License. - + + - + + - + + diff --git a/main/PULL_REQUEST_TEMPLATE.html b/main/PULL_REQUEST_TEMPLATE.html index c687505d..74ccdf18 100644 --- a/main/PULL_REQUEST_TEMPLATE.html +++ b/main/PULL_REQUEST_TEMPLATE.html @@ -1,5 +1,26 @@ - -NA • cardx + + + + + + +NA • cardx + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +36,27 @@ + + @@ -35,24 +71,29 @@

What changes are proposed in this pull request? * Style this entry in a way that can be copied directly into NEWS.md. (#, @)

Provide more detail here as needed.

Reference GitHub issue associated with pull request. e.g., ‘closes #

-

Pre-review Checklist (if item does not apply, mark is as complete) - [ ] All GitHub Action workflows pass with a - [ ] PR branch has pulled the most recent updates from master branch: usethis::pr_merge_main() - [ ] If a bug was fixed, a unit test was added. - [ ] If a new ard_*() function was added, it passes the ARD structural checks from cards::check_ard_structure(). - [ ] If a new ard_*() function was added, set_cli_abort_call() has been set. - [ ] If a new ard_*() function was added and it depends on another package (such as, broom), is_pkg_installed("broom") has been set in the function call and the following added to the roxygen comments: @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom"")) - [ ] Code coverage is suitable for any new functions/features (generally, 100% coverage for new code): devtools::test_coverage()

+
+

Pre-review Checklist (if item does not apply, mark is as complete) - [ ] All GitHub Action workflows pass with a - [ ] PR branch has pulled the most recent updates from master branch: usethis::pr_merge_main() - [ ] If a bug was fixed, a unit test was added. - [ ] If a new ard_*() function was added, it passes the ARD structural checks from cards::check_ard_structure(). - [ ] If a new ard_*() function was added, set_cli_abort_call() has been set. - [ ] If a new ard_*() function was added and it depends on another package (such as, broom), is_pkg_installed("broom") has been set in the function call and the following added to the roxygen comments: @examplesIf do.call(asNamespace("cardx")$is_pkg_installed, list(pkg = "broom"")) - [ ] Code coverage is suitable for any new functions/features (generally, 100% coverage for new code): devtools::test_coverage()

Reviewer Checklist (if item does not apply, mark is as complete)

- +

When the branch is ready to be merged: - [ ] Update NEWS.md with the changes from this pull request under the heading “# cardx (development version)”. If there is an issue associated with the pull request, reference it in parentheses at the end update (see NEWS.md for examples). - [ ] All GitHub Action workflows pass with a - [ ] Approve Pull Request - [ ] Merge the PR. Please use “Squash and merge” or “Rebase and merge”.

- + + - + + - + + diff --git a/main/SECURITY.html b/main/SECURITY.html index b9516e4f..e62f1d92 100644 --- a/main/SECURITY.html +++ b/main/SECURITY.html @@ -1,5 +1,26 @@ - -Security Policy • cardx + + + + + + +Security Policy • cardx + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +36,27 @@ + + @@ -34,38 +70,44 @@
-

Reporting Security Issues

+

Reporting Security Issues +

If you believe you have found a security vulnerability in any of the repositories in this organization, please report it to us through coordinated disclosure.

Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

Instead, please send an email to vulnerability.management[@]roche.com.

Please include as much of the information listed below as you can to help us better understand and resolve the issue:

- +

This information will help us triage your report more quickly.

-

Data Security Standards (DSS)

+

Data Security Standards (DSS) +

Please make sure that while reporting issues in the form a bug, feature, or pull request, all sensitive information such as PII, PHI, and PCI is completely removed from any text and attachments, including pictures and videos.

+ + - + + - + + diff --git a/main/authors.html b/main/authors.html index d82e998e..d8f529ae 100644 --- a/main/authors.html +++ b/main/authors.html @@ -1,5 +1,26 @@ - -Authors and Citation • cardx + + + + + + +Authors and Citation • cardx + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +36,27 @@ + + @@ -33,7 +69,8 @@

Authors

-
+ +

Citation

@@ -71,17 +109,19 @@

Citation

+ + - + + - + + diff --git a/main/index.html b/main/index.html index ed729945..ca07130f 100644 --- a/main/index.html +++ b/main/index.html @@ -1,5 +1,4 @@ - - + @@ -42,7 +41,17 @@ +
+ + @@ -32,35 +68,54 @@
-

cardx 0.2.1.9012

-
+ +
-

cardx 0.2.1

CRAN release: 2024-09-03

+

cardx 0.2.1 +

+

CRAN release: 2024-09-03

-

New Features and Updates

-
+ +
-

Bug Fixes

-
+

Bug Fixes +

+ +
-

Lifecycle Changes

-
+

Lifecycle Changes +

+ +
-

cardx 0.2.0

CRAN release: 2024-07-20

+

cardx 0.2.0 +

+

CRAN release: 2024-07-20

-

Breaking Changes

-
+

Breaking Changes +

+
    +
  • Updated function names to follow the pattern ard_<pkgname>_<fnname>(). This change is immediate: previous functions names have not been deprecated. (#106)
  • +
+
 ard_ttest()             -> ard_stats_t_test()
 ard_paired_ttest()      -> ard_stats_paired_t_test()
 ard_wilcoxtest()        -> ard_stats_wilcox_test()
@@ -72,11 +127,14 @@ 

Breaking Changesard_moodtest() -> ard_stats_mood_test()

-

New Features

-
+ +
-

cardx 0.1.0

CRAN release: 2024-03-18

-
+

cardx 0.1.0 +

+

CRAN release: 2024-03-18

+ + + + - + + - + + diff --git a/main/reference/ard_aod_wald_test.html b/main/reference/ard_aod_wald_test.html index b2b6560e..197f42c7 100644 --- a/main/reference/ard_aod_wald_test.html +++ b/main/reference/ard_aod_wald_test.html @@ -1,7 +1,30 @@ - -ARD Wald Test — ard_aod_wald_test • cardx + + + + + + +ARD Wald Test — ard_aod_wald_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,7 +78,8 @@
-

Usage

+

Usage +

ard_aod_wald_test(
   x,
   tidy_fun = broom.helpers::tidy_with_broom_or_parameters,
@@ -49,29 +88,37 @@ 

Usage

-

Arguments

+

Arguments +

-
x
+
+
x +

regression model object

-
tidy_fun
+
tidy_fun +

(function)
a tidier. Default is broom.helpers::tidy_with_broom_or_parameters

-
...
+
... +

arguments passed to aod::wald.test(...)

-
+ +
-

Value

+

Value +

data frame

-

Examples

+

Examples +

lm(AGE ~ ARM, data = cards::ADSL) |>
   ard_aod_wald_test()
 #> {cards} data frame: 6 x 8
@@ -86,17 +133,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_attributes.html b/main/reference/ard_attributes.html index 6b21e884..e51356b4 100644 --- a/main/reference/ard_attributes.html +++ b/main/reference/ard_attributes.html @@ -1,19 +1,42 @@ - -ARD Attributes — ard_attributes.survey.design • cardx + + + + + +ARD Attributes — ard_attributes.survey.design • cardx + + + + + + + + + + + + + +"> + + + + + Skip to contents @@ -29,12 +52,27 @@ + + @@ -47,50 +85,63 @@
-

Add variable attributes to an ARD data frame.

  • The label attribute will be added for all columns, and when no label +

    Add variable attributes to an ARD data frame.

    +
      +
    • The label attribute will be added for all columns, and when no label is specified and no label has been set for a column using the label= argument, the column name will be placed in the label statistic.

    • The class attribute will also be returned for all columns.

    • Any other attribute returned by attributes() will also be added, e.g. factor levels.

    • -
+ +
-

Usage

+

Usage +

# S3 method for class 'survey.design'
 ard_attributes(data, variables = everything(), label = NULL, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a design object often created with survey::svydesign().

-
variables
+
variables +

(tidy-select)
variables to include

-
label
+
label +

(named list)
named list of variable labels, e.g. list(cyl = "No. Cylinders"). Default is NULL

-
...
+
... +

These dots are for future extensions and must be empty.

-
+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

Examples

+

Examples +

data(api, package = "survey")
 dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc)
 
@@ -109,17 +160,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_car_anova.html b/main/reference/ard_car_anova.html index e0083cbc..e1920628 100644 --- a/main/reference/ard_car_anova.html +++ b/main/reference/ard_car_anova.html @@ -1,5 +1,28 @@ - -ARD ANOVA from car Package — ard_car_anova • cardx + + + + + + +ARD ANOVA from car Package — ard_car_anova • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,29 +75,37 @@
-

Usage

+

Usage +

ard_car_anova(x, ...)
-

Arguments

+

Arguments +

-
x
+
+
x +

regression model object

-
...
+
... +

arguments passed to car::Anova(...)

-
+ +
-

Value

+

Value +

data frame

-

Examples

+

Examples +

lm(AGE ~ ARM, data = cards::ADSL) |>
   ard_car_anova()
 #> {cards} data frame: 5 x 8
@@ -85,17 +131,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_car_vif.html b/main/reference/ard_car_vif.html index 92a6478b..9eb004ae 100644 --- a/main/reference/ard_car_vif.html +++ b/main/reference/ard_car_vif.html @@ -1,7 +1,30 @@ - -Regression VIF ARD — ard_car_vif • cardx + + + + + + +Regression VIF ARD — ard_car_vif • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,30 +78,38 @@
-

Usage

+

Usage +

ard_car_vif(x, ...)
-

Arguments

+

Arguments +

-
x
+
+
x +

regression model object See car::vif() for details

-
...
+
... +

arguments passed to car::vif(...)

-
+ +
-

Value

+

Value +

data frame

-

Examples

+

Examples +

lm(AGE ~ ARM + SEX, data = cards::ADSL) |>
   ard_car_vif()
 #> {cards} data frame: 6 x 8
@@ -78,17 +124,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_categorical.survey.design.html b/main/reference/ard_categorical.survey.design.html index dece6487..0f60055d 100644 --- a/main/reference/ard_categorical.survey.design.html +++ b/main/reference/ard_categorical.survey.design.html @@ -1,13 +1,36 @@ - -ARD Categorical Survey Statistics — ard_categorical.survey.design • cardx + +The unweighted statistics are calculated with cards::ard_categorical.data.frame().'> + + + + + Skip to contents @@ -23,12 +46,27 @@ + + @@ -49,7 +87,8 @@
-

Usage

+

Usage +

# S3 method for class 'survey.design'
 ard_categorical(
   data,
@@ -67,39 +106,47 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a design object often created with survey::svydesign().

-
variables
+
variables +

(tidy-select)
columns to include in summaries.

-
by
+
by +

(tidy-select)
results are calculated for all combinations of the column specified and the variables. A single column may be specified.

-
statistic
+
statistic +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is a character vector of statistic names to include. See default value for options.

-
denominator
+
denominator +

(string)
a string indicating the type proportions to calculate. Must be one of "column" (the default), "row", and "cell".

-
fmt_fn
+
fmt_fn +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is a named list of functions @@ -107,7 +154,8 @@

Argumentsstat_label +
stat_label +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is either a named list or a list of formulas defining the @@ -115,17 +163,21 @@

Arguments.

-
...
+
... +

These dots are for future extensions and must be empty.

-

+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

Examples

+

Examples +

svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq)
 
 ard_categorical(svy_titanic, variables = c(Class, Age), by = Survived)
@@ -147,17 +199,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_categorical_ci.html b/main/reference/ard_categorical_ci.html index 556190f1..b41df330 100644 --- a/main/reference/ard_categorical_ci.html +++ b/main/reference/ard_categorical_ci.html @@ -1,7 +1,30 @@ - -ARD Proportion Confidence Intervals — ard_categorical_ci • cardx + + + + + + +ARD Proportion Confidence Intervals — ard_categorical_ci • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,7 +78,8 @@
-

Usage

+

Usage +

ard_categorical_ci(data, ...)
 
 # S3 method for class 'data.frame'
@@ -60,43 +99,52 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame

-
...
+
... +

Arguments passed to methods.

-
variables
+
variables +

(tidy-select)
columns to include in summaries. Columns must be class <logical> or <numeric> values coded as c(0, 1).

-
by
+
by +

(tidy-select)
columns to stratify calculations by

-
method
+
method +

(string)
string indicating the type of confidence interval to calculate. Must be one of . See ?proportion_ci for details.

-
conf.level
+
conf.level +

(numeric)
a scalar in (0, 1) indicating the confidence level. Default is 0.95

-
value
+
value +

(formula-list-selector)
function will calculate the CIs for all levels of the variables specified. Use this argument to instead request only a single level by summarized. @@ -104,18 +152,22 @@

Argumentsstrata, weights, max.iterations +
strata, weights, max.iterations +

arguments passed to proportion_ci_strat_wilson(), when method='strat_wilson'

-

+ +
-

Value

+

Value +

an ARD data frame

-

Examples

+

Examples +

# compute CI for binary variables
 ard_categorical_ci(mtcars, variables = c(vs, am), method = "wilson")
 #> {cards} data frame: 20 x 9
@@ -168,17 +220,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_categorical_ci.survey.design.html b/main/reference/ard_categorical_ci.survey.design.html index d7f78044..3032cb63 100644 --- a/main/reference/ard_categorical_ci.survey.design.html +++ b/main/reference/ard_categorical_ci.survey.design.html @@ -1,7 +1,30 @@ - -ARD survey categorical CIs — ard_categorical_ci.survey.design • cardx + + + + + + +ARD survey categorical CIs — ard_categorical_ci.survey.design • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,7 +78,8 @@
-

Usage

+

Usage +

# S3 method for class 'survey.design'
 ard_categorical_ci(
   data,
@@ -55,37 +94,45 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a design object often created with survey::svydesign().

-
variables
+
variables +

(tidy-select)
columns to include in summaries.

-
by
+
by +

(tidy-select)
results are calculated for all combinations of the columns specified, including unobserved combinations and unobserved factor levels.

-
method
+
method +

(string)
Method passed to survey::svyciprop(method)

-
conf.level
+
conf.level +

(numeric)
a scalar in (0, 1) indicating the confidence level. Default is 0.95

-
value
+
value +

(formula-list-selector)
function will calculate the CIs for all levels of the variables specified. Use this argument to instead request only a single level by summarized. @@ -93,23 +140,28 @@

Argumentsdf +
df +

(numeric)
denominator degrees of freedom, passed to survey::svyciprop(df). Default is survey::degf(data).

-
...
+
... +

arguments passed to survey::svyciprop()

-

+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

data(api, package = "survey")
 dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc)
 
@@ -139,17 +191,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_continuous.survey.design.html b/main/reference/ard_continuous.survey.design.html index f7ebbe46..b4a7b3d6 100644 --- a/main/reference/ard_continuous.survey.design.html +++ b/main/reference/ard_continuous.survey.design.html @@ -1,5 +1,28 @@ - -ARD Continuous Survey Statistics — ard_continuous.survey.design • cardx + + + + + + +ARD Continuous Survey Statistics — ard_continuous.survey.design • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,7 +75,8 @@
-

Usage

+

Usage +

# S3 method for class 'survey.design'
 ard_continuous(
   data,
@@ -51,33 +90,40 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a design object often created with survey::svydesign().

-
variables
+
variables +

(tidy-select)
columns to include in summaries.

-
by
+
by +

(tidy-select)
results are calculated for all combinations of the columns specified, including unobserved combinations and unobserved factor levels.

-
statistic
+
statistic +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is a character vector of statistic names to include. See below for options.

-
fmt_fn
+
fmt_fn +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is a named list of functions @@ -85,7 +131,8 @@

Argumentsstat_label +
stat_label +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is either a named list or a list of formulas defining the @@ -93,16 +140,20 @@

Arguments.

-
...
+
... +

These dots are for future extensions and must be empty.

-

+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

statistic argument

+

statistic argument +

@@ -112,7 +163,8 @@

statistic argument -

Examples

+

Examples +

data(api, package = "survey")
 dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc)
 
@@ -136,17 +188,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_continuous_ci.html b/main/reference/ard_continuous_ci.html index e241338e..196fbebe 100644 --- a/main/reference/ard_continuous_ci.html +++ b/main/reference/ard_continuous_ci.html @@ -1,5 +1,28 @@ - -ARD continuous CIs — ard_continuous_ci • cardx + + + + + + +ARD continuous CIs — ard_continuous_ci • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,7 +75,8 @@
-

Usage

+

Usage +

ard_continuous_ci(data, ...)
 
 # S3 method for class 'data.frame'
@@ -52,47 +91,58 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
...
+
... +

arguments passed to t.test() or wilcox.test()

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent t-tests will be computed for each variable.

-
by
+
by +

(tidy-select)
optional column name to compare by.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
method
+
method +

(string)
a string indicating the method to use for the confidence interval calculation. Must be one of "t.test" or "wilcox.test"

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

ard_continuous_ci(mtcars, variables = c(mpg, hp), method = "wilcox.test")
 #> {cards} data frame: 24 x 8
 #>    variable   context   stat_name stat_label      stat   warning
@@ -136,17 +186,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_continuous_ci.survey.design.html b/main/reference/ard_continuous_ci.survey.design.html index ade80e6c..f6375f8b 100644 --- a/main/reference/ard_continuous_ci.survey.design.html +++ b/main/reference/ard_continuous_ci.survey.design.html @@ -1,7 +1,30 @@ - -ARD survey continuous CIs — ard_continuous_ci.survey.design • cardx + + + + + + +ARD survey continuous CIs — ard_continuous_ci.survey.design • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,7 +78,8 @@
-

Usage

+

Usage +

# S3 method for class 'survey.design'
 ard_continuous_ci(
   data,
@@ -55,54 +94,66 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a design object often created with survey::svydesign().

-
variables
+
variables +

(tidy-select)
columns to include in summaries.

-
by
+
by +

(tidy-select)
results are calculated for all combinations of the columns specified, including unobserved combinations and unobserved factor levels.

-
method
+
method +

(string)
Method for confidence interval calculation. When "svymean", the calculation is computed via survey::svymean(). Otherwise, it is calculated viasurvey::svyquantile(interval.type=method)

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
df
+
df +

(numeric)
denominator degrees of freedom, passed to survey::confint(df). Default is survey::degf(data).

-
...
+
... +

arguments passed to survey::confint()

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

data(api, package = "survey")
 dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc)
 
@@ -127,17 +178,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_dichotomous.survey.design.html b/main/reference/ard_dichotomous.survey.design.html index 424e1c7a..59e0273e 100644 --- a/main/reference/ard_dichotomous.survey.design.html +++ b/main/reference/ard_dichotomous.survey.design.html @@ -1,5 +1,28 @@ - -ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design • cardx + + + + + + +ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,7 +75,8 @@
-

Usage

+

Usage +

# S3 method for class 'survey.design'
 ard_dichotomous(
   data,
@@ -56,46 +95,55 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a design object often created with survey::svydesign().

-
variables
+
variables +

(tidy-select)
columns to include in summaries.

-
by
+
by +

(tidy-select)
results are calculated for all combinations of the column specified and the variables. A single column may be specified.

-
value
+
value +

(named list)
named list of dichotomous values to tabulate. Default is cards::maximum_variable_value(data$variables), which returns the largest/last value after a sort.

-
statistic
+
statistic +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is a character vector of statistic names to include. See default value for options.

-
denominator
+
denominator +

(string)
a string indicating the type proportions to calculate. Must be one of "column" (the default), "row", and "cell".

-
fmt_fn
+
fmt_fn +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is a named list of functions @@ -103,7 +151,8 @@

Argumentsstat_label +
stat_label +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is either a named list or a list of formulas defining the @@ -111,17 +160,21 @@

Arguments.

-
...
+
... +

These dots are for future extensions and must be empty.

-

+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

Examples

+

Examples +

survey::svydesign(ids = ~1, data = mtcars, weights = ~1) |>
   ard_dichotomous(by = vs, variables = c(cyl, am), value = list(cyl = 4))
 #> {cards} data frame: 32 x 11
@@ -142,17 +195,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_effectsize_cohens_d.html b/main/reference/ard_effectsize_cohens_d.html index 1bb8744a..12a1e637 100644 --- a/main/reference/ard_effectsize_cohens_d.html +++ b/main/reference/ard_effectsize_cohens_d.html @@ -1,7 +1,30 @@ - -ARD Cohen's D Test — ard_effectsize_cohens_d • cardx + + + + + + +ARD Cohen's D Test — ard_effectsize_cohens_d • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,52 +78,64 @@
-

Usage

+

Usage +

ard_effectsize_cohens_d(data, by, variables, conf.level = 0.95, ...)
 
 ard_effectsize_paired_cohens_d(data, by, variables, id, conf.level = 0.95, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
by
+
by +

(tidy-select)
column name to compare by. Must be a categorical variable with exactly two levels.

-
variables
+
variables +

(tidy-select)
column names to be compared. Must be a continuous variables. Independent tests will be run for each variable.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

arguments passed to effectsize::cohens_d(...)

-
id
+
id +

(tidy-select)
column name of the subject or participant ID

-
+ +
-

Value

+

Value +

ARD data frame

-

Details

+

Details +

For the ard_effectsize_cohens_d() function, the data is expected to be one row per subject. The data is passed as effectsize::cohens_d(data[[variable]]~data[[by]], data, paired = FALSE, ...).

For the ard_effectsize_paired_cohens_d() function, the data is expected to be one row @@ -96,7 +146,8 @@

Details
-

Examples

+

Examples +

cards::ADSL |>
   dplyr::filter(ARM %in% c("Placebo", "Xanomeline High Dose")) |>
   ard_effectsize_cohens_d(by = ARM, variables = AGE)
@@ -137,17 +188,19 @@ 

Examples

+ +

- + + - + + diff --git a/main/reference/ard_effectsize_hedges_g.html b/main/reference/ard_effectsize_hedges_g.html index d2302728..ab16e39c 100644 --- a/main/reference/ard_effectsize_hedges_g.html +++ b/main/reference/ard_effectsize_hedges_g.html @@ -1,7 +1,30 @@ - -ARD Hedge's G Test — ard_effectsize_hedges_g • cardx + + + + + + +ARD Hedge's G Test — ard_effectsize_hedges_g • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,52 +78,64 @@
-

Usage

+

Usage +

ard_effectsize_hedges_g(data, by, variables, conf.level = 0.95, ...)
 
 ard_effectsize_paired_hedges_g(data, by, variables, id, conf.level = 0.95, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
by
+
by +

(tidy-select)
column name to compare by. Must be a categorical variable with exactly two levels.

-
variables
+
variables +

(tidy-select)
column names to be compared. Must be a continuous variable. Independent tests will be run for each variable

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

arguments passed to effectsize::hedges_g(...)

-
id
+
id +

(tidy-select)
column name of the subject or participant ID

-
+ +
-

Value

+

Value +

ARD data frame

-

Details

+

Details +

For the ard_effectsize_hedges_g() function, the data is expected to be one row per subject. The data is passed as effectsize::hedges_g(data[[variable]]~data[[by]], data, paired = FALSE, ...).

For the ard_effectsize_paired_hedges_g() function, the data is expected to be one row @@ -96,7 +146,8 @@

Details
-

Examples

+

Examples +

cards::ADSL |>
   dplyr::filter(ARM %in% c("Placebo", "Xanomeline High Dose")) |>
   ard_effectsize_hedges_g(by = ARM, variables = AGE)
@@ -137,17 +188,19 @@ 

Examples

+ +

- + + - + + diff --git a/main/reference/ard_emmeans_mean_difference.html b/main/reference/ard_emmeans_mean_difference.html index 63d1579e..214583dc 100644 --- a/main/reference/ard_emmeans_mean_difference.html +++ b/main/reference/ard_emmeans_mean_difference.html @@ -1,19 +1,42 @@ - -ARD for LS Mean Difference — ard_emmeans_mean_difference • cardx + + + + + +ARD for LS Mean Difference — ard_emmeans_mean_difference • cardx + + + + + + + + + + + + + +to construct the regression model via cardx::construct_model()."> + + + + + Skip to contents @@ -29,12 +52,27 @@ + + @@ -49,16 +87,21 @@

This function calculates least-squares mean differences using the 'emmeans' package using the following

-

emmeans::emmeans(object = <regression model>, specs = ~ <primary covariate>) |>
+

+
+
emmeans::emmeans(object = <regression model>, specs = ~ <primary covariate>) |>
   emmeans::contrast(method = "pairwise") |>
   summary(infer = TRUE, level = <confidence level>)
-

+
+

+

The arguments data, formula, method, method.args, package are used to construct the regression model via cardx::construct_model().

-

Usage

+

Usage +

ard_emmeans_mean_difference(
   data,
   formula,
@@ -72,66 +115,81 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame/survey.design)
a data frame or survey design object

-
formula
+
formula +

(formula)
a formula

-
method
+
method +

(string)
string of function naming the function to be called, e.g. "glm". If function belongs to a library that is not attached, the package name must be specified in the package argument.

-
method.args
-

(named list)
+

method.args +
+
+

(named list)
named list of arguments that will be passed to method.

Note that this list may contain non-standard evaluation components. If you are wrapping this function in other functions, the argument must be passed in a way that does not evaluate the list, e.g. -using rlang's embrace operator {{ . }}.

+using rlang's embrace operator {{ . }}.

+ -
package
+
package +

(string)
string of package name that will be temporarily loaded when function specified in method is executed.

-
response_type
+
response_type +

(string) string indicating whether the model outcome is 'continuous' or 'dichotomous'. When 'dichotomous', the call to emmeans::emmeans() is supplemented with argument regrid="response".

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
primary_covariate
+
primary_covariate +

(string)
string indicating the primary covariate (typically the dichotomous treatment variable). Default is the first covariate listed in the formula.

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

ard_emmeans_mean_difference(
   data = mtcars,
   formula = mpg ~ am + cyl,
@@ -170,17 +228,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_missing.survey.design.html b/main/reference/ard_missing.survey.design.html index eef7db69..23a8bb79 100644 --- a/main/reference/ard_missing.survey.design.html +++ b/main/reference/ard_missing.survey.design.html @@ -1,5 +1,28 @@ - -ARD Missing Survey Statistics — ard_missing.survey.design • cardx + + + + + + +ARD Missing Survey Statistics — ard_missing.survey.design • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,7 +75,8 @@
-

Usage

+

Usage +

# S3 method for class 'survey.design'
 ard_missing(
   data,
@@ -58,33 +97,40 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a design object often created with survey::svydesign().

-
variables
+
variables +

(tidy-select)
columns to include in summaries.

-
by
+
by +

(tidy-select)
results are calculated for all combinations of the column specified and the variables. A single column may be specified.

-
statistic
+
statistic +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is a character vector of statistic names to include. See default value for options.

-
fmt_fn
+
fmt_fn +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is a named list of functions @@ -92,7 +138,8 @@

Argumentsstat_label +
stat_label +

(formula-list-selector)
a named list, a list of formulas, or a single formula where the list element is either a named list or a list of formulas defining the @@ -100,17 +147,21 @@

Arguments.

-
...
+
... +

These dots are for future extensions and must be empty.

-

+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

Examples

+

Examples +

svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq)
 
 ard_missing(svy_titanic, variables = c(Class, Age), by = Survived)
@@ -132,17 +183,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_regression.html b/main/reference/ard_regression.html index 2911bf10..93bff846 100644 --- a/main/reference/ard_regression.html +++ b/main/reference/ard_regression.html @@ -1,7 +1,30 @@ - -Regression ARD — ard_regression • cardx + + + + + + +Regression ARD — ard_regression • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,7 +78,8 @@
-

Usage

+

Usage +

ard_regression(x, ...)
 
 # Default S3 method
@@ -48,29 +87,37 @@ 

Usage

-

Arguments

+

Arguments +

-
x
+
+
x +

regression model object

-
...
+
... +

Arguments passed to broom.helpers::tidy_plus_plus()

-
tidy_fun
+
tidy_fun +

(function)
a tidier. Default is broom.helpers::tidy_with_broom_or_parameters

-
+ +
-

Value

+

Value +

data frame

-

Examples

+

Examples +

lm(AGE ~ ARM, data = cards::ADSL) |>
   ard_regression(add_estimate_to_reference_rows = TRUE)
 #> {cards} data frame: 43 x 9
@@ -91,17 +138,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_regression_basic.html b/main/reference/ard_regression_basic.html index bab72dbd..fb0e6d4c 100644 --- a/main/reference/ard_regression_basic.html +++ b/main/reference/ard_regression_basic.html @@ -1,5 +1,22 @@ - -Basic Regression ARD — ard_regression_basic • cardx + + + + + +Basic Regression ARD — ard_regression_basic • cardx + + + + + + + + + + + + + +"> + + + + + Skip to contents @@ -39,12 +62,27 @@ + + @@ -63,16 +101,21 @@ The function primarily matches regression terms to underlying variable names and levels. The default arguments used are

-

broom.helpers::tidy_plus_plus(
+

+
+
broom.helpers::tidy_plus_plus(
   add_reference_rows = FALSE,
   add_estimate_to_reference_rows = FALSE,
   add_n = FALSE,
   intercept = FALSE
-)

+)
+

+
-

Usage

+

Usage +

ard_regression_basic(
   x,
   tidy_fun = broom.helpers::tidy_with_broom_or_parameters,
@@ -83,35 +126,44 @@ 

Usage

-

Arguments

+

Arguments +

-
x
+
+
x +

regression model object

-
tidy_fun
+
tidy_fun +

(function)
a tidier. Default is broom.helpers::tidy_with_broom_or_parameters

-
stats_to_remove
+
stats_to_remove +

(character)
character vector of statistic names to remove. Default is c("term", "var_type", "var_label", "var_class", "label", "contrasts_type", "contrasts", "var_nlevels").

-
...
+
... +

Arguments passed to broom.helpers::tidy_plus_plus()

-
+ +
-

Value

+

Value +

data frame

-

Examples

+

Examples +

lm(AGE ~ ARM, data = cards::ADSL) |>
   ard_regression_basic()
 #> {cards} data frame: 12 x 9
@@ -132,17 +184,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_smd_smd.html b/main/reference/ard_smd_smd.html index 465043d6..60d08065 100644 --- a/main/reference/ard_smd_smd.html +++ b/main/reference/ard_smd_smd.html @@ -1,9 +1,32 @@ - -ARD Standardized Mean Difference — ard_smd_smd • cardx + + + + + +ARD Standardized Mean Difference — ard_smd_smd • cardx + + + + + + + + + + + + + +std.error=TRUE, which the original smd::smd() does not include."> + + + + + Skip to contents @@ -19,12 +42,27 @@ + + @@ -43,53 +81,65 @@
-

Usage

+

Usage +

ard_smd_smd(data, by, variables, std.error = TRUE, conf.level = 0.95, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame/survey.design)
a data frame or object of class 'survey.design' (typically created with survey::svydesign()).

-
by
+
by +

(tidy-select)
column name to compare by.

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent tests will be computed for each variable.

-
std.error
+
std.error +

(scalar logical)
Logical indicator for computing standard errors using smd::compute_smd_var(). Default is TRUE.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

arguments passed to smd::smd()

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

ard_smd_smd(cards::ADSL, by = SEX, variables = AGE)
 #> {cards} data frame: 6 x 9
 #>   group1 variable context stat_name stat_label      stat
@@ -113,17 +163,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_anova.html b/main/reference/ard_stats_anova.html index 0ae41fd6..1d90a31c 100644 --- a/main/reference/ard_stats_anova.html +++ b/main/reference/ard_stats_anova.html @@ -1,11 +1,34 @@ - -ARD ANOVA — ard_stats_anova • cardx + + + + + +ARD ANOVA — ard_stats_anova • cardx + + + + + + + + + + + + + +information passed and models will be passed to stats::anova()."> + + + + + Skip to contents @@ -21,12 +44,27 @@ + + @@ -46,7 +84,8 @@
-

Usage

+

Usage +

ard_stats_anova(x, ...)
 
 # S3 method for class 'anova'
@@ -65,20 +104,25 @@ 

Usage

-

Arguments

+

Arguments +

-
x
+
+
x +

(anova or data.frame)
an object of class 'anova' created with stats::anova() or a data frame

-
...
+
... +

These dots are for future extensions and must be empty.

-
method_text
+
method_text +

(string)
string of the method used. Default is "ANOVA results from stats::anova()". We provide the option to change this as stats::anova() can produce @@ -86,44 +130,57 @@

Argumentsformulas +
formulas +

(list)
a list of formulas

-
method
+
method +

(string)
string of function naming the function to be called, e.g. "glm". If function belongs to a library that is not attached, the package name must be specified in the package argument.

-
method.args
-

(named list)
+

method.args +
+
+

(named list)
named list of arguments that will be passed to method.

Note that this list may contain non-standard evaluation components. If you are wrapping this function in other functions, the argument must be passed in a way that does not evaluate the list, e.g. -using rlang's embrace operator {{ . }}.

+using rlang's embrace operator {{ . }}.

+

-
package
+
package +

(string)
string of package name that will be temporarily loaded when function specified in method is executed.

-
+ +
-

Value

+

Value +

ARD data frame

-

Details

+

Details +

When a list of formulas is supplied to ard_stats_anova(), these formulas along with information from other arguments, are used to construct models and pass those models to stats::anova().

The models are constructed using rlang::exec(), which is similar to do.call().

-

rlang::exec(.fn = method, formula = formula, data = data, !!!method.args)

+

+
+
rlang::exec(.fn = method, formula = formula, data = data, !!!method.args)
+

+

The above function is executed in withr::with_namespace(package), which allows for the use of ard_stats_anova(method) from packages, e.g. package = 'lme4' must be specified when method = 'glmer'. @@ -131,7 +188,8 @@

Details
-

Examples

+

Examples +

anova(
   lm(mpg ~ am, mtcars),
   lm(mpg ~ am + hp, mtcars)
@@ -201,17 +259,19 @@ 

Examples

+ +

- + + - + + diff --git a/main/reference/ard_stats_aov.html b/main/reference/ard_stats_aov.html index 6f848604..efc01f80 100644 --- a/main/reference/ard_stats_aov.html +++ b/main/reference/ard_stats_aov.html @@ -1,7 +1,30 @@ - -ARD ANOVA — ard_stats_aov • cardx + + + + + + +ARD ANOVA — ard_stats_aov • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,35 +78,44 @@
-

Usage

+

Usage +

ard_stats_aov(formula, data, ...)
-

Arguments

+

Arguments +

-
formula
+
+
formula +

A formula specifying the model.

-
data
+
data +

A data frame in which the variables specified in the formula will be found. If missing, the variables are searched for in the standard way.

-
...
+
... +

arguments passed to stats::aov(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

ard_stats_aov(AGE ~ ARM, data = cards::ADSL)
 #> {cards} data frame: 5 x 8
 #>   variable   context stat_name stat_label   stat fmt_fn
@@ -81,17 +128,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_chisq_test.html b/main/reference/ard_stats_chisq_test.html index ec282d01..90841bcc 100644 --- a/main/reference/ard_stats_chisq_test.html +++ b/main/reference/ard_stats_chisq_test.html @@ -1,7 +1,30 @@ - -ARD Chi-squared Test — ard_stats_chisq_test • cardx + + + + + + +ARD Chi-squared Test — ard_stats_chisq_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,41 +78,51 @@
-

Usage

+

Usage +

ard_stats_chisq_test(data, by, variables, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame.

-
by
+
by +

(tidy-select)
column name to compare by.

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent tests will be computed for each variable.

-
...
+
... +

additional arguments passed to chisq.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cards::ADSL |>
   ard_stats_chisq_test(by = "ARM", variables = "AGEGR1")
 #> {cards} data frame: 9 x 9
@@ -102,17 +150,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_fisher_test.html b/main/reference/ard_stats_fisher_test.html index 43c86041..fb229479 100644 --- a/main/reference/ard_stats_fisher_test.html +++ b/main/reference/ard_stats_fisher_test.html @@ -1,7 +1,30 @@ - -ARD Fisher's Exact Test — ard_stats_fisher_test • cardx + + + + + + +ARD Fisher's Exact Test — ard_stats_fisher_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,46 +78,57 @@
-

Usage

+

Usage +

ard_stats_fisher_test(data, by, variables, conf.level = 0.95, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame.

-
by
+
by +

(tidy-select)
column name to compare by

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent tests will be computed for each variable.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

additional arguments passed to fisher.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cards::ADSL[1:30, ] |>
   ard_stats_fisher_test(by = "ARM", variables = "AGEGR1")
 #> {cards} data frame: 12 x 9
@@ -100,17 +149,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_kruskal_test.html b/main/reference/ard_stats_kruskal_test.html index 3e56dfe8..83cfe270 100644 --- a/main/reference/ard_stats_kruskal_test.html +++ b/main/reference/ard_stats_kruskal_test.html @@ -1,7 +1,30 @@ - -ARD Kruskal-Wallis Test — ard_stats_kruskal_test • cardx + + + + + + +ARD Kruskal-Wallis Test — ard_stats_kruskal_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,37 +78,46 @@
-

Usage

+

Usage +

ard_stats_kruskal_test(data, by, variables)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame.

-
by
+
by +

(tidy-select)
column name to compare by.

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent tests will be computed for each variable.

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cards::ADSL |>
   ard_stats_kruskal_test(by = "ARM", variables = "AGE")
 #> {cards} data frame: 4 x 9
@@ -83,17 +130,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_mcnemar_test.html b/main/reference/ard_stats_mcnemar_test.html index 237e6a6c..26424e3d 100644 --- a/main/reference/ard_stats_mcnemar_test.html +++ b/main/reference/ard_stats_mcnemar_test.html @@ -1,15 +1,38 @@ - -ARD McNemar's Test — ard_stats_mcnemar_test • cardx + + + + + +ARD McNemar's Test — ard_stats_mcnemar_test • cardx + + + + + + + + + + + + + +"> + + + + + Skip to contents @@ -25,12 +48,27 @@ + + @@ -44,59 +82,74 @@

Analysis results data for McNemar's statistical test. -We have two functions depending on the structure of the data.

  • ard_stats_mcnemar_test() is the structure expected by stats::mcnemar.test()

  • +We have two functions depending on the structure of the data.

    +
      +
    • ard_stats_mcnemar_test() is the structure expected by stats::mcnemar.test()

    • ard_stats_mcnemar_test_long() is one row per ID per group

    • -
+ +
-

Usage

+

Usage +

ard_stats_mcnemar_test(data, by, variables, ...)
 
 ard_stats_mcnemar_test_long(data, by, variables, id, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
by
+
by +

(tidy-select)
column name to compare by.

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent tests will be computed for each variable.

-
...
+
... +

arguments passed to stats::mcnemar.test(...)

-
id
+
id +

(tidy-select)
column name of the subject or participant ID

-
+ +
-

Value

+

Value +

ARD data frame

-

Details

+

Details +

For the ard_stats_mcnemar_test() function, the data is expected to be one row per subject. The data is passed as stats::mcnemar.test(x = data[[variable]], y = data[[by]], ...). Please use table(x = data[[variable]], y = data[[by]]) to check the contingency table.

-

Examples

+

Examples +

cards::ADSL |>
   ard_stats_mcnemar_test(by = "SEX", variables = "EFFFL")
 #> {cards} data frame: 5 x 9
@@ -129,17 +182,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_mood_test.html b/main/reference/ard_stats_mood_test.html index aede1077..ea0948e0 100644 --- a/main/reference/ard_stats_mood_test.html +++ b/main/reference/ard_stats_mood_test.html @@ -1,7 +1,30 @@ - -ARD Mood Test — ard_stats_mood_test • cardx + + + + + + +ARD Mood Test — ard_stats_mood_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,46 +78,57 @@
-

Usage

+

Usage +

ard_stats_mood_test(data, by, variables, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
by
+
by +

(tidy-select)
column name to compare by.

-
variables
+
variables +

(tidy-select)
column name to be compared. Independent tests will be run for each variable.

-
...
+
... +

arguments passed to mood.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Details

+

Details +

For the ard_stats_mood_test() function, the data is expected to be one row per subject. The data is passed as mood.test(data[[variable]] ~ data[[by]], ...).

-

Examples

+

Examples +

cards::ADSL |>
   ard_stats_mood_test(by = "SEX", variables = "AGE")
 #> {cards} data frame: 4 x 9
@@ -92,17 +141,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_oneway_test.html b/main/reference/ard_stats_oneway_test.html index 80ff68a4..39a1864d 100644 --- a/main/reference/ard_stats_oneway_test.html +++ b/main/reference/ard_stats_oneway_test.html @@ -1,7 +1,30 @@ - -ARD One-way Test — ard_stats_oneway_test • cardx + + + + + + +ARD One-way Test — ard_stats_oneway_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,37 +78,46 @@
-

Usage

+

Usage +

ard_stats_oneway_test(formula, data, ...)
-

Arguments

+

Arguments +

-
formula
+
+
formula +

a formula of the form lhs ~ rhs where lhs gives the sample values and rhs the corresponding groups.

-
data
+
data +

an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula).

-
...
+
... +

additional arguments passed to oneway.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

ard_stats_oneway_test(AGE ~ ARM, data = cards::ADSL)
 #> {cards} data frame: 6 x 9
 #>   group1 variable   context stat_name stat_label      stat
@@ -84,17 +131,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_poisson_test.html b/main/reference/ard_stats_poisson_test.html index 03266bdf..5b85f5c3 100644 --- a/main/reference/ard_stats_poisson_test.html +++ b/main/reference/ard_stats_poisson_test.html @@ -1,7 +1,30 @@ - -ARD Poisson Test — ard_stats_poisson_test • cardx + + + + + + +ARD Poisson Test — ard_stats_poisson_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,7 +78,8 @@
-

Usage

+

Usage +

ard_stats_poisson_test(
   data,
   variables,
@@ -52,53 +91,67 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
variables
+
variables +

(tidy-select)
names of the event and time variables (in that order) to be used in computations. Must be of length 2.

-
na.rm
+
na.rm +

(scalar logical)
whether missing values should be removed before computations. Default is TRUE.

-
by
+
by +

(tidy-select)
optional column name to compare by.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

arguments passed to poisson.test().

-
+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

Details

+

Details +

-
  • For the ard_stats_poisson_test() function, the data is expected to be one row per subject.

  • +
      +
    • For the ard_stats_poisson_test() function, the data is expected to be one row per subject.

    • If by is not specified, an exact Poisson test of the rate parameter will be performed. Otherwise, a Poisson comparison of two rate parameters will be performed on the levels of by. If by has more than 2 levels, an error will occur.

    • -
+ +
-

Examples

+

Examples +

# Exact test of rate parameter against null hypothesis
 cards::ADTTE |>
   ard_stats_poisson_test(variables = c(CNSR, AVAL))
@@ -136,17 +189,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_prop_test.html b/main/reference/ard_stats_prop_test.html index 3849915d..ce6c1f08 100644 --- a/main/reference/ard_stats_prop_test.html +++ b/main/reference/ard_stats_prop_test.html @@ -1,5 +1,28 @@ - -ARD 2-sample proportion test — ard_stats_prop_test • cardx + + + + + + +ARD 2-sample proportion test — ard_stats_prop_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,46 +75,57 @@
-

Usage

+

Usage +

ard_stats_prop_test(data, by, variables, conf.level = 0.95, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame.

-
by
+
by +

(tidy-select)
column name to compare by

-
variables
+
variables +

(tidy-select)
column names to be compared. Must be a binary column coded as TRUE/FALSE or 1/0. Independent tests will be computed for each variable.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

arguments passed to prop.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

mtcars |>
   ard_stats_prop_test(by = vs, variables = am)
 #> {cards} data frame: 13 x 9
@@ -98,17 +147,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_t_test.html b/main/reference/ard_stats_t_test.html index 2213a2af..cac33ce8 100644 --- a/main/reference/ard_stats_t_test.html +++ b/main/reference/ard_stats_t_test.html @@ -1,5 +1,28 @@ - -ARD t-test — ard_stats_t_test • cardx + + + + + + +ARD t-test — ard_stats_t_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,52 +75,64 @@
-

Usage

+

Usage +

ard_stats_t_test(data, variables, by = NULL, conf.level = 0.95, ...)
 
 ard_stats_paired_t_test(data, by, variables, id, conf.level = 0.95, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent t-tests will be computed for each variable.

-
by
+
by +

(tidy-select)
optional column name to compare by.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

arguments passed to t.test()

-
id
+
id +

(tidy-select)
column name of the subject or participant ID

-
+ +
-

Value

+

Value +

ARD data frame

-

Details

+

Details +

For the ard_stats_t_test() function, the data is expected to be one row per subject. The data is passed as t.test(data[[variable]] ~ data[[by]], paired = FALSE, ...).

For the ard_stats_paired_t_test() function, the data is expected to be one row @@ -93,7 +143,8 @@

Details
-

Examples

+

Examples +

cards::ADSL |>
   dplyr::filter(ARM %in% c("Placebo", "Xanomeline High Dose")) |>
   ard_stats_t_test(by = ARM, variables = c(AGE, BMIBL))
@@ -138,17 +189,19 @@ 

Examples

+ +

- + + - + + diff --git a/main/reference/ard_stats_t_test_onesample.html b/main/reference/ard_stats_t_test_onesample.html index 1677efbf..8e145d70 100644 --- a/main/reference/ard_stats_t_test_onesample.html +++ b/main/reference/ard_stats_t_test_onesample.html @@ -1,7 +1,30 @@ - -ARD one-sample t-test — ard_stats_t_test_onesample • cardx + + + + + + +ARD one-sample t-test — ard_stats_t_test_onesample • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,7 +78,8 @@
-

Usage

+

Usage +

ard_stats_t_test_onesample(
   data,
   variables,
@@ -51,41 +90,51 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
variables
+
variables +

(tidy-select)
column names to be analyzed. Independent t-tests will be computed for each variable.

-
by
+
by +

(tidy-select)
optional column name to stratify results by.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

arguments passed to t.test()

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cards::ADSL |>
   ard_stats_t_test_onesample(by = ARM, variables = AGE)
 #> {cards} data frame: 30 x 10
@@ -106,17 +155,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_stats_wilcox_test.html b/main/reference/ard_stats_wilcox_test.html index 8ba6f2aa..1d52bac2 100644 --- a/main/reference/ard_stats_wilcox_test.html +++ b/main/reference/ard_stats_wilcox_test.html @@ -1,5 +1,28 @@ - -ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test • cardx + + + + + + +ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,52 +75,64 @@
-

Usage

+

Usage +

ard_stats_wilcox_test(data, variables, by = NULL, conf.level = 0.95, ...)
 
 ard_stats_paired_wilcox_test(data, by, variables, id, conf.level = 0.95, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent tests will be computed for each variable.

-
by
+
by +

(tidy-select)
optional column name to compare by.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

arguments passed to wilcox.test(...)

-
id
+
id +

(tidy-select)
column name of the subject or participant ID.

-
+ +
-

Value

+

Value +

ARD data frame

-

Details

+

Details +

For the ard_stats_wilcox_test() function, the data is expected to be one row per subject. The data is passed as wilcox.test(data[[variable]] ~ data[[by]], paired = FALSE, ...).

For the ard_stats_paired_wilcox_test() function, the data is expected to be one row @@ -93,7 +143,8 @@

Details
-

Examples

+

Examples +

cards::ADSL |>
   dplyr::filter(ARM %in% c("Placebo", "Xanomeline High Dose")) |>
   ard_stats_wilcox_test(by = "ARM", variables = "AGE")
@@ -138,17 +189,19 @@ 

Examples

+ +

- + + - + + diff --git a/main/reference/ard_stats_wilcox_test_onesample.html b/main/reference/ard_stats_wilcox_test_onesample.html index b4d82921..788e601b 100644 --- a/main/reference/ard_stats_wilcox_test_onesample.html +++ b/main/reference/ard_stats_wilcox_test_onesample.html @@ -1,7 +1,30 @@ - -ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample • cardx + + + + + + +ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,7 +78,8 @@
-

Usage

+

Usage +

ard_stats_wilcox_test_onesample(
   data,
   variables,
@@ -51,41 +90,51 @@ 

Usage

-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame. See below for details.

-
variables
+
variables +

(tidy-select)
column names to be analyzed. Independent Wilcox Rank-sum tests will be computed for each variable.

-
by
+
by +

(tidy-select)
optional column name to stratify results by.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
...
+
... +

arguments passed to wilcox.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cards::ADSL |>
   ard_stats_wilcox_test_onesample(by = ARM, variables = AGE)
 #> {cards} data frame: 27 x 10
@@ -106,17 +155,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_survey_svychisq.html b/main/reference/ard_survey_svychisq.html index 6f8f1f01..dd2dd8f9 100644 --- a/main/reference/ard_survey_svychisq.html +++ b/main/reference/ard_survey_svychisq.html @@ -1,7 +1,30 @@ - -ARD Survey Chi-Square Test — ard_survey_svychisq • cardx + + + + + + +ARD Survey Chi-Square Test — ard_survey_svychisq • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,48 +78,59 @@
-

Usage

+

Usage +

ard_survey_svychisq(data, by, variables, statistic = "F", ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a survey design object often created with the {survey} package

-
by
+
by +

(tidy-select)
column name to compare by.

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent tests will be computed for each variable.

-
statistic
+
statistic +

(character)
statistic used to estimate Chisq p-value. Default is the Rao-Scott second-order correction ("F"). See survey::svychisq for available statistics options.

-
...
+
... +

arguments passed to survey::svychisq().

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

data(api, package = "survey")
 dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc)
 
@@ -97,17 +146,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_survey_svyranktest.html b/main/reference/ard_survey_svyranktest.html index 72d48bde..e5ce6c1f 100644 --- a/main/reference/ard_survey_svyranktest.html +++ b/main/reference/ard_survey_svyranktest.html @@ -1,5 +1,28 @@ - -ARD Survey rank test — ard_survey_svyranktest • cardx + + + + + + +ARD Survey rank test — ard_survey_svyranktest • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,46 +75,57 @@
-

Usage

+

Usage +

ard_survey_svyranktest(data, by, variables, test, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a survey design object often created with survey::svydesign()

-
by
+
by +

(tidy-select)
column name to compare by

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent tests will be run for each variable.

-
test
+
test +

(string)
a string to denote which rank test to use: "wilcoxon", "vanderWaerden", "median", "KruskalWallis"

-
...
+
... +

arguments passed to survey::svyranktest()

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

data(api, package = "survey")
 dclus2 <- survey::svydesign(id = ~ dnum + snum, fpc = ~ fpc1 + fpc2, data = apiclus2)
 
@@ -123,17 +172,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_survey_svyttest.html b/main/reference/ard_survey_svyttest.html index 9fb49686..d4d3e215 100644 --- a/main/reference/ard_survey_svyttest.html +++ b/main/reference/ard_survey_svyttest.html @@ -1,5 +1,28 @@ - -ARD Survey t-test — ard_survey_svyttest • cardx + + + + + + +ARD Survey t-test — ard_survey_svyttest • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,46 +75,57 @@
-

Usage

+

Usage +

ard_survey_svyttest(data, by, variables, conf.level = 0.95, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a survey design object often created with survey::svydesign()

-
by
+
by +

(tidy-select)
column name to compare by

-
variables
+
variables +

(tidy-select)
column names to be compared. Independent tests will be run for each variable.

-
conf.level
+
conf.level +

(double)
confidence level of the returned confidence interval. Must be between c(0, 1). Default is 0.95

-
...
+
... +

arguments passed to survey::svyttest()

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

data(api, package = "survey")
 dclus2 <- survey::svydesign(id = ~ dnum + snum, fpc = ~ fpc1 + fpc2, data = apiclus2)
 
@@ -96,17 +145,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_survival_survdiff.html b/main/reference/ard_survival_survdiff.html index e7eea6eb..1dc6e7c3 100644 --- a/main/reference/ard_survival_survdiff.html +++ b/main/reference/ard_survival_survdiff.html @@ -1,5 +1,28 @@ - -ARD for Difference in Survival — ard_survival_survdiff • cardx + + + + + + +ARD for Difference in Survival — ard_survival_survdiff • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,40 +75,50 @@
-

Usage

+

Usage +

ard_survival_survdiff(formula, data, rho = 0, ...)
-

Arguments

+

Arguments +

-
formula
+
+
formula +

(formula)
a formula

-
data
+
data +

(data.frame)
a data frame

-
rho
+
rho +

(scalar numeric)
numeric scalar passed to survival::survdiff(rho). Default is rho=0.

-
...
+
... +

additional arguments passed to survival::survdiff()

-
+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

Examples

+

Examples +

library(survival)
 library(ggsurvfit)
 #> Loading required package: ggplot2
@@ -86,17 +134,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_survival_survfit.html b/main/reference/ard_survival_survfit.html index 7e80104b..cb4e9c5b 100644 --- a/main/reference/ard_survival_survfit.html +++ b/main/reference/ard_survival_survfit.html @@ -1,7 +1,30 @@ - -ARD Survival Estimates — ard_survival_survfit • cardx + + + + + + +ARD Survival Estimates — ard_survival_survfit • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,7 +78,8 @@
-

Usage

+

Usage +

ard_survival_survfit(x, ...)
 
 # S3 method for class 'survfit'
@@ -60,72 +99,110 @@ 

Usage

-

Arguments

+

Arguments +

-
x
+
+
x +

(survfit or data.frame)
an object of class survfit created with survival::survfit() or a data frame. See below for details.

-
...
+
... +

These dots are for future extensions and must be empty.

-
times
+
times +

(numeric)
a vector of times for which to return survival probabilities.

-
probs
+
probs +

(numeric)
a vector of probabilities with values in (0,1) specifying the survival quantiles to return.

-
type
-

(string or NULL)
+

type +
+
+

(string or NULL)
type of statistic to report. Available for Kaplan-Meier time estimates only, otherwise type is ignored. Default is NULL. -Must be one of the following:

typetransformation
"survival"x
"risk"1 - x
"cumhaz"-log(x)
- - -
y
+Must be one of the following:

+ + + + + + + + + + + + + + + + + +
typetransformation
"survival"x
"risk"1 - x
"cumhaz"-log(x)
+ + + +
y +

(Surv or string)
an object of class Surv created using survival::Surv(). This object will be passed as the left-hand side of the formula constructed and passed to survival::survfit(). This object can also be passed as a string.

-
variables
+
variables +

(character)
stratification variables to be passed as the right-hand side of the formula constructed and passed to survival::survfit().

-
method.args
+
method.args +

(named list)
named list of arguments that will be passed to survival::survfit().

-
+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

Details

+

Details +

-
  • Only one of either the times or probs parameters can be specified.

  • +
      +
    • Only one of either the times or probs parameters can be specified.

    • Times should be provided using the same scale as the time variable used to fit the provided survival fit model.

    • -
+ +
-

Formula Specification

+

Formula Specification +

When passing a survival::survfit() object to ard_survival_survfit(), the survfit() call must use an evaluated formula and not a stored formula. Including a proper formula in the call allows the function to accurately identify all variables included in the estimation. See below for examples:

-

library(cardx)
+

+
+
library(cardx)
 library(survival)
 
 # include formula in `survfit()` call
@@ -133,11 +210,14 @@ 

Formula Specification # you can also pass a data frame to `ard_survival_survfit()` as well. lung |> - ard_survival_survfit(y = Surv(time, status), variables = "sex", time = 500)

+ ard_survival_survfit(y = Surv(time, status), variables = "sex", time = 500)
+

+

You cannot, however, pass a stored formula, e.g. survfit(my_formula, lung)

-

Variable Classes

+

Variable Classes +

When the survfit method is called, the class of the stratifying variables @@ -147,7 +227,8 @@

Variable Classes
-

Examples

+

Examples +

library(survival)
 library(ggsurvfit)
 
@@ -249,17 +330,19 @@ 

Examples

+ +

- + + - + + diff --git a/main/reference/ard_survival_survfit_diff.html b/main/reference/ard_survival_survfit_diff.html index 9f4b5936..882949ff 100644 --- a/main/reference/ard_survival_survfit_diff.html +++ b/main/reference/ard_survival_survfit_diff.html @@ -1,7 +1,30 @@ - -ARD Survival Differences — ard_survival_survfit_diff • cardx + + + + + + +ARD Survival Differences — ard_survival_survfit_diff • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,36 +78,45 @@
-

Usage

+

Usage +

ard_survival_survfit_diff(x, times, conf.level = 0.95)
-

Arguments

+

Arguments +

-
x
+
+
x +

(survift)
object of class 'survfit' typically created with survival::survfit()

-
times
+
times +

(numeric)
a vector of times for which to return survival probabilities.

-
conf.level
+
conf.level +

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

-
+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

Examples

+

Examples +

library(ggsurvfit)
 library(survival)
 
@@ -104,17 +151,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/ard_total_n.survey.design.html b/main/reference/ard_total_n.survey.design.html index a20fddd7..0e092c12 100644 --- a/main/reference/ard_total_n.survey.design.html +++ b/main/reference/ard_total_n.survey.design.html @@ -1,7 +1,30 @@ - -ARD Total N — ard_total_n.survey.design • cardx + + + + + + +ARD Total N — ard_total_n.survey.design • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,31 +78,39 @@
-

Usage

+

Usage +

# S3 method for class 'survey.design'
 ard_total_n(data, ...)
-

Arguments

+

Arguments +

-
data
+
+
data +

(survey.design)
a design object often created with survey::svydesign().

-
...
+
... +

These dots are for future extensions and must be empty.

-
+ +
-

Value

+

Value +

an ARD data frame of class 'card'

-

Examples

+

Examples +

svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq)
 
 ard_total_n(svy_titanic)
@@ -76,17 +122,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/cardx-package.html b/main/reference/cardx-package.html index 961b4293..6197d0fb 100644 --- a/main/reference/cardx-package.html +++ b/main/reference/cardx-package.html @@ -1,7 +1,30 @@ - -cardx: Extra Analysis Results Data Utilities — cardx-package • cardx + + + + + + +cardx: Extra Analysis Results Data Utilities — cardx-package • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -41,32 +79,46 @@
-

Author

+

Author +

Maintainer: Daniel Sjoberg danield.sjoberg@gmail.com

-

Authors:

+ +

Other contributors:

+
    +
  • F. Hoffmann-La Roche AG [copyright holder, funder]

  • +
+ + + - + + - + + diff --git a/main/reference/construction_helpers.html b/main/reference/construction_helpers.html index 2039f114..fd9bade3 100644 --- a/main/reference/construction_helpers.html +++ b/main/reference/construction_helpers.html @@ -1,5 +1,28 @@ - -Construction Helpers — construction_helpers • cardx + + + + + + +Construction Helpers — construction_helpers • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,7 +75,8 @@
-

Usage

+

Usage +

construct_model(data, ...)
 
 # S3 method for class 'data.frame'
@@ -77,93 +116,116 @@ 

Usage

-

Arguments

+

Arguments +

-
data
-
  • construct_model.data.frame() (data.frame) a data frame

  • +
    +
    data +
    +
      +
    • construct_model.data.frame() (data.frame) a data frame

    • construct_model.survey.design() (survey.design) a survey design object

    -
    ...
    +
    ... +

    These dots are for future extensions and must be empty.

    -
    formula
    +
    formula +

    (formula)
    a formula

    -
    method
    +
    method +

    (string)
    string of function naming the function to be called, e.g. "glm". If function belongs to a library that is not attached, the package name must be specified in the package argument.

    -
    method.args
    -

    (named list)
    +

    method.args +
    +
    +

    (named list)
    named list of arguments that will be passed to method.

    Note that this list may contain non-standard evaluation components. If you are wrapping this function in other functions, the argument must be passed in a way that does not evaluate the list, e.g. -using rlang's embrace operator {{ . }}.

    +using rlang's embrace operator {{ . }}.

    +
-
package
+
package +

(string)
string of package name that will be temporarily loaded when function specified in method is executed.

-
env
+
env +

The environment in which to evaluate expr. This environment is not applicable for quosures because they have their own environments.

-
termlabels
+
termlabels +

character vector giving the right-hand side of a model formula. Cannot be zero-length.

-
response
+
response +

character string, symbol or call giving the left-hand side of a model formula, or NULL.

-
intercept
+
intercept +

logical: should the formula have an intercept?

-
x
+
x +

(character)
character vector, typically of variable names

-
pattern, pattern_term, pattern_response
+
pattern, pattern_term, pattern_response +

DEPRECATED

-
+ +
-

Value

+

Value +

depends on the calling function

-

Details

+

Details +

-
  • construct_model(): Builds models of the form method(data = data, formula = formula, method.args!!!). +

      +
    • construct_model(): Builds models of the form method(data = data, formula = formula, method.args!!!). If the package argument is specified, that package is temporarily attached when the model is evaluated.

    • reformulate2(): This is a copy of reformulate() except that variable names that contain a space are wrapped in backticks.

    • bt(): Adds backticks to a character vector.

    • bt_strip(): Removes backticks from a string if it begins and ends with a backtick.

    • -
+ +
-

Examples

+

Examples +

construct_model(
   data = mtcars,
   formula = am ~ mpg + (1 | vs),
@@ -198,17 +260,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-check_dichotomous_value.html b/main/reference/dot-check_dichotomous_value.html index 22f9051d..70a7df11 100644 --- a/main/reference/dot-check_dichotomous_value.html +++ b/main/reference/dot-check_dichotomous_value.html @@ -1,5 +1,28 @@ - -Perform Value Checks — .check_dichotomous_value • cardx + + + + + + +Perform Value Checks — .check_dichotomous_value • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,46 +75,56 @@
-

Usage

+

Usage +

.check_dichotomous_value(data, value)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame

-
value
+
value +

(named list)
a named list

-
+ +
-

Value

+

Value +

returns invisible if check is successful, throws an error message if not.

-

Examples

+

Examples +

cardx:::.check_dichotomous_value(mtcars, list(cyl = 4))
 
+ + - + + - + + diff --git a/main/reference/dot-extract_wald_results.html b/main/reference/dot-extract_wald_results.html index 27e16413..0b017df8 100644 --- a/main/reference/dot-extract_wald_results.html +++ b/main/reference/dot-extract_wald_results.html @@ -1,5 +1,28 @@ - -Extract data from wald.test object — .extract_wald_results • cardx + + + + + + +Extract data from wald.test object — .extract_wald_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,35 +75,43 @@
-

Usage

+

Usage +

.extract_wald_results(wald_test)
-

Arguments

+

Arguments +

-
wald_test
+
+
wald_test +

(data.frame)
wald test object object from aod::wald.test()

-
+ +
-

Value

+

Value +

a data frame containing the wald test results.

+ + - + + - + + diff --git a/main/reference/dot-format_cohens_d_results.html b/main/reference/dot-format_cohens_d_results.html index 46ccce84..b803f381 100644 --- a/main/reference/dot-format_cohens_d_results.html +++ b/main/reference/dot-format_cohens_d_results.html @@ -1,5 +1,28 @@ - -Convert Cohen's D Test to ARD — .format_cohens_d_results • cardx + + + + + + +Convert Cohen's D Test to ARD — .format_cohens_d_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,45 +75,56 @@
-

Usage

+

Usage +

.format_cohens_d_results(by, variable, lst_tidy, paired, ...)
-

Arguments

+

Arguments +

-
by
+
+
by +

(string)
by column name

-
variable
+
variable +

(string)
variable column name

-
lst_tidy
+
lst_tidy +

(named list)
list of tidied results constructed with eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$am) |> broom::tidy()).

-
paired
+
paired +

If TRUE, the values of x and y are considered as paired. This produces an effect size that is equivalent to the one-sample effect size on x - y. See also repeated_measures_d() for more options.

-
...
+
... +

passed to cohens_d(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cardx:::.format_cohens_d_results(
   by = "ARM",
   variable = "AGE",
@@ -100,17 +149,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-format_hedges_g_results.html b/main/reference/dot-format_hedges_g_results.html index 5f7646c0..92246ecb 100644 --- a/main/reference/dot-format_hedges_g_results.html +++ b/main/reference/dot-format_hedges_g_results.html @@ -1,5 +1,28 @@ - -Convert Hedge's G Test to ARD — .format_hedges_g_results • cardx + + + + + + +Convert Hedge's G Test to ARD — .format_hedges_g_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,45 +75,56 @@
-

Usage

+

Usage +

.format_hedges_g_results(by, variable, lst_tidy, paired, ...)
-

Arguments

+

Arguments +

-
by
+
+
by +

(string)
by column name

-
variable
+
variable +

(string)
variable column name

-
lst_tidy
+
lst_tidy +

(named list)
list of tidied results constructed with eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$am) |> broom::tidy()).

-
paired
+
paired +

If TRUE, the values of x and y are considered as paired. This produces an effect size that is equivalent to the one-sample effect size on x - y. See also repeated_measures_d() for more options.

-
...
+
... +

passed to hedges_g(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cardx:::.format_hedges_g_results(
   by = "ARM",
   variable = "AGE",
@@ -100,17 +149,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-format_mcnemartest_results.html b/main/reference/dot-format_mcnemartest_results.html index db0f2757..68570700 100644 --- a/main/reference/dot-format_mcnemartest_results.html +++ b/main/reference/dot-format_mcnemartest_results.html @@ -1,5 +1,28 @@ - -Convert McNemar's test to ARD — .format_mcnemartest_results • cardx + + + + + + +Convert McNemar's test to ARD — .format_mcnemartest_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,39 +75,49 @@
-

Usage

+

Usage +

.format_mcnemartest_results(by, variable, lst_tidy, ...)
-

Arguments

+

Arguments +

-
by
+
+
by +

(string)
by column name

-
variable
+
variable +

(string)
variable column name

-
lst_tidy
+
lst_tidy +

(named list)
list of tidied results constructed with eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$am) |> broom::tidy()).

-
...
+
... +

passed to stats::mcnemar.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cardx:::.format_mcnemartest_results(
   by = "ARM",
   variable = "AGE",
@@ -90,17 +138,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-format_moodtest_results.html b/main/reference/dot-format_moodtest_results.html index 3703b71f..24fb0228 100644 --- a/main/reference/dot-format_moodtest_results.html +++ b/main/reference/dot-format_moodtest_results.html @@ -1,5 +1,28 @@ - -Convert mood test results to ARD — .format_moodtest_results • cardx + + + + + + +Convert mood test results to ARD — .format_moodtest_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,39 +75,49 @@
-

Usage

+

Usage +

.format_moodtest_results(by, variable, lst_tidy, ...)
-

Arguments

+

Arguments +

-
by
+
+
by +

(string)
by column name

-
variable
+
variable +

(string)
variable column name

-
lst_tidy
+
lst_tidy +

(named list)
list of tidied results constructed with eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$am) |> broom::tidy()).

-
...
+
... +

passed to mood.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cardx:::.format_moodtest_results(
   by = "SEX",
   variable = "AGE",
@@ -89,17 +137,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-format_poissontest_results.html b/main/reference/dot-format_poissontest_results.html index 1a22fa2c..fbb7920a 100644 --- a/main/reference/dot-format_poissontest_results.html +++ b/main/reference/dot-format_poissontest_results.html @@ -1,5 +1,28 @@ - -Convert Poisson test to ARD — .format_poissontest_results • cardx + + + + + + +Convert Poisson test to ARD — .format_poissontest_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,39 +75,49 @@
-

Usage

+

Usage +

.format_poissontest_results(by = NULL, variables, lst_tidy, ...)
-

Arguments

+

Arguments +

-
by
+
+
by +

(string)
by column name

-
variables
+
variables +

(character)
names of the event and time variables

-
lst_tidy
+
lst_tidy +

(named list)
list of tidied results constructed with eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$am) |> broom::tidy()).

-
...
+
... +

passed to poisson.test()

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cardx:::.format_poissontest_results(
   by = "ARM",
   variables = c("CNSR", "AVAL"),
@@ -95,17 +143,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-format_proptest_results.html b/main/reference/dot-format_proptest_results.html index a55dab4e..02029649 100644 --- a/main/reference/dot-format_proptest_results.html +++ b/main/reference/dot-format_proptest_results.html @@ -1,5 +1,28 @@ - -Convert prop.test to ARD — .format_proptest_results • cardx + + + + + + +Convert prop.test to ARD — .format_proptest_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,49 +75,60 @@
-

Usage

+

Usage +

.format_proptest_results(by, variable, lst_tidy, ...)
-

Arguments

+

Arguments +

-
by
+
+
by +

(string)
by column name

-
variable
+
variable +

(string)
variable column name

-
lst_tidy
+
lst_tidy +

(named list)
list of tidied results constructed with eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$am) |> broom::tidy()).

-
...
+
... +

passed to prop.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

+ + - + + - + + diff --git a/main/reference/dot-format_survfit_results.html b/main/reference/dot-format_survfit_results.html index 5f809352..90a206d9 100644 --- a/main/reference/dot-format_survfit_results.html +++ b/main/reference/dot-format_survfit_results.html @@ -1,5 +1,28 @@ - -Convert Tidied Survival Fit to ARD — .format_survfit_results • cardx + + + + + + +Convert Tidied Survival Fit to ARD — .format_survfit_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,17 +75,20 @@
-

Usage

+

Usage +

.format_survfit_results(tidy_survfit)
-

Value

+

Value +

an ARD data frame of class 'card'

-

Examples

+

Examples +

cardx:::.format_survfit_results(
   broom::tidy(survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE))
 )
@@ -69,17 +110,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-format_ttest_results.html b/main/reference/dot-format_ttest_results.html index e906b540..39fae10d 100644 --- a/main/reference/dot-format_ttest_results.html +++ b/main/reference/dot-format_ttest_results.html @@ -1,5 +1,28 @@ - -Convert t-test to ARD — .format_ttest_results • cardx + + + + + + +Convert t-test to ARD — .format_ttest_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,44 +75,55 @@
-

Usage

+

Usage +

.format_ttest_results(by = NULL, variable, lst_tidy, paired, ...)
-

Arguments

+

Arguments +

-
by
+
+
by +

(string)
by column name

-
variable
+
variable +

(string)
variable column name

-
lst_tidy
+
lst_tidy +

(named list)
list of tidied results constructed with eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$am) |> broom::tidy()).

-
paired
+
paired +

a logical indicating whether you want a paired t-test.

-
...
+
... +

passed to t.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

cardx:::.format_ttest_results(
   by = "ARM",
   variable = "AGE",
@@ -105,17 +154,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-format_wilcoxtest_results.html b/main/reference/dot-format_wilcoxtest_results.html index d30fea62..b4025657 100644 --- a/main/reference/dot-format_wilcoxtest_results.html +++ b/main/reference/dot-format_wilcoxtest_results.html @@ -1,5 +1,28 @@ - -Convert Wilcoxon test to ARD — .format_wilcoxtest_results • cardx + + + + + + +Convert Wilcoxon test to ARD — .format_wilcoxtest_results • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,43 +75,54 @@
-

Usage

+

Usage +

.format_wilcoxtest_results(by = NULL, variable, lst_tidy, paired, ...)
-

Arguments

+

Arguments +

-
by
+
+
by +

(string)
by column name

-
variable
+
variable +

(string)
variable column name

-
lst_tidy
+
lst_tidy +

(named list)
list of tidied results constructed with eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$am) |> broom::tidy()).

-
paired
+
paired +

a logical indicating whether you want a paired test.

-
...
+
... +

passed to stats::wilcox.test(...)

-
+ +
-

Value

+

Value +

ARD data frame

-

Examples

+

Examples +

# Pre-processing ADSL to have grouping factor (ARM here) with 2 levels
 ADSL <- cards::ADSL |>
   dplyr::filter(ARM %in% c("Placebo", "Xanomeline High Dose")) |>
@@ -107,17 +156,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-paired_data_pivot_wider.html b/main/reference/dot-paired_data_pivot_wider.html index 6c4a49e1..a7f41bd2 100644 --- a/main/reference/dot-paired_data_pivot_wider.html +++ b/main/reference/dot-paired_data_pivot_wider.html @@ -1,5 +1,28 @@ - -Convert long paired data to wide — .paired_data_pivot_wider • cardx + + + + + + +Convert long paired data to wide — .paired_data_pivot_wider • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,37 +75,47 @@
-

Usage

+

Usage +

.paired_data_pivot_wider(data, by, variable, id)
-

Arguments

+

Arguments +

-
data
+
+
data +

(data.frame)
a data frame that is one line per subject per group

-
by
+
by +

(string)
by column name

-
variable
+
variable +

(string)
variable column name

-
id
+
id +

(string)
subject id column name

-
+ +
-

Value

+

Value +

a wide data frame

-

Examples

+

Examples +

cards::ADSL[c("ARM", "AGE")] |>
   dplyr::filter(ARM %in% c("Placebo", "Xanomeline High Dose")) |>
   dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |>
@@ -90,17 +138,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-process_nested_list_as_df.html b/main/reference/dot-process_nested_list_as_df.html index d0c42eda..f6c433c1 100644 --- a/main/reference/dot-process_nested_list_as_df.html +++ b/main/reference/dot-process_nested_list_as_df.html @@ -1,7 +1,30 @@ - -Convert Nested Lists to Column — .process_nested_list_as_df • cardx + + + + + + +Convert Nested Lists to Column — .process_nested_list_as_df • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -17,12 +40,27 @@ + + @@ -40,41 +78,51 @@
-

Usage

+

Usage +

.process_nested_list_as_df(x, arg, new_column, unlist = FALSE)
-

Arguments

+

Arguments +

-
x
+
+
x +

(data.frame)
result data frame

-
arg
+
arg +

(list)
the nested list

-
new_column
+
new_column +

(string)
new column name

-
unlist
+
unlist +

(logical)
whether to fully unlist final results

-
+ +
-

Value

+

Value +

a data frame

-

Examples

+

Examples +

ard <- ard_categorical(cards::ADSL, by = "ARM", variables = "AGEGR1")
 
 cardx:::.process_nested_list_as_df(ard, NULL, "new_col")
@@ -96,17 +144,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-process_survfit_probs.html b/main/reference/dot-process_survfit_probs.html index 182d078c..ad0b13db 100644 --- a/main/reference/dot-process_survfit_probs.html +++ b/main/reference/dot-process_survfit_probs.html @@ -1,5 +1,28 @@ - -Process Survival Fit For Quantile Estimates — .process_survfit_probs • cardx + + + + + + +Process Survival Fit For Quantile Estimates — .process_survfit_probs • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,31 +75,39 @@
-

Usage

+

Usage +

.process_survfit_probs(x, probs)
-

Arguments

+

Arguments +

-
x
+
+
x +

(survfit or data.frame)
an object of class survfit created with survival::survfit() or a data frame. See below for details.

-
probs
+
probs +

(numeric)
a vector of probabilities with values in (0,1) specifying the survival quantiles to return.

-
+ +
-

Value

+

Value +

a tibble

-

Examples

+

Examples +

survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE) |>
   cardx:::.process_survfit_probs(probs = c(0.25, 0.75))
 #> # A tibble: 6 × 6
@@ -76,17 +122,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-process_survfit_time.html b/main/reference/dot-process_survfit_time.html index 81de09bf..fdbd84a7 100644 --- a/main/reference/dot-process_survfit_time.html +++ b/main/reference/dot-process_survfit_time.html @@ -1,5 +1,28 @@ - -Process Survival Fit For Time Estimates — .process_survfit_time • cardx + + + + + + +Process Survival Fit For Time Estimates — .process_survfit_time • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,43 +75,73 @@
-

Usage

+

Usage +

.process_survfit_time(x, times, type, start.time = NULL)
-

Arguments

+

Arguments +

-
x
+
+
x +

(survfit or data.frame)
an object of class survfit created with survival::survfit() or a data frame. See below for details.

-
times
+
times +

(numeric)
a vector of times for which to return survival probabilities.

-
type
-

(string or NULL)
+

type +
+
+

(string or NULL)
type of statistic to report. Available for Kaplan-Meier time estimates only, otherwise type is ignored. Default is NULL. -Must be one of the following:

typetransformation
"survival"x
"risk"1 - x
"cumhaz"-log(x)
- - -
start.time
+Must be one of the following:

+ + + + + + + + + + + + + + + + + +
typetransformation
"survival"x
"risk"1 - x
"cumhaz"-log(x)
+ + + +
start.time +

(numeric)
default starting time. See survival::survfit0() for more details.

-
+ +
-

Value

+

Value +

a tibble

-

Examples

+

Examples +

survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE) |>
   cardx:::.process_survfit_time(times = c(60, 180), type = "risk")
 #> # A tibble: 6 × 8
@@ -88,17 +156,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-strata_normal_quantile.html b/main/reference/dot-strata_normal_quantile.html index 16103479..3a5ac635 100644 --- a/main/reference/dot-strata_normal_quantile.html +++ b/main/reference/dot-strata_normal_quantile.html @@ -1,9 +1,32 @@ - -Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile • cardx + + + + + +Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile • cardx + + + + + + + + + + + + + +proportions for each strata are unequal."> + + + + + Skip to contents @@ -19,12 +42,27 @@ + + @@ -43,37 +81,46 @@
-

Usage

+

Usage +

.strata_normal_quantile(vars, weights, conf.level)
-

Arguments

+

Arguments +

-
weights
+
+
weights +

(numeric or NULL)
weights for each level of the strata. If NULL, they are estimated using the iterative algorithm that minimizes the weighted squared length of the confidence interval.

-
conf.level
+
conf.level +

(numeric)
a scalar in (0, 1) indicating the confidence level. Default is 0.95

-
+ +
-

Value

+

Value +

Stratified quantile.

-

See also

+

See also +

-

Examples

+

Examples +

strata_data <- table(data.frame(
   "f1" = sample(c(TRUE, FALSE), 100, TRUE),
   "f2" = sample(c("x", "y", "z"), 100, TRUE),
@@ -89,17 +136,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-unique_and_sorted.html b/main/reference/dot-unique_and_sorted.html index f734f1b9..c3d11cbd 100644 --- a/main/reference/dot-unique_and_sorted.html +++ b/main/reference/dot-unique_and_sorted.html @@ -1,11 +1,34 @@ - -ARD-flavor of unique() — .unique_and_sorted • cardx + + + + + +ARD-flavor of unique() — .unique_and_sorted • cardx + + + + + + + + + + + + + +both levels are not observed."> + + + + + Skip to contents @@ -21,12 +44,27 @@ + + @@ -46,26 +84,33 @@
-

Usage

+

Usage +

.unique_and_sorted(x, useNA = c("no", "always"))
-

Arguments

+

Arguments +

-
x
+
+
x +

(any)
a vector

-
+ +
-

Value

+

Value +

a vector

-

Examples

+

Examples +

cards:::.unique_and_sorted(factor(letters[c(5, 5:1)], levels = letters))
 #>  [1] a b c d e f g h i j k l m n o p q r s t u v w x y z
 #> Levels: a b c d e f g h i j k l m n o p q r s t u v w x y z
@@ -78,17 +123,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/dot-update_weights_strat_wilson.html b/main/reference/dot-update_weights_strat_wilson.html index 75a4bbe1..9efa9d3d 100644 --- a/main/reference/dot-update_weights_strat_wilson.html +++ b/main/reference/dot-update_weights_strat_wilson.html @@ -1,9 +1,32 @@ - -Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson • cardx + + + + + +Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson • cardx + + + + + + + + + + + + + +weighted squared length of the confidence interval."> + + + + + Skip to contents @@ -19,19 +42,35 @@ + +
@@ -43,7 +82,8 @@
-

Usage

+

Usage +

.update_weights_strat_wilson(
   vars,
   strata_qnorm,
@@ -56,51 +96,64 @@ 

Usage

-

Arguments

+

Arguments +

-
vars
+
+
vars +

(numeric)
normalized proportions for each strata.

-
strata_qnorm
+
strata_qnorm +

(numeric)
initial estimation with identical weights of the quantiles.

-
initial_weights
+
initial_weights +

(numeric)
initial weights used to calculate strata_qnorm. This can be optimized in the future if we need to estimate better initial weights.

-
n_per_strata
+
n_per_strata +

(numeric)
number of elements in each strata.

-
max.iterations
+
max.iterations +

(count)
maximum number of iterations to be tried. Convergence is always checked.

-
conf.level
+
conf.level +

(numeric)
a scalar in (0, 1) indicating the confidence level. Default is 0.95

-
tol
+
tol +

(number)
tolerance threshold for convergence.

-
+ +
-

Value

+

Value +

A list of 3 elements: n_it, weights, and diff_v.

-

See also

+

See also +

For references and details see proportion_ci_strat_wilson().

-

Examples

+

Examples +

vs <- c(0.011, 0.013, 0.012, 0.014, 0.017, 0.018)
 sq <- 0.674
 ws <- rep(1 / length(vs), length(vs))
@@ -119,17 +172,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/index.html b/main/reference/index.html index 8f4a31e2..0367ac3c 100644 --- a/main/reference/index.html +++ b/main/reference/index.html @@ -1,5 +1,26 @@ - -Package index • cardx + + + + + + +Package index • cardx + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +36,27 @@ + + @@ -31,380 +67,495 @@
-

ARD Creation

+

ARD Creation +

-
+
+
-

{stats} package

+

{stats} package +

-
+
+
-
+
+
ard_stats_anova()
ARD ANOVA
-
+
+
+
ard_stats_aov()
ARD ANOVA
-
+
+
+
ard_stats_chisq_test()
ARD Chi-squared Test
-
+
+
+
ard_stats_fisher_test()
ARD Fisher's Exact Test
-
+
+
+
ard_stats_kruskal_test()
ARD Kruskal-Wallis Test
-
+
+
+
ard_stats_mood_test()
ARD Mood Test
-
+
+
+
ard_stats_mcnemar_test() ard_stats_mcnemar_test_long()
ARD McNemar's Test
-
+
+
+
ard_stats_oneway_test()
ARD One-way Test
-
+
+
+
ard_stats_poisson_test()
ARD Poisson Test
-
+
+
+
ard_stats_prop_test()
ARD 2-sample proportion test
-
+
+
+
ard_stats_t_test() ard_stats_paired_t_test()
ARD t-test
-
+
+
+
ard_stats_t_test_onesample()
ARD one-sample t-test
-
+
+
+
ard_stats_wilcox_test() ard_stats_paired_wilcox_test()
ARD Wilcoxon Rank-Sum Test
-
+
+
+
ard_stats_wilcox_test_onesample()
ARD one-sample Wilcox Rank-sum
-
+ +
+
-

{aod} package

+

{aod} package +

-
+
+
-
+
+
ard_aod_wald_test()
ARD Wald Test
-
+ +
+
-

{car} package

+

{car} package +

-
+
+
-
+
+
ard_car_anova()
ARD ANOVA from car Package
-
+
+
+
ard_car_vif()
Regression VIF ARD
-
+ +
+
-

{effectsize} package

+

{effectsize} package +

-
+
+
+ +
+
-

{emmeans} package

+

{emmeans} package +

-
+
+
-
+
+
ard_emmeans_mean_difference()
ARD for LS Mean Difference
-
+ +
+
-

{smd} package

+

{smd} package +

-
+
+
-
+
+
ard_smd_smd()
ARD Standardized Mean Difference
-
+ +
+
-

{survey} package

+

{survey} package +

-
+
+
-
+
+
ard_continuous(<survey.design>)
ARD Continuous Survey Statistics
-
+
+
+
ard_categorical(<survey.design>)
ARD Categorical Survey Statistics
-
+
+
+
ard_dichotomous(<survey.design>)
ARD Dichotomous Survey Statistics
-
+
+
+
ard_missing(<survey.design>)
ARD Missing Survey Statistics
-
+
+
+
ard_attributes(<survey.design>)
ARD Attributes
-
+
+
+
ard_continuous_ci(<survey.design>)
ARD survey continuous CIs
-
+
+
+
ard_categorical_ci(<survey.design>)
ARD survey categorical CIs
-
+
+
+
ard_total_n(<survey.design>)
ARD Total N
-
+
+
+
ard_survey_svychisq()
ARD Survey Chi-Square Test
-
+
+
+
ard_survey_svyranktest()
ARD Survey rank test
-
+
+
+
ard_survey_svyttest()
ARD Survey t-test
-
+ +
+
-

{survival} package

+

{survival} package +

-
+
+
-
+
+
ard_survival_survfit()
ARD Survival Estimates
-
+
+
+
ard_survival_survfit_diff()
ARD Survival Differences
-
+
+
+
ard_survival_survdiff()
ARD for Difference in Survival
-
+ +
+
-

Other ARD functions

+

Other ARD functions +

-
+
+
-
+
+
ard_continuous_ci()
ARD continuous CIs
-
+
+
+
ard_categorical_ci() experimental
ARD Proportion Confidence Intervals
-
+
+
+
ard_regression()
Regression ARD
-
+
+
+
ard_regression_basic()
Basic Regression ARD
-
-

Helpers

+ +
+
+

Helpers +

-
+
+ + + + + - + + - + + diff --git a/main/reference/proportion_ci.html b/main/reference/proportion_ci.html index 7be7a82c..5ba80f7d 100644 --- a/main/reference/proportion_ci.html +++ b/main/reference/proportion_ci.html @@ -1,5 +1,28 @@ - -Functions for Calculating Proportion Confidence Intervals — proportion_ci • cardx + + + + + + +Functions for Calculating Proportion Confidence Intervals — proportion_ci • cardx + + + + + + + + + + + + + + + + + + Skip to contents @@ -15,12 +38,27 @@ + + @@ -37,7 +75,8 @@
-

Usage

+

Usage +

proportion_ci_wald(x, conf.level = 0.95, correct = FALSE)
 
 proportion_ci_wilson(x, conf.level = 0.95, correct = FALSE)
@@ -61,82 +100,108 @@ 

Usage

-

Arguments

+

Arguments +

-
x
+
+
x +

vector of a binary values, i.e. a logical vector, or numeric with values c(0, 1)

-
conf.level
+
conf.level +

(numeric)
a scalar in (0, 1) indicating the confidence level. Default is 0.95

-
correct
+
correct +

(flag)
include the continuity correction. For further information, see for example stats::prop.test().

-
strata
+
strata +

(factor)
variable with one level per stratum and same length as x.

-
weights
+
weights +

(numeric or NULL)
weights for each level of the strata. If NULL, they are estimated using the iterative algorithm that minimizes the weighted squared length of the confidence interval.

-
max.iterations
+
max.iterations +

(count)
maximum number of iterations for the iterative procedure used to find estimates of optimal weights.

-
+ +
-

Value

+

Value +

Confidence interval of a proportion.

-

Functions

+

Functions +

-
  • proportion_ci_wald(): Calculates the Wald interval by following the usual textbook definition +

      +
    • +

      proportion_ci_wald(): Calculates the Wald interval by following the usual textbook definition for a single proportion confidence interval using the normal approximation.

      -

      $$\hat{p} \pm z_{\alpha/2} \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}$$

    • -
    • proportion_ci_wilson(): Calculates the Wilson interval by calling stats::prop.test(). +

      $$\hat{p} \pm z_{\alpha/2} \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}$$

      +
    • +
    • +

      proportion_ci_wilson(): Calculates the Wilson interval by calling stats::prop.test(). Also referred to as Wilson score interval.

      $$\frac{\hat{p} + \frac{z^2_{\alpha/2}}{2n} \pm z_{\alpha/2} \sqrt{\frac{\hat{p}(1 - \hat{p})}{n} + -\frac{z^2_{\alpha/2}}{4n^2}}}{1 + \frac{z^2_{\alpha/2}}{n}}$$

    • -
    • proportion_ci_clopper_pearson(): Calculates the Clopper-Pearson interval by calling stats::binom.test(). +\frac{z^2_{\alpha/2}}{4n^2}}}{1 + \frac{z^2_{\alpha/2}}{n}}$$

      +
    • +
    • +

      proportion_ci_clopper_pearson(): Calculates the Clopper-Pearson interval by calling stats::binom.test(). Also referred to as the exact method.

      $$ \left( \frac{k}{n} \pm z_{\alpha/2} \sqrt{\frac{\frac{k}{n}(1-\frac{k}{n})}{n} + \frac{z^2_{\alpha/2}}{4n^2}} \right) -/ \left( 1 + \frac{z^2_{\alpha/2}}{n} \right)$$

    • -
    • proportion_ci_agresti_coull(): Calculates the Agresti-Coull interval (created by Alan Agresti and Brent Coull) by +/ \left( 1 + \frac{z^2_{\alpha/2}}{n} \right)$$

      +
    • +
    • +

      proportion_ci_agresti_coull(): Calculates the Agresti-Coull interval (created by Alan Agresti and Brent Coull) by (for 95% CI) adding two successes and two failures to the data and then using the Wald formula to construct a CI.

      $$ \left( \frac{\tilde{p} + z^2_{\alpha/2}/2}{n + z^2_{\alpha/2}} \pm z_{\alpha/2} \sqrt{\frac{\tilde{p}(1 - \tilde{p})}{n} + -\frac{z^2_{\alpha/2}}{4n^2}} \right)$$

    • -
    • proportion_ci_jeffreys(): Calculates the Jeffreys interval, an equal-tailed interval based on the +\frac{z^2_{\alpha/2}}{4n^2}} \right)$$

      +
    • +
    • +

      proportion_ci_jeffreys(): Calculates the Jeffreys interval, an equal-tailed interval based on the non-informative Jeffreys prior for a binomial proportion.

      $$\left( \text{Beta}\left(\frac{k}{2} + \frac{1}{2}, \frac{n - k}{2} + \frac{1}{2}\right)_\alpha, -\text{Beta}\left(\frac{k}{2} + \frac{1}{2}, \frac{n - k}{2} + \frac{1}{2}\right)_{1-\alpha} \right)$$

    • -
    • proportion_ci_strat_wilson(): Calculates the stratified Wilson confidence +\text{Beta}\left(\frac{k}{2} + \frac{1}{2}, \frac{n - k}{2} + \frac{1}{2}\right)_{1-\alpha} \right)$$

      +
    • +
    • +

      proportion_ci_strat_wilson(): Calculates the stratified Wilson confidence interval for unequal proportions as described in Xin YA, Su XG. Stratified Wilson and Newcombe confidence intervals for multiple binomial proportions. Statistics in Biopharmaceutical Research. 2010;2(3).

      $$\frac{\hat{p}_j + \frac{z^2_{\alpha/2}}{2n_j} \pm z_{\alpha/2} \sqrt{\frac{\hat{p}_j(1 - \hat{p}_j)}{n_j} + -\frac{z^2_{\alpha/2}}{4n_j^2}}}{1 + \frac{z^2_{\alpha/2}}{n_j}}$$

    • +\frac{z^2_{\alpha/2}}{4n_j^2}}}{1 + \frac{z^2_{\alpha/2}}{n_j}}$$

      +
    • is_binary(): Helper to determine if vector is binary (logical or 0/1)

    • -
+ +
-

Examples

+

Examples +

x <- c(
   TRUE, TRUE, TRUE, TRUE, TRUE,
   FALSE, FALSE, FALSE, FALSE, FALSE
@@ -334,17 +399,19 @@ 

Examples

+ +
- + + - + + diff --git a/main/reference/reexports.html b/main/reference/reexports.html index 5809f016..f7b1a51e 100644 --- a/main/reference/reexports.html +++ b/main/reference/reexports.html @@ -1,5 +1,22 @@ - -Objects exported from other packages — reexports • cardx + + + + + +Objects exported from other packages — reexports • cardx + + + + + + + + + + + + + +"> + + + + + Skip to contents @@ -37,12 +60,27 @@ + + @@ -57,7 +95,8 @@

These objects are imported from other packages. Follow the links below to see their documentation.

-
cards
+
+
cards

ard_attributes, ard_categorical, ard_continuous, ard_dichotomous, ard_missing, ard_total_n

@@ -65,21 +104,24 @@

%>%, all_of, any_of, contains, ends_with, everything, last_col, matches, num_range, one_of, starts_with, where

-
+ + - + + - + + - + + diff --git a/main/search.json b/main/search.json index c6aba394..8a4e2638 100644 --- a/main/search.json +++ b/main/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement [INSERT CONTACT METHOD]. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://insightsengineering.github.io/cardx/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contribution Guidelines","title":"Contribution Guidelines","text":"🙏 Thank taking time contribute! input deeply valued, whether issue, pull request, even feedback, regardless size, content scope.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"table-of-contents","dir":"","previous_headings":"","what":"Table of contents","title":"Contribution Guidelines","text":"👶 Getting started 📔 Code Conduct 🗃 License 📜 Issues 🚩 Pull requests 💻 Coding guidelines 🏆 Recognition model ❓ Questions","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting started","title":"Contribution Guidelines","text":"Please refer project documentation brief introduction. Please also see articles within project documentation additional information.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contribution Guidelines","text":"Code Conduct governs project. Participants contributors expected follow rules outlined therein.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Contribution Guidelines","text":"contributions covered project’s license.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"issues","dir":"","previous_headings":"","what":"Issues","title":"Contribution Guidelines","text":"use GitHub track issues, feature requests, bugs. submitting new issue, please check issue already reported. issue already exists, please upvote existing issue 👍. new feature requests, please elaborate context benefit feature users, developers, relevant personas.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"github-flow","dir":"","previous_headings":"Pull requests","what":"GitHub Flow","title":"Contribution Guidelines","text":"repository uses GitHub Flow model collaboration. submit pull request: Create branch Please see branch naming convention . don’t write access repository, please fork . Make changes Make sure code passes checks imposed GitHub Actions well documented well tested unit tests sufficiently covering changes introduced Create pull request (PR) pull request description, please link relevant issue (), provide detailed description change, include assumptions. Address review comments, Post approval Merge PR write access. Otherwise, reviewer merge PR behalf. Pat back Congratulations! 🎉 now official contributor project! grateful contribution.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"branch-naming-convention","dir":"","previous_headings":"Pull requests","what":"Branch naming convention","title":"Contribution Guidelines","text":"Suppose changes related current issue current project; please name branch follows: _. Please use underscore (_) delimiter word separation. example, 420_fix_ui_bug suitable branch name change resolving UI-related bug reported issue number 420 current project. change affects multiple repositories, please name branches follows: __. example, 69_awesomeproject_fix_spelling_error reference issue 69 reported project awesomeproject aims resolve one spelling errors multiple (likely related) repositories.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"monorepo-and-stageddependencies","dir":"","previous_headings":"Pull requests","what":"monorepo and staged.dependencies","title":"Contribution Guidelines","text":"Sometimes might need change upstream dependent package(s) able submit meaningful change. using staged.dependencies functionality simulate monorepo behavior. dependency configuration already specified project’s staged_dependencies.yaml file. need name feature branches appropriately. exception branch naming convention described . Please refer staged.dependencies package documentation details.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"coding-guidelines","dir":"","previous_headings":"","what":"Coding guidelines","title":"Contribution Guidelines","text":"repository follows unified processes standards adopted maintainers ensure software development carried consistently within teams cohesively across repositories.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"style-guide","dir":"","previous_headings":"Coding guidelines","what":"Style guide","title":"Contribution Guidelines","text":"repository follows standard tidyverse style guide uses lintr lint checks. Customized lint configurations available repository’s .lintr file.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"dependency-management","dir":"","previous_headings":"Coding guidelines","what":"Dependency management","title":"Contribution Guidelines","text":"Lightweight right weight. repository follows tinyverse recommedations limiting dependencies minimum.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"dependency-version-management","dir":"","previous_headings":"Coding guidelines","what":"Dependency version management","title":"Contribution Guidelines","text":"code compatible (!) historical versions given dependenct package, required specify minimal version DESCRIPTION file. particular: development version requires (imports) development version another package - required put abc (>= 1.2.3.9000).","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"r--package-versions","dir":"","previous_headings":"Coding guidelines > Recommended development environment & tools","what":"R & package versions","title":"Contribution Guidelines","text":"continuously test packages newest R version along recent dependencies CRAN BioConductor. recommend working environment also set way. can find details R version packages used R CMD check GitHub Action execution log - step prints R sessionInfo(). discover bugs older R versions older set dependencies, please create relevant bug reports.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"pre-commit","dir":"","previous_headings":"Coding guidelines > Recommended development environment & tools","what":"pre-commit","title":"Contribution Guidelines","text":"highly recommend use pre-commit tool combined R hooks pre-commit execute checks committing pushing changes. Pre-commit hooks already available repository’s .pre-commit-config.yaml file.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"recognition-model","dir":"","previous_headings":"","what":"Recognition model","title":"Contribution Guidelines","text":"mentioned previously, contributions deeply valued appreciated. contribution data available part repository insights, recognize significant contribution hence add contributor package authors list, following rules enforced: Minimum 5% lines code authored* (determined git blame query) top 5 contributors terms number commits lines added lines removed* *Excluding auto-generated code, including limited roxygen comments renv.lock files. package maintainer also reserves right adjust criteria recognize contributions.","code":""},{"path":"https://insightsengineering.github.io/cardx/CONTRIBUTING.html","id":"questions","dir":"","previous_headings":"","what":"Questions","title":"Contribution Guidelines","text":"questions regarding contribution guidelines, please contact package/repository maintainer.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/SECURITY.html","id":"reporting-security-issues","dir":"","previous_headings":"","what":"Reporting Security Issues","title":"Security Policy","text":"believe found security vulnerability repositories organization, please report us coordinated disclosure. Please report security vulnerabilities public GitHub issues, discussions, pull requests. Instead, please send email vulnerability.management[@]roche.com. Please include much information listed can help us better understand resolve issue: type issue (e.g., buffer overflow, SQL injection, cross-site scripting) Full paths source file(s) related manifestation issue location affected source code (tag/branch/commit direct URL) special configuration required reproduce issue Step--step instructions reproduce issue Proof--concept exploit code (possible) Impact issue, including attacker might exploit issue information help us triage report quickly.","code":""},{"path":"https://insightsengineering.github.io/cardx/SECURITY.html","id":"data-security-standards-dss","dir":"","previous_headings":"","what":"Data Security Standards (DSS)","title":"Security Policy","text":"Please make sure reporting issues form bug, feature, pull request, sensitive information PII, PHI, PCI completely removed text attachments, including pictures videos.","code":""},{"path":"https://insightsengineering.github.io/cardx/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Daniel Sjoberg. Author, maintainer. Abinaya Yogasekaram. Author. Emily de la Rua. Author. F. Hoffmann-La Roche AG. Copyright holder, funder.","code":""},{"path":"https://insightsengineering.github.io/cardx/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Sjoberg D, Yogasekaram , de la Rua E (2024). cardx: Extra Analysis Results Data Utilities. R package version 0.2.1.9012, https://github.com/insightsengineering/cardx/, https://insightsengineering.github.io/cardx/.","code":"@Manual{, title = {cardx: Extra Analysis Results Data Utilities}, author = {Daniel Sjoberg and Abinaya Yogasekaram and Emily {de la Rua}}, year = {2024}, note = {R package version 0.2.1.9012, https://github.com/insightsengineering/cardx/}, url = {https://insightsengineering.github.io/cardx/}, }"},{"path":"https://insightsengineering.github.io/cardx/index.html","id":"cardx-","dir":"","previous_headings":"","what":"Extra Analysis Results Data Utilities","title":"Extra Analysis Results Data Utilities","text":"{cardx} package extension {cards} package, providing additional functions create Analysis Results Data Objects (ARDs) using R programming language. {cardx} package exports ARD functions uses utility functions {cards} statistical functions additional packages (, {stats}, {mmrm}, {emmeans}, {car}, {survey}, etc.) construct summary objects. Summary objects can used : Generate Tables visualizations Regulatory Submission easily R. Perfect presenting descriptive statistics, statistical analyses, regressions, etc. . Conduct Quality Control checks existing Tables R. Storing results test parameters supports re-use verification data analyses.","code":""},{"path":"https://insightsengineering.github.io/cardx/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Extra Analysis Results Data Utilities","text":"Install cards CRAN : can install development version cards GitHub :","code":"install.packages(\"cardx\") # install.packages(\"devtools\") devtools::install_github(\"insightsengineering/cardx\")"},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/index.html","id":"example-ard-creation","dir":"","previous_headings":"Examples","what":"Example ARD Creation","title":"Extra Analysis Results Data Utilities","text":"Example t-test: Note returned ARD contains analysis results addition function parameters used calculate results allowing reproducible future analyses customization.","code":"library(cardx) cards::ADSL |> # keep two treatment arms for the t-test calculation dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> cardx::ard_stats_t_test(by = ARM, variable = AGE) ## {cards} data frame: 14 x 9 ## group1 variable context stat_name stat_label stat ## 1 ARM AGE stats_t_… estimate Mean Dif… 0.828 ## 2 ARM AGE stats_t_… estimate1 Group 1 … 75.209 ## 3 ARM AGE stats_t_… estimate2 Group 2 … 74.381 ## 4 ARM AGE stats_t_… statistic t Statis… 0.655 ## 5 ARM AGE stats_t_… p.value p-value 0.513 ## 6 ARM AGE stats_t_… parameter Degrees … 167.362 ## 7 ARM AGE stats_t_… conf.low CI Lower… -1.668 ## 8 ARM AGE stats_t_… conf.high CI Upper… 3.324 ## 9 ARM AGE stats_t_… method method Welch Tw… ## 10 ARM AGE stats_t_… alternative alternat… two.sided ## 11 ARM AGE stats_t_… mu H0 Mean 0 ## 12 ARM AGE stats_t_… paired Paired t… FALSE ## 13 ARM AGE stats_t_… var.equal Equal Va… FALSE ## 14 ARM AGE stats_t_… conf.level CI Confi… 0.95 ## ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/index.html","id":"model-input","dir":"","previous_headings":"Examples","what":"Model Input","title":"Extra Analysis Results Data Utilities","text":"{cardx} functions accept regression model objects input: Note Analysis Results Standard begin data set rather model object. accomplish include model construction helpers.","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_aod_wald_test() construct_model( data = cards::ADSL, formula = reformulate2(\"ARM\", response = \"AGE\"), method = \"lm\" ) |> ard_aod_wald_test() ## {cards} data frame: 6 x 8 ## variable context stat_name stat_label stat fmt_fn ## 1 (Intercept) aod_wald… df Degrees … 1 1 ## 2 (Intercept) aod_wald… statistic Statistic 7126.713 1 ## 3 (Intercept) aod_wald… p.value p-value 0 1 ## 4 ARM aod_wald… df Degrees … 2 1 ## 5 ARM aod_wald… statistic Statistic 1.046 1 ## 6 ARM aod_wald… p.value p-value 0.593 1 ## ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/index.html","id":"additional-resources","dir":"","previous_headings":"","what":"Additional Resources","title":"Extra Analysis Results Data Utilities","text":"best resources help documents accompanying {cardx} function. Supporting documentation companion packages {cards} {gtsummary} useful understanding ARD workflow capabilities.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_aod_wald_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Wald Test — ard_aod_wald_test","title":"ARD Wald Test — ard_aod_wald_test","text":"Function takes regression model object calculates Wald statistical test using aod::wald.test().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_aod_wald_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Wald Test — ard_aod_wald_test","text":"","code":"ard_aod_wald_test( x, tidy_fun = broom.helpers::tidy_with_broom_or_parameters, ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_aod_wald_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Wald Test — ard_aod_wald_test","text":"x regression model object tidy_fun (function) tidier. Default broom.helpers::tidy_with_broom_or_parameters ... arguments passed aod::wald.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_aod_wald_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Wald Test — ard_aod_wald_test","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_aod_wald_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Wald Test — ard_aod_wald_test","text":"","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_aod_wald_test() #> {cards} data frame: 6 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 (Intercept) aod_wald… df Degrees … 1 1 #> 2 (Intercept) aod_wald… statistic Statistic 7126.713 1 #> 3 (Intercept) aod_wald… p.value p-value 0 1 #> 4 ARM aod_wald… df Degrees … 2 1 #> 5 ARM aod_wald… statistic Statistic 1.046 1 #> 6 ARM aod_wald… p.value p-value 0.593 1 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_attributes.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Attributes — ard_attributes.survey.design","title":"ARD Attributes — ard_attributes.survey.design","text":"Add variable attributes ARD data frame. label attribute added columns, label specified label set column using label= argument, column name placed label statistic. class attribute also returned columns. attribute returned attributes() also added, e.g. factor levels.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_attributes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Attributes — ard_attributes.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_attributes(data, variables = everything(), label = NULL, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_attributes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Attributes — ard_attributes.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) variables include label (named list) named list variable labels, e.g. list(cyl = \". Cylinders\"). Default NULL ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_attributes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Attributes — ard_attributes.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_attributes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Attributes — ard_attributes.survey.design","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_attributes( data = dclus1, variables = c(sname, dname), label = list(sname = \"School Name\", dname = \"District Name\") ) #> {cards} data frame: 4 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 sname attribut… label Variable… School N… #> 2 sname attribut… class Variable… character NULL #> 3 dname attribut… label Variable… District… #> 4 dname attribut… class Variable… character NULL #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_anova.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD ANOVA from car Package — ard_car_anova","title":"ARD ANOVA from car Package — ard_car_anova","text":"Function takes regression model object calculated ANOVA using car::Anova().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_anova.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD ANOVA from car Package — ard_car_anova","text":"","code":"ard_car_anova(x, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_anova.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD ANOVA from car Package — ard_car_anova","text":"x regression model object ... arguments passed car::Anova(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_anova.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD ANOVA from car Package — ard_car_anova","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_anova.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD ANOVA from car Package — ard_car_anova","text":"","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_car_anova() #> {cards} data frame: 5 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 ARM car_anova sumsq sumsq 71.386 1 #> 2 ARM car_anova df Degrees … 2 1 #> 3 ARM car_anova meansq meansq 35.693 1 #> 4 ARM car_anova statistic Statistic 0.523 1 #> 5 ARM car_anova p.value p-value 0.593 1 #> ℹ 2 more variables: warning, error glm(vs ~ factor(cyl) + factor(am), data = mtcars, family = binomial) |> ard_car_anova(test.statistic = \"Wald\") #> {cards} data frame: 6 x 8 #> variable context stat_name stat_label stat warning #> 1 factor(cyl) car_anova statistic Statistic 0 glm.fit:… #> 2 factor(cyl) car_anova df Degrees … 2 glm.fit:… #> 3 factor(cyl) car_anova p.value p-value 1 glm.fit:… #> 4 factor(am) car_anova statistic Statistic 0 glm.fit:… #> 5 factor(am) car_anova df Degrees … 1 glm.fit:… #> 6 factor(am) car_anova p.value p-value 0.998 glm.fit:… #> ℹ 2 more variables: fmt_fn, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_vif.html","id":null,"dir":"Reference","previous_headings":"","what":"Regression VIF ARD — ard_car_vif","title":"Regression VIF ARD — ard_car_vif","text":"Function takes regression model object returns variance inflation factor (VIF) using car::vif() converts ARD structure","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_vif.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression VIF ARD — ard_car_vif","text":"","code":"ard_car_vif(x, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_vif.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression VIF ARD — ard_car_vif","text":"x regression model object See car::vif() details ... arguments passed car::vif(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_vif.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Regression VIF ARD — ard_car_vif","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_car_vif.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Regression VIF ARD — ard_car_vif","text":"","code":"lm(AGE ~ ARM + SEX, data = cards::ADSL) |> ard_car_vif() #> {cards} data frame: 6 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 ARM car_vif GVIF GVIF 1.016 1 #> 2 ARM car_vif df df 2 1 #> 3 ARM car_vif aGVIF Adjusted… 1.004 1 #> 4 SEX car_vif GVIF GVIF 1.016 1 #> 5 SEX car_vif df df 1 1 #> 6 SEX car_vif aGVIF Adjusted… 1.008 1 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Categorical Survey Statistics — ard_categorical.survey.design","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"Compute tabulations survey-weighted data. counts proportion (\"N\", \"n\", \"p\") calculated using survey::svytable(), standard errors design effect (\"p.std.error\", \"deff\") calculated using survey::svymean(). unweighted statistics calculated cards::ard_categorical.data.frame().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_categorical( data, variables, by = NULL, statistic = everything() ~ c(\"n\", \"N\", \"p\", \"p.std.error\", \"deff\", \"n_unweighted\", \"N_unweighted\", \"p_unweighted\"), denominator = c(\"column\", \"row\", \"cell\"), fmt_fn = NULL, stat_label = everything() ~ list(p = \"%\", p.std.error = \"SE(%)\", deff = \"Design Effect\", n_unweighted = \"Unweighted n\", N_unweighted = \"Unweighted N\", p_unweighted = \"Unweighted %\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations column specified variables. single column may specified. statistic (formula-list-selector) named list, list formulas, single formula list element character vector statistic names include. See default value options. denominator (string) string indicating type proportions calculate. Must one \"column\" (default), \"row\", \"cell\". fmt_fn (formula-list-selector) named list, list formulas, single formula list element named list functions (RHS formula), e.g. list(mpg = list(mean = \\(x) round(x, digits = 2) |> .character())). stat_label (formula-list-selector) named list, list formulas, single formula list element either named list list formulas defining statistic labels, e.g. everything() ~ list(mean = \"Mean\", sd = \"SD\") everything() ~ list(mean ~ \"Mean\", sd ~ \"SD\"). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"","code":"svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) ard_categorical(svy_titanic, variables = c(Class, Age), by = Survived) #> {cards} data frame: 96 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 Survived No Class 1st n n 122 #> 2 Survived No Class 1st N N 1490 #> 3 Survived No Class 1st p % 0.082 #> 4 Survived No Class 1st p.std.error SE(%) 0.086 #> 5 Survived No Class 1st deff Design E… 0.896 #> 6 Survived No Class 2nd n n 167 #> 7 Survived No Class 2nd N N 1490 #> 8 Survived No Class 2nd p % 0.112 #> 9 Survived No Class 2nd p.std.error SE(%) 0.111 #> 10 Survived No Class 2nd deff Design E… 1.128 #> ℹ 86 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Proportion Confidence Intervals — ard_categorical_ci","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"Calculate confidence intervals proportions.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"","code":"ard_categorical_ci(data, ...) # S3 method for class 'data.frame' ard_categorical_ci( data, variables, by = dplyr::group_vars(data), method = c(\"waldcc\", \"wald\", \"clopper-pearson\", \"wilson\", \"wilsoncc\", \"strat_wilson\", \"strat_wilsoncc\", \"agresti-coull\", \"jeffreys\"), conf.level = 0.95, value = list(where(is_binary) ~ 1L, where(is.logical) ~ TRUE), strata = NULL, weights = NULL, max.iterations = 10, ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"data (data.frame) data frame ... Arguments passed methods. variables (tidy-select) columns include summaries. Columns must class values coded c(0, 1). (tidy-select) columns stratify calculations method (string) string indicating type confidence interval calculate. Must one . See ?proportion_ci details. conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95 value (formula-list-selector) function calculate CIs levels variables specified. Use argument instead request single level summarized. Default list((is_binary) ~ 1L, (.logical) ~ TRUE), columns coded 0/1 TRUE/FALSE summarize 1 TRUE levels. strata, weights, max.iterations arguments passed proportion_ci_strat_wilson(), method='strat_wilson'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"","code":"# compute CI for binary variables ard_categorical_ci(mtcars, variables = c(vs, am), method = \"wilson\") #> {cards} data frame: 20 x 9 #> variable variable_level context stat_name stat_label stat #> 1 vs 1 proporti… N N 32 #> 2 vs 1 proporti… conf.level conf.lev… 0.95 #> 3 vs 1 proporti… estimate estimate 0.438 #> 4 vs 1 proporti… statistic statistic 0.5 #> 5 vs 1 proporti… p.value p.value 0.48 #> 6 vs 1 proporti… parameter parameter 1 #> 7 vs 1 proporti… conf.low conf.low 0.282 #> 8 vs 1 proporti… conf.high conf.high 0.607 #> 9 vs 1 proporti… method method Wilson C… #> 10 vs 1 proporti… alternative alternat… two.sided #> 11 am 1 proporti… N N 32 #> 12 am 1 proporti… conf.level conf.lev… 0.95 #> 13 am 1 proporti… estimate estimate 0.406 #> 14 am 1 proporti… statistic statistic 1.125 #> 15 am 1 proporti… p.value p.value 0.289 #> 16 am 1 proporti… parameter parameter 1 #> 17 am 1 proporti… conf.low conf.low 0.255 #> 18 am 1 proporti… conf.high conf.high 0.577 #> 19 am 1 proporti… method method Wilson C… #> 20 am 1 proporti… alternative alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error # compute CIs for each level of a categorical variable ard_categorical_ci(mtcars, variables = cyl, method = \"jeffreys\") #> {cards} data frame: 18 x 9 #> variable variable_level context stat_name stat_label stat #> 1 cyl 4 proporti… N N 32 #> 2 cyl 4 proporti… estimate estimate 0.344 #> 3 cyl 4 proporti… conf.low conf.low 0.198 #> 4 cyl 4 proporti… conf.high conf.high 0.516 #> 5 cyl 4 proporti… conf.level conf.lev… 0.95 #> 6 cyl 4 proporti… method method Jeffreys… #> 7 cyl 6 proporti… N N 32 #> 8 cyl 6 proporti… estimate estimate 0.219 #> 9 cyl 6 proporti… conf.low conf.low 0.104 #> 10 cyl 6 proporti… conf.high conf.high 0.382 #> 11 cyl 6 proporti… conf.level conf.lev… 0.95 #> 12 cyl 6 proporti… method method Jeffreys… #> 13 cyl 8 proporti… N N 32 #> 14 cyl 8 proporti… estimate estimate 0.438 #> 15 cyl 8 proporti… conf.low conf.low 0.277 #> 16 cyl 8 proporti… conf.high conf.high 0.609 #> 17 cyl 8 proporti… conf.level conf.lev… 0.95 #> 18 cyl 8 proporti… method method Jeffreys… #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD survey categorical CIs — ard_categorical_ci.survey.design","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"Confidence intervals categorical variables calculated via survey::svyciprop().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_categorical_ci( data, variables, by = NULL, method = c(\"logit\", \"likelihood\", \"asin\", \"beta\", \"mean\", \"xlogit\"), conf.level = 0.95, value = list(where(is_binary) ~ 1L, where(is.logical) ~ TRUE), df = survey::degf(data), ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations columns specified, including unobserved combinations unobserved factor levels. method (string) Method passed survey::svyciprop(method) conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95 value (formula-list-selector) function calculate CIs levels variables specified. Use argument instead request single level summarized. Default list((is_binary) ~ 1L, (.logical) ~ TRUE), columns coded 0/1 TRUE/FALSE summarize 1 TRUE levels. df (numeric) denominator degrees freedom, passed survey::svyciprop(df). Default survey::degf(data). ... arguments passed survey::svyciprop()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_categorical_ci.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_categorical_ci(dclus1, variables = sch.wide) #> {cards} data frame: 10 x 9 #> variable variable_level context stat_name stat_label stat #> 1 sch.wide No categori… estimate estimate 0.126 #> 2 sch.wide No categori… conf.low conf.low 0.088 #> 3 sch.wide No categori… conf.high conf.high 0.176 #> 4 sch.wide No categori… method method logit #> 5 sch.wide No categori… conf.level conf.lev… 0.95 #> 6 sch.wide Yes categori… estimate estimate 0.874 #> 7 sch.wide Yes categori… conf.low conf.low 0.824 #> 8 sch.wide Yes categori… conf.high conf.high 0.912 #> 9 sch.wide Yes categori… method method logit #> 10 sch.wide Yes categori… conf.level conf.lev… 0.95 #> ℹ 3 more variables: fmt_fn, warning, error ard_categorical_ci(dclus1, variables = sch.wide, value = sch.wide ~ \"Yes\", method = \"xlogit\") #> {cards} data frame: 5 x 9 #> variable variable_level context stat_name stat_label stat #> 1 sch.wide Yes categori… estimate estimate 0.874 #> 2 sch.wide Yes categori… conf.low conf.low 0.824 #> 3 sch.wide Yes categori… conf.high conf.high 0.912 #> 4 sch.wide Yes categori… method method xlogit #> 5 sch.wide Yes categori… conf.level conf.lev… 0.95 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Continuous Survey Statistics — ard_continuous.survey.design","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"Returns ARD weighted statistics using {survey} package.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_continuous( data, variables, by = NULL, statistic = everything() ~ c(\"median\", \"p25\", \"p75\"), fmt_fn = NULL, stat_label = NULL, ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations columns specified, including unobserved combinations unobserved factor levels. statistic (formula-list-selector) named list, list formulas, single formula list element character vector statistic names include. See options. fmt_fn (formula-list-selector) named list, list formulas, single formula list element named list functions (RHS formula), e.g. list(mpg = list(mean = \\(x) round(x, digits = 2) |> .character)). stat_label (formula-list-selector) named list, list formulas, single formula list element either named list list formulas defining statistic labels, e.g. everything() ~ list(mean = \"Mean\", sd = \"SD\") everything() ~ list(mean ~ \"Mean\", sd ~ \"SD\"). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous.survey.design.html","id":"statistic-argument","dir":"Reference","previous_headings":"","what":"statistic argument","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"following statistics available: 'mean', 'median', 'min', 'max', 'sum', 'var', 'sd', 'mean.std.error', 'deff', 'p##', 'p##' percentiles ## integer 0 100.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_continuous( data = dclus1, variables = api00, by = stype ) #> {cards} data frame: 9 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 stype E api00 median Median 652 #> 2 stype H api00 median Median 608 #> 3 stype M api00 median Median 642 #> 4 stype E api00 p25 25% Perc… 553 #> 5 stype H api00 p25 25% Perc… 529 #> 6 stype M api00 p25 25% Perc… 547 #> 7 stype E api00 p75 75% Perc… 729 #> 8 stype H api00 p75 75% Perc… 703 #> 9 stype M api00 p75 75% Perc… 699 #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD continuous CIs — ard_continuous_ci","title":"ARD continuous CIs — ard_continuous_ci","text":"One-sample confidence intervals continuous variable means medians.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD continuous CIs — ard_continuous_ci","text":"","code":"ard_continuous_ci(data, ...) # S3 method for class 'data.frame' ard_continuous_ci( data, variables, by = dplyr::group_vars(data), conf.level = 0.95, method = c(\"t.test\", \"wilcox.test\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD continuous CIs — ard_continuous_ci","text":"data (data.frame) data frame. See details. ... arguments passed t.test() wilcox.test() variables (tidy-select) column names compared. Independent t-tests computed variable. (tidy-select) optional column name compare . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. method (string) string indicating method use confidence interval calculation. Must one \"t.test\" \"wilcox.test\"","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD continuous CIs — ard_continuous_ci","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD continuous CIs — ard_continuous_ci","text":"","code":"ard_continuous_ci(mtcars, variables = c(mpg, hp), method = \"wilcox.test\") #> {cards} data frame: 24 x 8 #> variable context stat_name stat_label stat warning #> 1 mpg continuo… estimate Mean 19.6 cannot c… #> 2 mpg continuo… statistic t Statis… 528 cannot c… #> 3 mpg continuo… p.value p-value 0 cannot c… #> 4 mpg continuo… conf.low CI Lower… 17.5 cannot c… #> 5 mpg continuo… conf.high CI Upper… 22.1 cannot c… #> 6 mpg continuo… method method Wilcoxon… cannot c… #> 7 mpg continuo… alternative alternat… two.sided cannot c… #> 8 mpg continuo… mu H0 Mean 0 #> 9 mpg continuo… conf.int conf.int TRUE #> 10 mpg continuo… tol.root tol.root 0 #> ℹ 14 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 2 more variables: fmt_fn, error ard_continuous_ci(mtcars, variables = mpg, by = am, method = \"t.test\") #> {cards} data frame: 20 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 am 0 mpg estimate Mean 17.147 #> 2 am 0 mpg statistic t Statis… 19.495 #> 3 am 0 mpg p.value p-value 0 #> 4 am 0 mpg parameter Degrees … 18 #> 5 am 0 mpg conf.low CI Lower… 15.299 #> 6 am 0 mpg conf.high CI Upper… 18.995 #> 7 am 0 mpg method method One Samp… #> 8 am 0 mpg alternative alternat… two.sided #> 9 am 0 mpg mu H0 Mean 0 #> 10 am 0 mpg conf.level CI Confi… 0.95 #> 11 am 1 mpg estimate Mean 24.392 #> 12 am 1 mpg statistic t Statis… 14.262 #> 13 am 1 mpg p.value p-value 0 #> 14 am 1 mpg parameter Degrees … 12 #> 15 am 1 mpg conf.low CI Lower… 20.666 #> 16 am 1 mpg conf.high CI Upper… 28.119 #> 17 am 1 mpg method method One Samp… #> 18 am 1 mpg alternative alternat… two.sided #> 19 am 1 mpg mu H0 Mean 0 #> 20 am 1 mpg conf.level CI Confi… 0.95 #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD survey continuous CIs — ard_continuous_ci.survey.design","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"One-sample confidence intervals continuous variables' means medians. Confidence limits calculated survey::svymean() survey::svyquantile().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_continuous_ci( data, variables, by = NULL, method = c(\"svymean\", \"svymedian.mean\", \"svymedian.beta\", \"svymedian.xlogit\", \"svymedian.asin\", \"svymedian.score\"), conf.level = 0.95, df = survey::degf(data), ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations columns specified, including unobserved combinations unobserved factor levels. method (string) Method confidence interval calculation. \"svymean\", calculation computed via survey::svymean(). Otherwise, calculated viasurvey::svyquantile(interval.type=method) conf.level (scalar numeric) confidence level confidence interval. Default 0.95. df (numeric) denominator degrees freedom, passed survey::confint(df). Default survey::degf(data). ... arguments passed survey::confint()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_continuous_ci.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_continuous_ci(dclus1, variables = api00) #> {cards} data frame: 5 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 api00 survey_c… estimate estimate 644.169 2 #> 2 api00 survey_c… std.error std.error 23.542 2 #> 3 api00 survey_c… conf.low conf.low 593.676 2 #> 4 api00 survey_c… conf.high conf.high 694.662 2 #> 5 api00 survey_c… conf.level conf.lev… 0.95 2 #> ℹ 2 more variables: warning, error ard_continuous_ci(dclus1, variables = api00, method = \"svymedian.xlogit\") #> {cards} data frame: 5 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 api00 survey_c… estimate estimate 652 2 #> 2 api00 survey_c… std.error std.error 34.969 2 #> 3 api00 survey_c… conf.low conf.low 564 2 #> 4 api00 survey_c… conf.high conf.high 714 2 #> 5 api00 survey_c… conf.level conf.lev… 0.95 2 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_dichotomous.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"Compute Analysis Results Data (ARD) dichotomous summary statistics.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_dichotomous.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_dichotomous( data, variables, by = NULL, value = cards::maximum_variable_value(data$variables[variables]), statistic = everything() ~ c(\"n\", \"N\", \"p\", \"p.std.error\", \"deff\", \"n_unweighted\", \"N_unweighted\", \"p_unweighted\"), denominator = c(\"column\", \"row\", \"cell\"), fmt_fn = NULL, stat_label = everything() ~ list(p = \"%\", p.std.error = \"SE(%)\", deff = \"Design Effect\", n_unweighted = \"Unweighted n\", N_unweighted = \"Unweighted N\", p_unweighted = \"Unweighted %\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_dichotomous.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations column specified variables. single column may specified. value (named list) named list dichotomous values tabulate. Default cards::maximum_variable_value(data$variables), returns largest/last value sort. statistic (formula-list-selector) named list, list formulas, single formula list element character vector statistic names include. See default value options. denominator (string) string indicating type proportions calculate. Must one \"column\" (default), \"row\", \"cell\". fmt_fn (formula-list-selector) named list, list formulas, single formula list element named list functions (RHS formula), e.g. list(mpg = list(mean = \\(x) round(x, digits = 2) |> .character())). stat_label (formula-list-selector) named list, list formulas, single formula list element either named list list formulas defining statistic labels, e.g. everything() ~ list(mean = \"Mean\", sd = \"SD\") everything() ~ list(mean ~ \"Mean\", sd ~ \"SD\"). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_dichotomous.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_dichotomous.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"","code":"survey::svydesign(ids = ~1, data = mtcars, weights = ~1) |> ard_dichotomous(by = vs, variables = c(cyl, am), value = list(cyl = 4)) #> {cards} data frame: 32 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 vs 0 cyl 4 n n 1 #> 2 vs 0 cyl 4 N N 18 #> 3 vs 0 cyl 4 p % 0.056 #> 4 vs 0 cyl 4 p.std.error SE(%) 0.055 #> 5 vs 0 cyl 4 deff Design E… Inf #> 6 vs 0 cyl 4 n_unweighted Unweight… 1 #> 7 vs 0 cyl 4 N_unweighted Unweight… 18 #> 8 vs 0 cyl 4 p_unweighted Unweight… 0.056 #> 9 vs 1 cyl 4 n n 10 #> 10 vs 1 cyl 4 N N 14 #> ℹ 22 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_cohens_d.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Cohen's D Test — ard_effectsize_cohens_d","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"Analysis results data paired non-paired Cohen's D Effect Size Test using effectsize::cohens_d().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_cohens_d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"","code":"ard_effectsize_cohens_d(data, by, variables, conf.level = 0.95, ...) ard_effectsize_paired_cohens_d(data, by, variables, id, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_cohens_d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"data (data.frame) data frame. See details. (tidy-select) column name compare . Must categorical variable exactly two levels. variables (tidy-select) column names compared. Must continuous variables. Independent tests run variable. conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed effectsize::cohens_d(...) id (tidy-select) column name subject participant ID","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_cohens_d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_cohens_d.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"ard_effectsize_cohens_d() function, data expected one row per subject. data passed effectsize::cohens_d(data[[variable]]~data[[]], data, paired = FALSE, ...). ard_effectsize_paired_cohens_d() function, data expected one row per subject per level. effect size calculated, data reshaped wide format one row per subject. data passed effectsize::cohens_d(x = data_wide[[]], y = data_wide[[]], paired = TRUE, ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_cohens_d.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"","code":"cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_effectsize_cohens_d(by = ARM, variables = AGE) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE effectsi… estimate Effect S… 0.1 #> 2 ARM AGE effectsi… conf.level CI Confi… 0.95 #> 3 ARM AGE effectsi… conf.low CI Lower… -0.201 #> 4 ARM AGE effectsi… conf.high CI Upper… 0.401 #> 5 ARM AGE effectsi… method method Cohen's D #> 6 ARM AGE effectsi… mu H0 Mean 0 #> 7 ARM AGE effectsi… paired Paired t… FALSE #> 8 ARM AGE effectsi… pooled_sd Pooled S… TRUE #> 9 ARM AGE effectsi… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error # constructing a paired data set, # where patients receive both treatments cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> dplyr::group_by(USUBJID) |> dplyr::filter(dplyr::n() > 1) |> ard_effectsize_paired_cohens_d(by = ARM, variables = AGE, id = USUBJID) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE effectsi… estimate Effect S… 0.069 #> 2 ARM AGE effectsi… conf.level CI Confi… 0.95 #> 3 ARM AGE effectsi… conf.low CI Lower… -0.146 #> 4 ARM AGE effectsi… conf.high CI Upper… 0.282 #> 5 ARM AGE effectsi… method method Paired C… #> 6 ARM AGE effectsi… mu H0 Mean 0 #> 7 ARM AGE effectsi… paired Paired t… TRUE #> 8 ARM AGE effectsi… pooled_sd Pooled S… TRUE #> 9 ARM AGE effectsi… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_hedges_g.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Hedge's G Test — ard_effectsize_hedges_g","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"Analysis results data paired non-paired Hedge's G Effect Size Test using effectsize::hedges_g().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_hedges_g.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"","code":"ard_effectsize_hedges_g(data, by, variables, conf.level = 0.95, ...) ard_effectsize_paired_hedges_g(data, by, variables, id, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_hedges_g.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"data (data.frame) data frame. See details. (tidy-select) column name compare . Must categorical variable exactly two levels. variables (tidy-select) column names compared. Must continuous variable. Independent tests run variable conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed effectsize::hedges_g(...) id (tidy-select) column name subject participant ID","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_hedges_g.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_hedges_g.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"ard_effectsize_hedges_g() function, data expected one row per subject. data passed effectsize::hedges_g(data[[variable]]~data[[]], data, paired = FALSE, ...). ard_effectsize_paired_hedges_g() function, data expected one row per subject per level. effect size calculated, data reshaped wide format one row per subject. data passed effectsize::hedges_g(x = data_wide[[]], y = data_wide[[]], paired = TRUE, ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_effectsize_hedges_g.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"","code":"cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_effectsize_hedges_g(by = ARM, variables = AGE) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE effectsi… estimate Effect S… 0.1 #> 2 ARM AGE effectsi… conf.level CI Confi… 0.95 #> 3 ARM AGE effectsi… conf.low CI Lower… -0.2 #> 4 ARM AGE effectsi… conf.high CI Upper… 0.399 #> 5 ARM AGE effectsi… method method Hedge's G #> 6 ARM AGE effectsi… mu H0 Mean 0 #> 7 ARM AGE effectsi… paired Paired t… FALSE #> 8 ARM AGE effectsi… pooled_sd Pooled S… TRUE #> 9 ARM AGE effectsi… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error # constructing a paired data set, # where patients receive both treatments cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> dplyr::group_by(USUBJID) |> dplyr::filter(dplyr::n() > 1) |> ard_effectsize_paired_hedges_g(by = ARM, variables = AGE, id = USUBJID) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE effectsi… estimate Effect S… 0.068 #> 2 ARM AGE effectsi… conf.level CI Confi… 0.95 #> 3 ARM AGE effectsi… conf.low CI Lower… -0.144 #> 4 ARM AGE effectsi… conf.high CI Upper… 0.28 #> 5 ARM AGE effectsi… method method Paired H… #> 6 ARM AGE effectsi… mu H0 Mean 0 #> 7 ARM AGE effectsi… paired Paired t… TRUE #> 8 ARM AGE effectsi… pooled_sd Pooled S… TRUE #> 9 ARM AGE effectsi… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_emmeans_mean_difference.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD for LS Mean Difference — ard_emmeans_mean_difference","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"function calculates least-squares mean differences using 'emmeans' package using following arguments data, formula, method, method.args, package used construct regression model via cardx::construct_model().","code":"emmeans::emmeans(object = , specs = ~ ) |> emmeans::contrast(method = \"pairwise\") |> summary(infer = TRUE, level = )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_emmeans_mean_difference.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"","code":"ard_emmeans_mean_difference( data, formula, method, method.args = list(), package = \"base\", response_type = c(\"continuous\", \"dichotomous\"), conf.level = 0.95, primary_covariate = getElement(attr(stats::terms(formula), \"term.labels\"), 1L) )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_emmeans_mean_difference.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"data (data.frame/survey.design) data frame survey design object formula (formula) formula method (string) string function naming function called, e.g. \"glm\". function belongs library attached, package name must specified package argument. method.args (named list) named list arguments passed method. Note list may contain non-standard evaluation components. wrapping function functions, argument must passed way evaluate list, e.g. using rlang's embrace operator {{ . }}. package (string) string package name temporarily loaded function specified method executed. response_type (string) string indicating whether model outcome 'continuous' 'dichotomous'. 'dichotomous', call emmeans::emmeans() supplemented argument regrid=\"response\". conf.level (scalar numeric) confidence level confidence interval. Default 0.95. primary_covariate (string) string indicating primary covariate (typically dichotomous treatment variable). Default first covariate listed formula.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_emmeans_mean_difference.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_emmeans_mean_difference.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"","code":"ard_emmeans_mean_difference( data = mtcars, formula = mpg ~ am + cyl, method = \"lm\" ) #> {cards} data frame: 8 x 10 #> group1 variable variable_level stat_name stat_label stat #> 1 am contrast am0 - am1 estimate Mean Dif… -2.567 #> 2 am contrast am0 - am1 std.error std.error 1.291 #> 3 am contrast am0 - am1 df df 29 #> 4 am contrast am0 - am1 conf.low CI Lower… -5.208 #> 5 am contrast am0 - am1 conf.high CI Upper… 0.074 #> 6 am contrast am0 - am1 p.value p-value 0.056 #> 7 am contrast am0 - am1 conf.level CI Confi… 0.95 #> 8 am contrast am0 - am1 method method Least-sq… #> ℹ 4 more variables: context, fmt_fn, warning, error ard_emmeans_mean_difference( data = mtcars, formula = vs ~ am + mpg, method = \"glm\", method.args = list(family = binomial), response_type = \"dichotomous\" ) #> {cards} data frame: 8 x 10 #> group1 variable variable_level stat_name stat_label stat #> 1 am contrast am0 - am1 estimate Mean Dif… 0.61 #> 2 am contrast am0 - am1 std.error std.error 0.229 #> 3 am contrast am0 - am1 df df Inf #> 4 am contrast am0 - am1 conf.low CI Lower… 0.162 #> 5 am contrast am0 - am1 conf.high CI Upper… 1.059 #> 6 am contrast am0 - am1 p.value p-value 0.008 #> 7 am contrast am0 - am1 conf.level CI Confi… 0.95 #> 8 am contrast am0 - am1 method method Least-sq… #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_missing.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Missing Survey Statistics — ard_missing.survey.design","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"Compute Analysis Results Data (ARD) statistics related data missingness survey objects","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_missing.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_missing( data, variables, by = NULL, statistic = everything() ~ c(\"N_obs\", \"N_miss\", \"N_nonmiss\", \"p_miss\", \"p_nonmiss\", \"N_obs_unweighted\", \"N_miss_unweighted\", \"N_nonmiss_unweighted\", \"p_miss_unweighted\", \"p_nonmiss_unweighted\"), fmt_fn = NULL, stat_label = everything() ~ list(N_obs = \"Total N\", N_miss = \"N Missing\", N_nonmiss = \"N not Missing\", p_miss = \"% Missing\", p_nonmiss = \"% not Missing\", N_obs_unweighted = \"Total N (unweighted)\", N_miss_unweighted = \"N Missing (unweighted)\", N_nonmiss_unweighted = \"N not Missing (unweighted)\", p_miss_unweighted = \"% Missing (unweighted)\", p_nonmiss_unweighted = \"% not Missing (unweighted)\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_missing.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations column specified variables. single column may specified. statistic (formula-list-selector) named list, list formulas, single formula list element character vector statistic names include. See default value options. fmt_fn (formula-list-selector) named list, list formulas, single formula list element named list functions (RHS formula), e.g. list(mpg = list(mean = \\(x) round(x, digits = 2) |> .character())). stat_label (formula-list-selector) named list, list formulas, single formula list element either named list list formulas defining statistic labels, e.g. everything() ~ list(mean = \"Mean\", sd = \"SD\") everything() ~ list(mean ~ \"Mean\", sd ~ \"SD\"). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_missing.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_missing.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"","code":"svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) ard_missing(svy_titanic, variables = c(Class, Age), by = Survived) #> {cards} data frame: 40 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 Survived No Class N_nonmiss N not Mi… 1490 #> 2 Survived No Class N_obs Total N 1490 #> 3 Survived No Class p_nonmiss % not Mi… 1 #> 4 Survived No Class N_miss N Missing 0 #> 5 Survived No Class p_miss % Missing 0 #> 6 Survived No Class N_miss_unweighted N Missin… 0 #> 7 Survived No Class N_obs_unweighted Total N … 16 #> 8 Survived No Class p_miss_unweighted % Missin… 0 #> 9 Survived No Class N_nonmiss_unweighted N not Mi… 16 #> 10 Survived No Class p_nonmiss_unweighted % not Mi… 1 #> ℹ 30 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression.html","id":null,"dir":"Reference","previous_headings":"","what":"Regression ARD — ard_regression","title":"Regression ARD — ard_regression","text":"Function takes regression model object converts ARD structure using broom.helpers package.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression ARD — ard_regression","text":"","code":"ard_regression(x, ...) # Default S3 method ard_regression(x, tidy_fun = broom.helpers::tidy_with_broom_or_parameters, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression ARD — ard_regression","text":"x regression model object ... Arguments passed broom.helpers::tidy_plus_plus() tidy_fun (function) tidier. Default broom.helpers::tidy_with_broom_or_parameters","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Regression ARD — ard_regression","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Regression ARD — ard_regression","text":"","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_regression(add_estimate_to_reference_rows = TRUE) #> {cards} data frame: 43 x 9 #> variable variable_level context stat_name stat_label stat #> 1 ARM Placebo regressi… term term ARMPlace… #> 2 ARM Placebo regressi… var_label Label Descript… #> 3 ARM Placebo regressi… var_class Class character #> 4 ARM Placebo regressi… var_type Type categori… #> 5 ARM Placebo regressi… var_nlevels N Levels 3 #> 6 ARM Placebo regressi… contrasts contrasts contr.tr… #> 7 ARM Placebo regressi… contrasts_type Contrast… treatment #> 8 ARM Placebo regressi… reference_row referenc… TRUE #> 9 ARM Placebo regressi… label Level La… Placebo #> 10 ARM Placebo regressi… n_obs N Obs. 86 #> ℹ 33 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression_basic.html","id":null,"dir":"Reference","previous_headings":"","what":"Basic Regression ARD — ard_regression_basic","title":"Basic Regression ARD — ard_regression_basic","text":"function takes regression model provides basic statistics ARD structure. default output simpler ard_regression(). function primarily matches regression terms underlying variable names levels. default arguments used ","code":"broom.helpers::tidy_plus_plus( add_reference_rows = FALSE, add_estimate_to_reference_rows = FALSE, add_n = FALSE, intercept = FALSE )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression_basic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Basic Regression ARD — ard_regression_basic","text":"","code":"ard_regression_basic( x, tidy_fun = broom.helpers::tidy_with_broom_or_parameters, stats_to_remove = c(\"term\", \"var_type\", \"var_label\", \"var_class\", \"label\", \"contrasts_type\", \"contrasts\", \"var_nlevels\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression_basic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Basic Regression ARD — ard_regression_basic","text":"x regression model object tidy_fun (function) tidier. Default broom.helpers::tidy_with_broom_or_parameters stats_to_remove (character) character vector statistic names remove. Default c(\"term\", \"var_type\", \"var_label\", \"var_class\", \"label\", \"contrasts_type\", \"contrasts\", \"var_nlevels\"). ... Arguments passed broom.helpers::tidy_plus_plus()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression_basic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Basic Regression ARD — ard_regression_basic","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_regression_basic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Basic Regression ARD — ard_regression_basic","text":"","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_regression_basic() #> {cards} data frame: 12 x 9 #> variable variable_level context stat_name stat_label stat #> 1 ARM Xanomeli… regressi… estimate Coeffici… -0.828 #> 2 ARM Xanomeli… regressi… std.error Standard… 1.267 #> 3 ARM Xanomeli… regressi… statistic statistic -0.654 #> 4 ARM Xanomeli… regressi… p.value p-value 0.514 #> 5 ARM Xanomeli… regressi… conf.low CI Lower… -3.324 #> 6 ARM Xanomeli… regressi… conf.high CI Upper… 1.668 #> 7 ARM Xanomeli… regressi… estimate Coeffici… 0.457 #> 8 ARM Xanomeli… regressi… std.error Standard… 1.267 #> 9 ARM Xanomeli… regressi… statistic statistic 0.361 #> 10 ARM Xanomeli… regressi… p.value p-value 0.719 #> 11 ARM Xanomeli… regressi… conf.low CI Lower… -2.039 #> 12 ARM Xanomeli… regressi… conf.high CI Upper… 2.953 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_smd_smd.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Standardized Mean Difference — ard_smd_smd","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"Standardized mean difference calculated via smd::smd() na.rm = TRUE. Additionally, function add confidence interval SMD std.error=TRUE, original smd::smd() include.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_smd_smd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"","code":"ard_smd_smd(data, by, variables, std.error = TRUE, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_smd_smd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"data (data.frame/survey.design) data frame object class 'survey.design' (typically created survey::svydesign()). (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable. std.error (scalar logical) Logical indicator computing standard errors using smd::compute_smd_var(). Default TRUE. conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed smd::smd()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_smd_smd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_smd_smd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"","code":"ard_smd_smd(cards::ADSL, by = SEX, variables = AGE) #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 SEX AGE smd_smd estimate Standard… 0.157 #> 2 SEX AGE smd_smd std.error Standard… 0.127 #> 3 SEX AGE smd_smd conf.low conf.low -0.091 #> 4 SEX AGE smd_smd conf.high conf.high 0.405 #> 5 SEX AGE smd_smd method method Standard… #> 6 SEX AGE smd_smd gref Integer … 1 #> ℹ 3 more variables: fmt_fn, warning, error ard_smd_smd(cards::ADSL, by = SEX, variables = AGEGR1) #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 SEX AGEGR1 smd_smd estimate Standard… 0.103 #> 2 SEX AGEGR1 smd_smd std.error Standard… 0.127 #> 3 SEX AGEGR1 smd_smd conf.low conf.low -0.145 #> 4 SEX AGEGR1 smd_smd conf.high conf.high 0.351 #> 5 SEX AGEGR1 smd_smd method method Standard… #> 6 SEX AGEGR1 smd_smd gref Integer … 1 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_anova.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD ANOVA — ard_stats_anova","title":"ARD ANOVA — ard_stats_anova","text":"Prepare ANOVA results stats::anova() function. Users may pass pre-calculated stats::anova() object list formulas. latter case, models constructed using information passed models passed stats::anova().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_anova.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD ANOVA — ard_stats_anova","text":"","code":"ard_stats_anova(x, ...) # S3 method for class 'anova' ard_stats_anova(x, method_text = \"ANOVA results from `stats::anova()`\", ...) # S3 method for class 'data.frame' ard_stats_anova( x, formulas, method, method.args = list(), package = \"base\", method_text = \"ANOVA results from `stats::anova()`\", ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_anova.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD ANOVA — ard_stats_anova","text":"x (anova data.frame) object class 'anova' created stats::anova() data frame ... dots future extensions must empty. method_text (string) string method used. Default \"ANOVA results stats::anova()\". provide option change stats::anova() can produce results many types models may warrant precise description. formulas (list) list formulas method (string) string function naming function called, e.g. \"glm\". function belongs library attached, package name must specified package argument. method.args (named list) named list arguments passed method. Note list may contain non-standard evaluation components. wrapping function functions, argument must passed way evaluate list, e.g. using rlang's embrace operator {{ . }}. package (string) string package name temporarily loaded function specified method executed.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_anova.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD ANOVA — ard_stats_anova","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_anova.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD ANOVA — ard_stats_anova","text":"list formulas supplied ard_stats_anova(), formulas along information arguments, used construct models pass models stats::anova(). models constructed using rlang::exec(), similar .call(). function executed withr::with_namespace(package), allows use ard_stats_anova(method) packages, e.g. package = 'lme4' must specified method = 'glmer'. See example .","code":"rlang::exec(.fn = method, formula = formula, data = data, !!!method.args)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_anova.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD ANOVA — ard_stats_anova","text":"","code":"anova( lm(mpg ~ am, mtcars), lm(mpg ~ am + hp, mtcars) ) |> ard_stats_anova() #> {cards} data frame: 11 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 model_1 stats_an… term term mpg ~ am NULL #> 2 model_1 stats_an… df.residual df for r… 30 1 #> 3 model_1 stats_an… rss Residual… 720.897 1 #> 4 model_2 stats_an… term term mpg ~ am… NULL #> 5 model_2 stats_an… df.residual df for r… 29 1 #> 6 model_2 stats_an… rss Residual… 245.439 1 #> 7 model_2 stats_an… df Degrees … 1 1 #> 8 model_2 stats_an… sumsq Sum of S… 475.457 1 #> 9 model_2 stats_an… statistic statistic 56.178 1 #> 10 model_2 stats_an… p.value p-value 0 1 #> 11 model_2 stats_an… method method ANOVA re… NULL #> ℹ 2 more variables: warning, error ard_stats_anova( x = mtcars, formulas = list(am ~ mpg, am ~ mpg + hp), method = \"glm\", method.args = list(family = binomial) ) #> {cards} data frame: 10 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 model_1 stats_an… term term am ~ mpg NULL #> 2 model_1 stats_an… df.residual df for r… 30 1 #> 3 model_1 stats_an… residual.deviance residual… 29.675 1 #> 4 model_2 stats_an… term term am ~ mpg… NULL #> 5 model_2 stats_an… df.residual df for r… 29 1 #> 6 model_2 stats_an… residual.deviance residual… 19.233 1 #> 7 model_2 stats_an… df Degrees … 1 1 #> 8 model_2 stats_an… deviance deviance 10.443 1 #> 9 model_2 stats_an… p.value p-value 0.001 1 #> 10 model_2 stats_an… method method ANOVA re… NULL #> ℹ 2 more variables: warning, error ard_stats_anova( x = mtcars, formulas = list(am ~ 1 + (1 | vs), am ~ mpg + (1 | vs)), method = \"glmer\", method.args = list(family = binomial), package = \"lme4\" ) #> {cards} data frame: 16 x 8 #> variable context stat_name stat_label stat warning #> 1 model_1 stats_an… term term MODEL1 failed t… #> 2 model_1 stats_an… npar npar 2 failed t… #> 3 model_1 stats_an… AIC AIC 47.23 failed t… #> 4 model_1 stats_an… BIC BIC 50.161 failed t… #> 5 model_1 stats_an… logLik logLik -21.615 failed t… #> 6 model_1 stats_an… deviance deviance 43.23 failed t… #> 7 model_2 stats_an… term term MODEL2 failed t… #> 8 model_2 stats_an… npar npar 3 failed t… #> 9 model_2 stats_an… AIC AIC 35.25 failed t… #> 10 model_2 stats_an… BIC BIC 39.647 failed t… #> 11 model_2 stats_an… logLik logLik -14.625 failed t… #> 12 model_2 stats_an… deviance deviance 29.25 failed t… #> 13 model_2 stats_an… statistic statistic 13.979 failed t… #> 14 model_2 stats_an… df Degrees … 1 failed t… #> 15 model_2 stats_an… p.value p-value 0 failed t… #> 16 model_2 stats_an… method method ANOVA re… failed t… #> ℹ 2 more variables: fmt_fn, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_aov.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD ANOVA — ard_stats_aov","title":"ARD ANOVA — ard_stats_aov","text":"Analysis results data Analysis Variance. Calculated stats::aov()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_aov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD ANOVA — ard_stats_aov","text":"","code":"ard_stats_aov(formula, data, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_aov.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD ANOVA — ard_stats_aov","text":"formula formula specifying model. data data frame variables specified formula found. missing, variables searched standard way. ... arguments passed stats::aov(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_aov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD ANOVA — ard_stats_aov","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_aov.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD ANOVA — ard_stats_aov","text":"","code":"ard_stats_aov(AGE ~ ARM, data = cards::ADSL) #> {cards} data frame: 5 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 ARM stats_aov sumsq Sum of S… 71.386 1 #> 2 ARM stats_aov df Degrees … 2 1 #> 3 ARM stats_aov meansq Mean of … 35.693 1 #> 4 ARM stats_aov statistic Statistic 0.523 1 #> 5 ARM stats_aov p.value p-value 0.593 1 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_chisq_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Chi-squared Test — ard_stats_chisq_test","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"Analysis results data Pearson's Chi-squared Test. Calculated chisq.test(x = data[[variable]], y = data[[]], ...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_chisq_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"","code":"ard_stats_chisq_test(data, by, variables, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_chisq_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"data (data.frame) data frame. (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable. ... additional arguments passed chisq.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_chisq_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_chisq_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"","code":"cards::ADSL |> ard_stats_chisq_test(by = \"ARM\", variables = \"AGEGR1\") #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label #> 1 ARM AGEGR1 stats_ch… statistic X-square… #> 2 ARM AGEGR1 stats_ch… p.value p-value #> 3 ARM AGEGR1 stats_ch… parameter Degrees … #> 4 ARM AGEGR1 stats_ch… method method #> 5 ARM AGEGR1 stats_ch… correct correct #> 6 ARM AGEGR1 stats_ch… p p #> 7 ARM AGEGR1 stats_ch… rescale.p rescale.p #> 8 ARM AGEGR1 stats_ch… simulate.p.value simulate… #> 9 ARM AGEGR1 stats_ch… B B #> stat #> 1 6.852 #> 2 0.144 #> 3 4 #> 4 Pearson'… #> 5 TRUE #> 6 rep, 1/length(x), length(x) #> 7 FALSE #> 8 FALSE #> 9 2000 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_fisher_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Fisher's Exact Test — ard_stats_fisher_test","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"Analysis results data Fisher's Exact Test. Calculated fisher.test(x = data[[variable]], y = data[[]], ...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_fisher_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"","code":"ard_stats_fisher_test(data, by, variables, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_fisher_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"data (data.frame) data frame. (tidy-select) column name compare variables (tidy-select) column names compared. Independent tests computed variable. conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... additional arguments passed fisher.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_fisher_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_fisher_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"","code":"cards::ADSL[1:30, ] |> ard_stats_fisher_test(by = \"ARM\", variables = \"AGEGR1\") #> {cards} data frame: 12 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGEGR1 stats_fi… p.value p-value 0.089 #> 2 ARM AGEGR1 stats_fi… method method Fisher's… #> 3 ARM AGEGR1 stats_fi… alternative alternat… two.sided #> 4 ARM AGEGR1 stats_fi… workspace workspace 2e+05 #> 5 ARM AGEGR1 stats_fi… hybrid hybrid FALSE #> 6 ARM AGEGR1 stats_fi… hybridPars hybridPa… c, 5, 80, 1 #> 7 ARM AGEGR1 stats_fi… control control list #> 8 ARM AGEGR1 stats_fi… or or 1 #> 9 ARM AGEGR1 stats_fi… conf.int conf.int TRUE #> 10 ARM AGEGR1 stats_fi… conf.level conf.lev… 0.95 #> 11 ARM AGEGR1 stats_fi… simulate.p.value simulate… FALSE #> 12 ARM AGEGR1 stats_fi… B B 2000 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_kruskal_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"Analysis results data Kruskal-Wallis Rank Sum Test. Calculated kruskal.test(data[[variable]], data[[]], ...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_kruskal_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"","code":"ard_stats_kruskal_test(data, by, variables)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_kruskal_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"data (data.frame) data frame. (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_kruskal_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_kruskal_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"","code":"cards::ADSL |> ard_stats_kruskal_test(by = \"ARM\", variables = \"AGE\") #> {cards} data frame: 4 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_kr… statistic Kruskal-… 1.635 #> 2 ARM AGE stats_kr… p.value p-value 0.442 #> 3 ARM AGE stats_kr… parameter Degrees … 2 #> 4 ARM AGE stats_kr… method method Kruskal-… #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mcnemar_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD McNemar's Test — ard_stats_mcnemar_test","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"Analysis results data McNemar's statistical test. two functions depending structure data. ard_stats_mcnemar_test() structure expected stats::mcnemar.test() ard_stats_mcnemar_test_long() one row per ID per group","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mcnemar_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"","code":"ard_stats_mcnemar_test(data, by, variables, ...) ard_stats_mcnemar_test_long(data, by, variables, id, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mcnemar_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"data (data.frame) data frame. See details. (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable. ... arguments passed stats::mcnemar.test(...) id (tidy-select) column name subject participant ID","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mcnemar_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mcnemar_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"ard_stats_mcnemar_test() function, data expected one row per subject. data passed stats::mcnemar.test(x = data[[variable]], y = data[[]], ...). Please use table(x = data[[variable]], y = data[[]]) check contingency table.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mcnemar_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"","code":"cards::ADSL |> ard_stats_mcnemar_test(by = \"SEX\", variables = \"EFFFL\") #> {cards} data frame: 5 x 9 #> group1 variable context stat_name stat_label stat #> 1 SEX EFFFL stats_mc… statistic X-square… 111.91 #> 2 SEX EFFFL stats_mc… p.value p-value 0 #> 3 SEX EFFFL stats_mc… parameter Degrees … 1 #> 4 SEX EFFFL stats_mc… method method McNemar'… #> 5 SEX EFFFL stats_mc… correct correct TRUE #> ℹ 3 more variables: fmt_fn, warning, error set.seed(1234) cards::ADSL[c(\"USUBJID\", \"TRT01P\")] |> dplyr::mutate(TYPE = \"PLANNED\") |> dplyr::rename(TRT01 = TRT01P) %>% dplyr::bind_rows(dplyr::mutate(., TYPE = \"ACTUAL\", TRT01 = sample(TRT01))) |> ard_stats_mcnemar_test_long( by = TYPE, variable = TRT01, id = USUBJID ) #> {cards} data frame: 5 x 9 #> group1 variable context stat_name stat_label stat #> 1 TYPE TRT01 stats_mc… statistic X-square… 1.353 #> 2 TYPE TRT01 stats_mc… p.value p-value 0.717 #> 3 TYPE TRT01 stats_mc… parameter Degrees … 3 #> 4 TYPE TRT01 stats_mc… method method McNemar'… #> 5 TYPE TRT01 stats_mc… correct correct TRUE #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mood_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Mood Test — ard_stats_mood_test","title":"ARD Mood Test — ard_stats_mood_test","text":"Analysis results data Mood two sample test scale. Note confused Brown-Mood test medians.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mood_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Mood Test — ard_stats_mood_test","text":"","code":"ard_stats_mood_test(data, by, variables, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mood_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Mood Test — ard_stats_mood_test","text":"data (data.frame) data frame. See details. (tidy-select) column name compare . variables (tidy-select) column name compared. Independent tests run variable. ... arguments passed mood.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mood_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Mood Test — ard_stats_mood_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mood_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Mood Test — ard_stats_mood_test","text":"ard_stats_mood_test() function, data expected one row per subject. data passed mood.test(data[[variable]] ~ data[[]], ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_mood_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Mood Test — ard_stats_mood_test","text":"","code":"cards::ADSL |> ard_stats_mood_test(by = \"SEX\", variables = \"AGE\") #> {cards} data frame: 4 x 9 #> group1 variable context stat_name stat_label stat #> 1 SEX AGE stats_mo… statistic Z-Statis… 0.129 #> 2 SEX AGE stats_mo… p.value p-value 0.897 #> 3 SEX AGE stats_mo… method method Mood two… #> 4 SEX AGE stats_mo… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_oneway_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD One-way Test — ard_stats_oneway_test","title":"ARD One-way Test — ard_stats_oneway_test","text":"Analysis results data Testing Equal Means One-Way Layout. calculated oneway.test()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_oneway_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD One-way Test — ard_stats_oneway_test","text":"","code":"ard_stats_oneway_test(formula, data, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_oneway_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD One-way Test — ard_stats_oneway_test","text":"formula formula form lhs ~ rhs lhs gives sample values rhs corresponding groups. data optional matrix data frame (similar: see model.frame) containing variables formula formula. default variables taken environment(formula). ... additional arguments passed oneway.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_oneway_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD One-way Test — ard_stats_oneway_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_oneway_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD One-way Test — ard_stats_oneway_test","text":"","code":"ard_stats_oneway_test(AGE ~ ARM, data = cards::ADSL) #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_on… num.df Degrees … 2 #> 2 ARM AGE stats_on… den.df Denomina… 167.237 #> 3 ARM AGE stats_on… statistic F Statis… 0.547 #> 4 ARM AGE stats_on… p.value p-value 0.58 #> 5 ARM AGE stats_on… method Method One-way … #> 6 ARM AGE stats_on… var.equal var.equal FALSE #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_poisson_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Poisson Test — ard_stats_poisson_test","title":"ARD Poisson Test — ard_stats_poisson_test","text":"Analysis results data exact tests simple null hypothesis rate parameter Poisson distribution, comparison two rate parameters.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_poisson_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Poisson Test — ard_stats_poisson_test","text":"","code":"ard_stats_poisson_test( data, variables, na.rm = TRUE, by = NULL, conf.level = 0.95, ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_poisson_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Poisson Test — ard_stats_poisson_test","text":"data (data.frame) data frame. See details. variables (tidy-select) names event time variables (order) used computations. Must length 2. na.rm (scalar logical) whether missing values removed computations. Default TRUE. (tidy-select) optional column name compare . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed poisson.test().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_poisson_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Poisson Test — ard_stats_poisson_test","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_poisson_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Poisson Test — ard_stats_poisson_test","text":"ard_stats_poisson_test() function, data expected one row per subject. specified, exact Poisson test rate parameter performed. Otherwise, Poisson comparison two rate parameters performed levels . 2 levels, error occur.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_poisson_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Poisson Test — ard_stats_poisson_test","text":"","code":"# Exact test of rate parameter against null hypothesis cards::ADTTE |> ard_stats_poisson_test(variables = c(CNSR, AVAL)) #> {cards} data frame: 10 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 AVAL stats_po… estimate Estimate… 0.006 1 #> 2 AVAL stats_po… statistic Number o… 102 1 #> 3 AVAL stats_po… p.value p-value 0 1 #> 4 AVAL stats_po… parameter Expected… 16853 1 #> 5 AVAL stats_po… conf.low CI Lower… 0.005 1 #> 6 AVAL stats_po… conf.high CI Upper… 0.007 1 #> 7 AVAL stats_po… method method Exact Po… NULL #> 8 AVAL stats_po… alternative alternat… two.sided NULL #> 9 AVAL stats_po… conf.level CI Confi… 0.95 1 #> 10 AVAL stats_po… mu H0 Mean 1 1 #> ℹ 2 more variables: warning, error # Comparison test of ratio of 2 rate parameters against null hypothesis cards::ADTTE |> dplyr::filter(TRTA %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_stats_poisson_test(by = TRTA, variables = c(CNSR, AVAL)) #> {cards} data frame: 10 x 9 #> group1 variable context stat_name stat_label stat #> 1 TRTA AVAL stats_po… estimate Estimate… 0.768 #> 2 TRTA AVAL stats_po… statistic Number o… 57 #> 3 TRTA AVAL stats_po… p.value p-value 0.293 #> 4 TRTA AVAL stats_po… parameter Expected… 61.078 #> 5 TRTA AVAL stats_po… conf.low CI Lower… 0.466 #> 6 TRTA AVAL stats_po… conf.high CI Upper… 1.306 #> 7 TRTA AVAL stats_po… method method Comparis… #> 8 TRTA AVAL stats_po… alternative alternat… two.sided #> 9 TRTA AVAL stats_po… conf.level CI Confi… 0.95 #> 10 TRTA AVAL stats_po… mu H0 Mean 1 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_prop_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD 2-sample proportion test — ard_stats_prop_test","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"Analysis results data 2-sample test proportions using stats::prop.test().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_prop_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"","code":"ard_stats_prop_test(data, by, variables, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_prop_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"data (data.frame) data frame. (tidy-select) column name compare variables (tidy-select) column names compared. Must binary column coded TRUE/FALSE 1/0. Independent tests computed variable. conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed prop.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_prop_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_prop_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"","code":"mtcars |> ard_stats_prop_test(by = vs, variables = am) #> {cards} data frame: 13 x 9 #> group1 variable context stat_name stat_label stat #> 1 vs am stats_pr… estimate Rate Dif… -0.167 #> 2 vs am stats_pr… estimate1 Group 1 … 0.333 #> 3 vs am stats_pr… estimate2 Group 2 … 0.5 #> 4 vs am stats_pr… statistic X-square… 0.348 #> 5 vs am stats_pr… p.value p-value 0.556 #> 6 vs am stats_pr… parameter Degrees … 1 #> 7 vs am stats_pr… conf.low CI Lower… -0.571 #> 8 vs am stats_pr… conf.high CI Upper… 0.237 #> 9 vs am stats_pr… method method 2-sample… #> 10 vs am stats_pr… alternative alternat… two.sided #> 11 vs am stats_pr… p p #> 12 vs am stats_pr… conf.level CI Confi… 0.95 #> 13 vs am stats_pr… correct Yates' c… TRUE #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD t-test — ard_stats_t_test","title":"ARD t-test — ard_stats_t_test","text":"Analysis results data paired non-paired t-tests.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD t-test — ard_stats_t_test","text":"","code":"ard_stats_t_test(data, variables, by = NULL, conf.level = 0.95, ...) ard_stats_paired_t_test(data, by, variables, id, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD t-test — ard_stats_t_test","text":"data (data.frame) data frame. See details. variables (tidy-select) column names compared. Independent t-tests computed variable. (tidy-select) optional column name compare . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed t.test() id (tidy-select) column name subject participant ID","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD t-test — ard_stats_t_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD t-test — ard_stats_t_test","text":"ard_stats_t_test() function, data expected one row per subject. data passed t.test(data[[variable]] ~ data[[]], paired = FALSE, ...). ard_stats_paired_t_test() function, data expected one row per subject per level. t-test calculated, data reshaped wide format one row per subject. data passed t.test(x = data_wide[[]], y = data_wide[[]], paired = TRUE, ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD t-test — ard_stats_t_test","text":"","code":"cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_stats_t_test(by = ARM, variables = c(AGE, BMIBL)) #> {cards} data frame: 28 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_t_… estimate Mean Dif… 0.828 #> 2 ARM AGE stats_t_… estimate1 Group 1 … 75.209 #> 3 ARM AGE stats_t_… estimate2 Group 2 … 74.381 #> 4 ARM AGE stats_t_… statistic t Statis… 0.655 #> 5 ARM AGE stats_t_… p.value p-value 0.513 #> 6 ARM AGE stats_t_… parameter Degrees … 167.362 #> 7 ARM AGE stats_t_… conf.low CI Lower… -1.668 #> 8 ARM AGE stats_t_… conf.high CI Upper… 3.324 #> 9 ARM AGE stats_t_… method method Welch Tw… #> 10 ARM AGE stats_t_… alternative alternat… two.sided #> ℹ 18 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 3 more variables: fmt_fn, warning, error # constructing a paired data set, # where patients receive both treatments cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> ard_stats_paired_t_test(by = ARM, variables = AGE, id = USUBJID) #> {cards} data frame: 12 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_t_… estimate Mean Dif… 0.798 #> 2 ARM AGE stats_t_… statistic t Statis… 0.628 #> 3 ARM AGE stats_t_… p.value p-value 0.531 #> 4 ARM AGE stats_t_… parameter Degrees … 83 #> 5 ARM AGE stats_t_… conf.low CI Lower… -1.727 #> 6 ARM AGE stats_t_… conf.high CI Upper… 3.322 #> 7 ARM AGE stats_t_… method method Paired t… #> 8 ARM AGE stats_t_… alternative alternat… two.sided #> 9 ARM AGE stats_t_… mu H0 Mean 0 #> 10 ARM AGE stats_t_… paired Paired t… TRUE #> 11 ARM AGE stats_t_… var.equal Equal Va… FALSE #> 12 ARM AGE stats_t_… conf.level CI Confi… 0.95 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test_onesample.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD one-sample t-test — ard_stats_t_test_onesample","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"Analysis results data one-sample t-tests. Result may stratified including argument.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test_onesample.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"","code":"ard_stats_t_test_onesample( data, variables, by = dplyr::group_vars(data), conf.level = 0.95, ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test_onesample.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"data (data.frame) data frame. See details. variables (tidy-select) column names analyzed. Independent t-tests computed variable. (tidy-select) optional column name stratify results . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed t.test()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test_onesample.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_t_test_onesample.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"","code":"cards::ADSL |> ard_stats_t_test_onesample(by = ARM, variables = AGE) #> {cards} data frame: 30 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 ARM Placebo AGE estimate Mean 75.209 #> 2 ARM Placebo AGE statistic t Statis… 81.193 #> 3 ARM Placebo AGE p.value p-value 0 #> 4 ARM Placebo AGE parameter Degrees … 85 #> 5 ARM Placebo AGE conf.low CI Lower… 73.368 #> 6 ARM Placebo AGE conf.high CI Upper… 77.051 #> 7 ARM Placebo AGE method method One Samp… #> 8 ARM Placebo AGE alternative alternat… two.sided #> 9 ARM Placebo AGE mu H0 Mean 0 #> 10 ARM Placebo AGE conf.level CI Confi… 0.95 #> ℹ 20 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"Analysis results data paired non-paired Wilcoxon Rank-Sum tests.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"","code":"ard_stats_wilcox_test(data, variables, by = NULL, conf.level = 0.95, ...) ard_stats_paired_wilcox_test(data, by, variables, id, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"data (data.frame) data frame. See details. variables (tidy-select) column names compared. Independent tests computed variable. (tidy-select) optional column name compare . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed wilcox.test(...) id (tidy-select) column name subject participant ID.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"ard_stats_wilcox_test() function, data expected one row per subject. data passed wilcox.test(data[[variable]] ~ data[[]], paired = FALSE, ...). ard_stats_paired_wilcox_test() function, data expected one row per subject per level. test calculated, data reshaped wide format one row per subject. data passed wilcox.test(x = data_wide[[]], y = data_wide[[]], paired = TRUE, ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"","code":"cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_stats_wilcox_test(by = \"ARM\", variables = \"AGE\") #> {cards} data frame: 12 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_wi… statistic X-square… 3862.5 #> 2 ARM AGE stats_wi… p.value p-value 0.435 #> 3 ARM AGE stats_wi… method method Wilcoxon… #> 4 ARM AGE stats_wi… alternative alternat… two.sided #> 5 ARM AGE stats_wi… mu mu 0 #> 6 ARM AGE stats_wi… paired Paired t… FALSE #> 7 ARM AGE stats_wi… exact exact #> 8 ARM AGE stats_wi… correct correct TRUE #> 9 ARM AGE stats_wi… conf.int conf.int FALSE #> 10 ARM AGE stats_wi… conf.level CI Confi… 0.95 #> 11 ARM AGE stats_wi… tol.root tol.root 0 #> 12 ARM AGE stats_wi… digits.rank digits.r… Inf #> ℹ 3 more variables: fmt_fn, warning, error # constructing a paired data set, # where patients receive both treatments cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> ard_stats_paired_wilcox_test(by = ARM, variables = AGE, id = USUBJID) #> {cards} data frame: 12 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_wi… statistic X-square… 1754 #> 2 ARM AGE stats_wi… p.value p-value 0.522 #> 3 ARM AGE stats_wi… method method Wilcoxon… #> 4 ARM AGE stats_wi… alternative alternat… two.sided #> 5 ARM AGE stats_wi… mu mu 0 #> 6 ARM AGE stats_wi… paired Paired t… TRUE #> 7 ARM AGE stats_wi… exact exact #> 8 ARM AGE stats_wi… correct correct TRUE #> 9 ARM AGE stats_wi… conf.int conf.int FALSE #> 10 ARM AGE stats_wi… conf.level CI Confi… 0.95 #> 11 ARM AGE stats_wi… tol.root tol.root 0 #> 12 ARM AGE stats_wi… digits.rank digits.r… Inf #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test_onesample.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"Analysis results data one-sample Wilcox Rank-sum. Result may stratified including argument.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test_onesample.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"","code":"ard_stats_wilcox_test_onesample( data, variables, by = dplyr::group_vars(data), conf.level = 0.95, ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test_onesample.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"data (data.frame) data frame. See details. variables (tidy-select) column names analyzed. Independent Wilcox Rank-sum tests computed variable. (tidy-select) optional column name stratify results . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed wilcox.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test_onesample.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_stats_wilcox_test_onesample.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"","code":"cards::ADSL |> ard_stats_wilcox_test_onesample(by = ARM, variables = AGE) #> {cards} data frame: 27 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 ARM Placebo AGE statistic t Statis… 3741 #> 2 ARM Placebo AGE p.value p-value 0 #> 3 ARM Placebo AGE method method Wilcoxon… #> 4 ARM Placebo AGE alternative alternat… two.sided #> 5 ARM Placebo AGE mu H0 Mean 0 #> 6 ARM Placebo AGE conf.int conf.int FALSE #> 7 ARM Placebo AGE tol.root tol.root 0 #> 8 ARM Placebo AGE digits.rank digits.r… Inf #> 9 ARM Placebo AGE conf.level CI Confi… 0.95 #> 10 ARM Xanomeli… AGE statistic t Statis… 3570 #> ℹ 17 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svychisq.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survey Chi-Square Test — ard_survey_svychisq","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"Analysis results data survey Chi-Square test using survey::svychisq(). two-way comparisons supported.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svychisq.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"","code":"ard_survey_svychisq(data, by, variables, statistic = \"F\", ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svychisq.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"data (survey.design) survey design object often created {survey} package (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable. statistic (character) statistic used estimate Chisq p-value. Default Rao-Scott second-order correction (\"F\"). See survey::svychisq available statistics options. ... arguments passed survey::svychisq().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svychisq.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svychisq.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_survey_svychisq(dclus1, variables = sch.wide, by = comp.imp, statistic = \"F\") #> {cards} data frame: 5 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp sch.wide survey_s… ndf Nominato… 1 #> 2 comp.imp sch.wide survey_s… ddf Denomina… 14 #> 3 comp.imp sch.wide survey_s… statistic Statistic 236.895 #> 4 comp.imp sch.wide survey_s… p.value p-value 0 #> 5 comp.imp sch.wide survey_s… method method Pearson'… #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyranktest.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survey rank test — ard_survey_svyranktest","title":"ARD Survey rank test — ard_survey_svyranktest","text":"Analysis results data survey wilcox test using survey::svyranktest().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyranktest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survey rank test — ard_survey_svyranktest","text":"","code":"ard_survey_svyranktest(data, by, variables, test, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyranktest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survey rank test — ard_survey_svyranktest","text":"data (survey.design) survey design object often created survey::svydesign() (tidy-select) column name compare variables (tidy-select) column names compared. Independent tests run variable. test (string) string denote rank test use: \"wilcoxon\", \"vanderWaerden\", \"median\", \"KruskalWallis\" ... arguments passed survey::svyranktest()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyranktest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survey rank test — ard_survey_svyranktest","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyranktest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survey rank test — ard_survey_svyranktest","text":"","code":"data(api, package = \"survey\") dclus2 <- survey::svydesign(id = ~ dnum + snum, fpc = ~ fpc1 + fpc2, data = apiclus2) ard_survey_svyranktest(dclus2, variables = enroll, by = comp.imp, test = \"wilcoxon\") #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Median o… -0.106 #> 2 comp.imp enroll survey_s… statistic Statistic -1.719 #> 3 comp.imp enroll survey_s… p.value p-value 0.094 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error ard_survey_svyranktest(dclus2, variables = enroll, by = comp.imp, test = \"vanderWaerden\") #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Median o… -0.379 #> 2 comp.imp enroll survey_s… statistic Statistic -1.584 #> 3 comp.imp enroll survey_s… p.value p-value 0.122 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error ard_survey_svyranktest(dclus2, variables = enroll, by = comp.imp, test = \"median\") #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Median o… -0.124 #> 2 comp.imp enroll survey_s… statistic Statistic -0.914 #> 3 comp.imp enroll survey_s… p.value p-value 0.367 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error ard_survey_svyranktest(dclus2, variables = enroll, by = comp.imp, test = \"KruskalWallis\") #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Median o… -0.106 #> 2 comp.imp enroll survey_s… statistic Statistic -1.719 #> 3 comp.imp enroll survey_s… p.value p-value 0.094 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyttest.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survey t-test — ard_survey_svyttest","title":"ARD Survey t-test — ard_survey_svyttest","text":"Analysis results data survey t-test using survey::svyttest().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyttest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survey t-test — ard_survey_svyttest","text":"","code":"ard_survey_svyttest(data, by, variables, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyttest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survey t-test — ard_survey_svyttest","text":"data (survey.design) survey design object often created survey::svydesign() (tidy-select) column name compare variables (tidy-select) column names compared. Independent tests run variable. conf.level (double) confidence level returned confidence interval. Must c(0, 1). Default 0.95 ... arguments passed survey::svyttest()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyttest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survey t-test — ard_survey_svyttest","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survey_svyttest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survey t-test — ard_survey_svyttest","text":"","code":"data(api, package = \"survey\") dclus2 <- survey::svydesign(id = ~ dnum + snum, fpc = ~ fpc1 + fpc2, data = apiclus2) ard_survey_svyttest(dclus2, variables = enroll, by = comp.imp, conf.level = 0.9) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Mean -225.737 #> 2 comp.imp enroll survey_s… statistic t Statis… -2.888 #> 3 comp.imp enroll survey_s… p.value p-value 0.007 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative alternat… two.sided #> 7 comp.imp enroll survey_s… conf.low CI Lower… -357.69 #> 8 comp.imp enroll survey_s… conf.high CI Upper… -93.784 #> 9 comp.imp enroll survey_s… conf.level CI Confi… 0.9 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survdiff.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD for Difference in Survival — ard_survival_survdiff","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"Analysis results data comparison survival using survival::survdiff().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survdiff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"","code":"ard_survival_survdiff(formula, data, rho = 0, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survdiff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"formula (formula) formula data (data.frame) data frame rho (scalar numeric) numeric scalar passed survival::survdiff(rho). Default rho=0. ... additional arguments passed survival::survdiff()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survdiff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survdiff.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"","code":"library(survival) library(ggsurvfit) #> Loading required package: ggplot2 ard_survival_survdiff(Surv_CNSR(AVAL, CNSR) ~ TRTA, data = cards::ADTTE) #> {cards} data frame: 4 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 TRTA survival… statistic X^2 Stat… 60.27 1 #> 2 TRTA survival… df Degrees … 2 1 #> 3 TRTA survival… p.value p-value 0 1 #> 4 TRTA survival… method method Log-rank… NULL #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survival Estimates — ard_survival_survfit","title":"ARD Survival Estimates — ard_survival_survfit","text":"Analysis results data survival quantiles x-year survival estimates, extracted survival::survfit() model.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survival Estimates — ard_survival_survfit","text":"","code":"ard_survival_survfit(x, ...) # S3 method for class 'survfit' ard_survival_survfit(x, times = NULL, probs = NULL, type = NULL, ...) # S3 method for class 'data.frame' ard_survival_survfit( x, y, variables, times = NULL, probs = NULL, type = NULL, method.args = list(conf.int = 0.95), ... )"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survival Estimates — ard_survival_survfit","text":"x (survfit data.frame) object class survfit created survival::survfit() data frame. See details. ... dots future extensions must empty. times (numeric) vector times return survival probabilities. probs (numeric) vector probabilities values (0,1) specifying survival quantiles return. type (string NULL) type statistic report. Available Kaplan-Meier time estimates , otherwise type ignored. Default NULL. Must one following: y (Surv string) object class Surv created using survival::Surv(). object passed left-hand side formula constructed passed survival::survfit(). object can also passed string. variables (character) stratification variables passed right-hand side formula constructed passed survival::survfit(). method.args (named list) named list arguments passed survival::survfit().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survival Estimates — ard_survival_survfit","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Survival Estimates — ard_survival_survfit","text":"one either times probs parameters can specified. Times provided using scale time variable used fit provided survival fit model.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit.html","id":"formula-specification","dir":"Reference","previous_headings":"","what":"Formula Specification","title":"ARD Survival Estimates — ard_survival_survfit","text":"passing survival::survfit() object ard_survival_survfit(), survfit() call must use evaluated formula stored formula. Including proper formula call allows function accurately identify variables included estimation. See examples: , however, pass stored formula, e.g. survfit(my_formula, lung)","code":"library(cardx) library(survival) # include formula in `survfit()` call survfit(Surv(time, status) ~ sex, lung) |> ard_survival_survfit(time = 500) # you can also pass a data frame to `ard_survival_survfit()` as well. lung |> ard_survival_survfit(y = Surv(time, status), variables = \"sex\", time = 500)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit.html","id":"variable-classes","dir":"Reference","previous_headings":"","what":"Variable Classes","title":"ARD Survival Estimates — ard_survival_survfit","text":"survfit method called, class stratifying variables returned factor. data frame method called, original classes retained resulting ARD.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survival Estimates — ard_survival_survfit","text":"","code":"library(survival) library(ggsurvfit) survfit(Surv_CNSR(AVAL, CNSR) ~ TRTA, data = cards::ADTTE) |> ard_survival_survfit(times = c(60, 180)) #> {cards} data frame: 30 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 TRTA Placebo time 60 n.risk Number o… 59 #> 2 TRTA Placebo time 60 estimate Survival… 0.768 #> 3 TRTA Placebo time 60 std.error Standard… 0.047 #> 4 TRTA Placebo time 60 conf.high CI Upper… 0.866 #> 5 TRTA Placebo time 60 conf.low CI Lower… 0.682 #> 6 TRTA Placebo time 180 n.risk Number o… 35 #> 7 TRTA Placebo time 180 estimate Survival… 0.626 #> 8 TRTA Placebo time 180 std.error Standard… 0.056 #> 9 TRTA Placebo time 180 conf.high CI Upper… 0.746 #> 10 TRTA Placebo time 180 conf.low CI Lower… 0.526 #> ℹ 20 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error survfit(Surv_CNSR(AVAL, CNSR) ~ TRTA, data = cards::ADTTE, conf.int = 0.90) |> ard_survival_survfit(probs = c(0.25, 0.5, 0.75)) #> {cards} data frame: 27 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 TRTA Placebo prob 0.25 estimate Survival… 70 #> 2 TRTA Placebo prob 0.25 conf.high CI Upper… 110 #> 3 TRTA Placebo prob 0.25 conf.low CI Lower… 42 #> 4 TRTA Placebo prob 0.5 estimate Survival… NA #> 5 TRTA Placebo prob 0.5 conf.high CI Upper… NA #> 6 TRTA Placebo prob 0.5 conf.low CI Lower… NA #> 7 TRTA Placebo prob 0.75 estimate Survival… NA #> 8 TRTA Placebo prob 0.75 conf.high CI Upper… NA #> 9 TRTA Placebo prob 0.75 conf.low CI Lower… NA #> 10 TRTA Xanomeli… prob 0.25 estimate Survival… 14 #> ℹ 17 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error cards::ADTTE |> ard_survival_survfit(y = Surv_CNSR(AVAL, CNSR), variables = c(\"TRTA\", \"SEX\"), times = 90) #> {cards} data frame: 30 x 13 #> group1 group1_level group2 group2_level variable variable_level stat_name #> 1 TRTA Placebo SEX F time 90 n.risk #> 2 TRTA Placebo SEX F time 90 estimate #> 3 TRTA Placebo SEX F time 90 std.error #> 4 TRTA Placebo SEX F time 90 conf.high #> 5 TRTA Placebo SEX F time 90 conf.low #> 6 TRTA Placebo SEX M time 90 n.risk #> 7 TRTA Placebo SEX M time 90 estimate #> 8 TRTA Placebo SEX M time 90 std.error #> 9 TRTA Placebo SEX M time 90 conf.high #> 10 TRTA Placebo SEX M time 90 conf.low #> stat_label stat #> 1 Number o… 27 #> 2 Survival… 0.619 #> 3 Standard… 0.072 #> 4 CI Upper… 0.777 #> 5 CI Lower… 0.493 #> 6 Number o… 22 #> 7 Survival… 0.748 #> 8 Standard… 0.077 #> 9 CI Upper… 0.916 #> 10 CI Lower… 0.611 #> ℹ 20 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error # Competing Risks Example --------------------------- set.seed(1) ADTTE_MS <- cards::ADTTE %>% dplyr::mutate( CNSR = dplyr::case_when( CNSR == 0 ~ \"censor\", runif(dplyr::n()) < 0.5 ~ \"death from cancer\", TRUE ~ \"death other causes\" ) %>% factor() ) survfit(Surv(AVAL, CNSR) ~ TRTA, data = ADTTE_MS) %>% ard_survival_survfit(times = c(60, 180)) #> Multi-state model detected. Showing probabilities into state 'death from #> cancer'. #> {cards} data frame: 30 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 TRTA Placebo time 60 n.risk Number o… 59 #> 2 TRTA Placebo time 60 estimate Survival… 0.054 #> 3 TRTA Placebo time 60 std.error Standard… 0.026 #> 4 TRTA Placebo time 60 conf.high CI Upper… 0.14 #> 5 TRTA Placebo time 60 conf.low CI Lower… 0.021 #> 6 TRTA Placebo time 180 n.risk Number o… 35 #> 7 TRTA Placebo time 180 estimate Survival… 0.226 #> 8 TRTA Placebo time 180 std.error Standard… 0.054 #> 9 TRTA Placebo time 180 conf.high CI Upper… 0.361 #> 10 TRTA Placebo time 180 conf.low CI Lower… 0.142 #> ℹ 20 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit_diff.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survival Differences — ard_survival_survfit_diff","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"Calculate differences Kaplan-Meier estimator survival using results survival::survfit().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit_diff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"","code":"ard_survival_survfit_diff(x, times, conf.level = 0.95)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit_diff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"x (survift) object class 'survfit' typically created survival::survfit() times (numeric) vector times return survival probabilities. conf.level (scalar numeric) confidence level confidence interval. Default 0.95.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit_diff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_survival_survfit_diff.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"","code":"library(ggsurvfit) library(survival) survfit(Surv_CNSR() ~ TRTA, data = cards::ADTTE) |> ard_survival_survfit_diff(times = c(25, 50)) #> {cards} data frame: 32 x 11 #> group1 group1_level variable variable_level stat_name stat_label #> 1 TRTA Xanomeli… time 25 reference_level referenc… #> 2 TRTA Xanomeli… time 25 method method #> 3 TRTA Xanomeli… time 25 estimate Survival… #> 4 TRTA Xanomeli… time 25 std.error Survival… #> 5 TRTA Xanomeli… time 25 statistic z statis… #> 6 TRTA Xanomeli… time 25 conf.low CI Lower… #> 7 TRTA Xanomeli… time 25 conf.high CI Upper… #> 8 TRTA Xanomeli… time 25 p.value p-value #> 9 TRTA Xanomeli… time 50 reference_level referenc… #> 10 TRTA Xanomeli… time 50 method method #> stat #> 1 Placebo #> 2 Survival… #> 3 0.293 #> 4 0.067 #> 5 4.392 #> 6 0.162 #> 7 0.424 #> 8 0 #> 9 Placebo #> 10 Survival… #> ℹ 22 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_total_n.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Total N — ard_total_n.survey.design","title":"ARD Total N — ard_total_n.survey.design","text":"Returns total N survey object. placeholder variable name returned object \"..ard_total_n..\"","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_total_n.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Total N — ard_total_n.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_total_n(data, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/ard_total_n.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Total N — ard_total_n.survey.design","text":"data (survey.design) design object often created survey::svydesign(). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_total_n.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Total N — ard_total_n.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/ard_total_n.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Total N — ard_total_n.survey.design","text":"","code":"svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) ard_total_n(svy_titanic) #> {cards} data frame: 2 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 ..ard_total_n.. total_n N N 2201 #> 2 ..ard_total_n.. total_n N_unweighted Unweight… 32 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/cardx-package.html","id":null,"dir":"Reference","previous_headings":"","what":"cardx: Extra Analysis Results Data Utilities — cardx-package","title":"cardx: Extra Analysis Results Data Utilities — cardx-package","text":"Create extra Analysis Results Data (ARD) summary objects. package supplements simple ARD functions 'cards' package, exporting functions put statistical results ARD format. objects used re-used construct summary tables, visualizations, written reports.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/reference/cardx-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"cardx: Extra Analysis Results Data Utilities — cardx-package","text":"Maintainer: Daniel Sjoberg danield.sjoberg@gmail.com Authors: Abinaya Yogasekaram abinaya.yogasekaram@contractors.roche.com Emily de la Rua emily.de_la_rua@contractors.roche.com contributors: F. Hoffmann-La Roche AG [copyright holder, funder]","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/construction_helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"Construction Helpers — construction_helpers","title":"Construction Helpers — construction_helpers","text":"functions help construct calls various types models.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/construction_helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construction Helpers — construction_helpers","text":"","code":"construct_model(data, ...) # S3 method for class 'data.frame' construct_model( data, formula, method, method.args = list(), package = \"base\", env = caller_env(), ... ) # S3 method for class 'survey.design' construct_model( data, formula, method, method.args = list(), package = \"survey\", env = caller_env(), ... ) reformulate2( termlabels, response = NULL, intercept = TRUE, env = parent.frame(), pattern_term = NULL, pattern_response = NULL ) bt(x, pattern = NULL) bt_strip(x)"},{"path":"https://insightsengineering.github.io/cardx/reference/construction_helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construction Helpers — construction_helpers","text":"data construct_model.data.frame() (data.frame) data frame construct_model.survey.design() (survey.design) survey design object ... dots future extensions must empty. formula (formula) formula method (string) string function naming function called, e.g. \"glm\". function belongs library attached, package name must specified package argument. method.args (named list) named list arguments passed method. Note list may contain non-standard evaluation components. wrapping function functions, argument must passed way evaluate list, e.g. using rlang's embrace operator {{ . }}. package (string) string package name temporarily loaded function specified method executed. env environment evaluate expr. environment applicable quosures environments. termlabels character vector giving right-hand side model formula. zero-length. response character string, symbol call giving left-hand side model formula, NULL. intercept logical: formula intercept? x (character) character vector, typically variable names pattern, pattern_term, pattern_response DEPRECATED","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/construction_helpers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Construction Helpers — construction_helpers","text":"depends calling function","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/construction_helpers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Construction Helpers — construction_helpers","text":"construct_model(): Builds models form method(data = data, formula = formula, method.args!!!). package argument specified, package temporarily attached model evaluated. reformulate2(): copy reformulate() except variable names contain space wrapped backticks. bt(): Adds backticks character vector. bt_strip(): Removes backticks string begins ends backtick.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/construction_helpers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Construction Helpers — construction_helpers","text":"","code":"construct_model( data = mtcars, formula = am ~ mpg + (1 | vs), method = \"glmer\", method.args = list(family = binomial), package = \"lme4\" ) |> broom.mixed::tidy() #> # A tibble: 3 × 7 #> effect group term estimate std.error statistic p.value #> #> 1 fixed NA (Intercept) -8.70 4.12 -2.11 0.0347 #> 2 fixed NA mpg 0.409 0.199 2.05 0.0403 #> 3 ran_pars vs sd__(Intercept) 0.790 NA NA NA construct_model( data = mtcars |> dplyr::rename(`M P G` = mpg), formula = reformulate2(c(\"M P G\", \"cyl\"), response = \"hp\"), method = \"lm\" ) |> ard_regression() |> dplyr::filter(stat_name %in% c(\"term\", \"estimate\", \"p.value\")) #> {cards} data frame: 6 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 M P G regressi… term term `M P G` NULL #> 2 M P G regressi… estimate Coeffici… -2.775 1 #> 3 M P G regressi… p.value p-value 0.213 1 #> 4 cyl regressi… term term cyl NULL #> 5 cyl regressi… estimate Coeffici… 23.979 1 #> 6 cyl regressi… p.value p-value 0.003 1 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-check_dichotomous_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform Value Checks — .check_dichotomous_value","title":"Perform Value Checks — .check_dichotomous_value","text":"Check validity values passed ard_dichotomous(value).","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-check_dichotomous_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform Value Checks — .check_dichotomous_value","text":"","code":".check_dichotomous_value(data, value)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-check_dichotomous_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform Value Checks — .check_dichotomous_value","text":"data (data.frame) data frame value (named list) named list","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-check_dichotomous_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform Value Checks — .check_dichotomous_value","text":"returns invisible check successful, throws error message .","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-check_dichotomous_value.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform Value Checks — .check_dichotomous_value","text":"","code":"cardx:::.check_dichotomous_value(mtcars, list(cyl = 4))"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-extract_wald_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data from wald.test object — .extract_wald_results","title":"Extract data from wald.test object — .extract_wald_results","text":"Extract data wald.test object","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-extract_wald_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data from wald.test object — .extract_wald_results","text":"","code":".extract_wald_results(wald_test)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-extract_wald_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data from wald.test object — .extract_wald_results","text":"wald_test (data.frame) wald test object object aod::wald.test()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-extract_wald_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract data from wald.test object — .extract_wald_results","text":"data frame containing wald test results.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_cohens_d_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Cohen's D Test to ARD — .format_cohens_d_results","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"Convert Cohen's D Test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_cohens_d_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"","code":".format_cohens_d_results(by, variable, lst_tidy, paired, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_cohens_d_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). paired TRUE, values x y considered paired. produces effect size equivalent one-sample effect size x - y. See also repeated_measures_d() options. ... passed cohens_d(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_cohens_d_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_cohens_d_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"","code":"cardx:::.format_cohens_d_results( by = \"ARM\", variable = \"AGE\", paired = FALSE, lst_tidy = cards::eval_capture_conditions( effectsize::hedges_g(data[[variable]] ~ data[[by]], paired = FALSE) |> parameters::standardize_names(style = \"broom\") ) ) #> {cards} data frame: 8 x 9 #> group1 variable stat_name stat_label stat error #> 1 ARM AGE estimate Effect S… object '… #> 2 ARM AGE conf.level CI Confi… object '… #> 3 ARM AGE conf.low CI Lower… object '… #> 4 ARM AGE conf.high CI Upper… object '… #> 5 ARM AGE mu H0 Mean 0 object '… #> 6 ARM AGE paired Paired t… FALSE object '… #> 7 ARM AGE pooled_sd Pooled S… TRUE object '… #> 8 ARM AGE alternative Alternat… two.sided object '… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_hedges_g_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Hedge's G Test to ARD — .format_hedges_g_results","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"Convert Hedge's G Test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_hedges_g_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"","code":".format_hedges_g_results(by, variable, lst_tidy, paired, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_hedges_g_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). paired TRUE, values x y considered paired. produces effect size equivalent one-sample effect size x - y. See also repeated_measures_d() options. ... passed hedges_g(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_hedges_g_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_hedges_g_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"","code":"cardx:::.format_hedges_g_results( by = \"ARM\", variable = \"AGE\", paired = FALSE, lst_tidy = cards::eval_capture_conditions( effectsize::hedges_g(data[[variable]] ~ data[[by]], paired = FALSE) |> parameters::standardize_names(style = \"broom\") ) ) #> {cards} data frame: 8 x 9 #> group1 variable stat_name stat_label stat error #> 1 ARM AGE estimate Effect S… object '… #> 2 ARM AGE conf.level CI Confi… object '… #> 3 ARM AGE conf.low CI Lower… object '… #> 4 ARM AGE conf.high CI Upper… object '… #> 5 ARM AGE mu H0 Mean 0 object '… #> 6 ARM AGE paired Paired t… FALSE object '… #> 7 ARM AGE pooled_sd Pooled S… TRUE object '… #> 8 ARM AGE alternative Alternat… two.sided object '… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_mcnemartest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert McNemar's test to ARD — .format_mcnemartest_results","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"Convert McNemar's test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_mcnemartest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"","code":".format_mcnemartest_results(by, variable, lst_tidy, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_mcnemartest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). ... passed stats::mcnemar.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_mcnemartest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_mcnemartest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"","code":"cardx:::.format_mcnemartest_results( by = \"ARM\", variable = \"AGE\", lst_tidy = cards::eval_capture_conditions( stats::mcnemar.test(cards::ADSL[[\"SEX\"]], cards::ADSL[[\"EFFFL\"]]) |> broom::tidy() ) ) #> {cards} data frame: 5 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_mc… statistic X-square… 111.91 #> 2 ARM AGE stats_mc… p.value p-value 0 #> 3 ARM AGE stats_mc… parameter Degrees … 1 #> 4 ARM AGE stats_mc… method method McNemar'… #> 5 ARM AGE stats_mc… correct correct TRUE #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_moodtest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert mood test results to ARD — .format_moodtest_results","title":"Convert mood test results to ARD — .format_moodtest_results","text":"Convert mood test results ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_moodtest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert mood test results to ARD — .format_moodtest_results","text":"","code":".format_moodtest_results(by, variable, lst_tidy, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_moodtest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert mood test results to ARD — .format_moodtest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). ... passed mood.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_moodtest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert mood test results to ARD — .format_moodtest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_moodtest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert mood test results to ARD — .format_moodtest_results","text":"","code":"cardx:::.format_moodtest_results( by = \"SEX\", variable = \"AGE\", lst_tidy = cards::eval_capture_conditions( stats::mood.test(ADSL[[\"AGE\"]] ~ ADSL[[\"SEX\"]]) |> broom::tidy() ) ) #> {cards} data frame: 4 x 9 #> group1 variable stat_name stat_label stat error #> 1 SEX AGE statistic Z-Statis… object '… #> 2 SEX AGE p.value p-value object '… #> 3 SEX AGE method method object '… #> 4 SEX AGE alternative Alternat… object '… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_poissontest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Poisson test to ARD — .format_poissontest_results","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"Convert Poisson test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_poissontest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"","code":".format_poissontest_results(by = NULL, variables, lst_tidy, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_poissontest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"(string) column name variables (character) names event time variables lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). ... passed poisson.test()","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_poissontest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_poissontest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"","code":"cardx:::.format_poissontest_results( by = \"ARM\", variables = c(\"CNSR\", \"AVAL\"), lst_tidy = cards::eval_capture_conditions( stats::poisson.test(sum(cards::ADTTE[[\"CNSR\"]]), sum(cards::ADTTE[[\"AVAL\"]])) |> broom::tidy() ) ) #> {cards} data frame: 10 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AVAL stats_po… estimate Estimate… 0.006 #> 2 ARM AVAL stats_po… statistic Number o… 102 #> 3 ARM AVAL stats_po… p.value p-value 0 #> 4 ARM AVAL stats_po… parameter Expected… 16853 #> 5 ARM AVAL stats_po… conf.low CI Lower… 0.005 #> 6 ARM AVAL stats_po… conf.high CI Upper… 0.007 #> 7 ARM AVAL stats_po… method method Exact Po… #> 8 ARM AVAL stats_po… alternative alternat… two.sided #> 9 ARM AVAL stats_po… conf.level CI Confi… 0.95 #> 10 ARM AVAL stats_po… mu H0 Mean 1 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_proptest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert prop.test to ARD — .format_proptest_results","title":"Convert prop.test to ARD — .format_proptest_results","text":"Convert prop.test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_proptest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert prop.test to ARD — .format_proptest_results","text":"","code":".format_proptest_results(by, variable, lst_tidy, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_proptest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert prop.test to ARD — .format_proptest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). ... passed prop.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_proptest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert prop.test to ARD — .format_proptest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_survfit_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Tidied Survival Fit to ARD — .format_survfit_results","title":"Convert Tidied Survival Fit to ARD — .format_survfit_results","text":"Convert Tidied Survival Fit ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_survfit_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Tidied Survival Fit to ARD — .format_survfit_results","text":"","code":".format_survfit_results(tidy_survfit)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_survfit_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Tidied Survival Fit to ARD — .format_survfit_results","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_survfit_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Tidied Survival Fit to ARD — .format_survfit_results","text":"","code":"cardx:::.format_survfit_results( broom::tidy(survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE)) ) #> {cards} data frame: 805 x 12 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 TRTA Placebo time 1 n.risk Number o… 86 #> 2 TRTA Placebo time 1 estimate Survival… 1 #> 3 TRTA Placebo time 1 std.error Standard… 0 #> 4 TRTA Placebo time 1 conf.high CI Upper… 1 #> 5 TRTA Placebo time 1 conf.low CI Lower… 1 #> 6 TRTA Placebo time 2 n.risk Number o… 85 #> 7 TRTA Placebo time 2 estimate Survival… 1 #> 8 TRTA Placebo time 2 std.error Standard… 0 #> 9 TRTA Placebo time 2 conf.high CI Upper… 1 #> 10 TRTA Placebo time 2 conf.low CI Lower… 1 #> ℹ 795 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 5 more variables: fmt_fn, warning, error, n.event, n.censor"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_ttest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert t-test to ARD — .format_ttest_results","title":"Convert t-test to ARD — .format_ttest_results","text":"Convert t-test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_ttest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert t-test to ARD — .format_ttest_results","text":"","code":".format_ttest_results(by = NULL, variable, lst_tidy, paired, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_ttest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert t-test to ARD — .format_ttest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). paired logical indicating whether want paired t-test. ... passed t.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_ttest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert t-test to ARD — .format_ttest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_ttest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert t-test to ARD — .format_ttest_results","text":"","code":"cardx:::.format_ttest_results( by = \"ARM\", variable = \"AGE\", paired = FALSE, lst_tidy = cards::eval_capture_conditions( stats::t.test(ADSL[[\"AGE\"]] ~ ADSL[[\"ARM\"]], paired = FALSE) |> broom::tidy() ) ) #> {cards} data frame: 14 x 9 #> group1 variable stat_name stat_label stat error #> 1 ARM AGE estimate Mean Dif… cannot u… #> 2 ARM AGE estimate1 Group 1 … cannot u… #> 3 ARM AGE estimate2 Group 2 … cannot u… #> 4 ARM AGE statistic t Statis… cannot u… #> 5 ARM AGE p.value p-value cannot u… #> 6 ARM AGE parameter Degrees … cannot u… #> 7 ARM AGE conf.low CI Lower… cannot u… #> 8 ARM AGE conf.high CI Upper… cannot u… #> 9 ARM AGE method method cannot u… #> 10 ARM AGE alternative alternat… cannot u… #> 11 ARM AGE mu H0 Mean 0 cannot u… #> 12 ARM AGE paired Paired t… FALSE cannot u… #> 13 ARM AGE var.equal Equal Va… FALSE cannot u… #> 14 ARM AGE conf.level CI Confi… 0.95 cannot u… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_wilcoxtest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"Convert Wilcoxon test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_wilcoxtest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"","code":".format_wilcoxtest_results(by = NULL, variable, lst_tidy, paired, ...)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_wilcoxtest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). paired logical indicating whether want paired test. ... passed stats::wilcox.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_wilcoxtest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-format_wilcoxtest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"","code":"# Pre-processing ADSL to have grouping factor (ARM here) with 2 levels ADSL <- cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_stats_wilcox_test(by = \"ARM\", variables = \"AGE\") cardx:::.format_wilcoxtest_results( by = \"ARM\", variable = \"AGE\", paired = FALSE, lst_tidy = cards::eval_capture_conditions( stats::wilcox.test(ADSL[[\"AGE\"]] ~ ADSL[[\"ARM\"]], paired = FALSE) |> broom::tidy() ) ) #> {cards} data frame: 12 x 9 #> group1 variable stat_name stat_label stat error #> 1 ARM AGE statistic X-square… cannot u… #> 2 ARM AGE p.value p-value cannot u… #> 3 ARM AGE method method cannot u… #> 4 ARM AGE alternative alternat… cannot u… #> 5 ARM AGE mu mu 0 cannot u… #> 6 ARM AGE paired Paired t… FALSE cannot u… #> 7 ARM AGE exact exact cannot u… #> 8 ARM AGE correct correct TRUE cannot u… #> 9 ARM AGE conf.int conf.int FALSE cannot u… #> 10 ARM AGE conf.level CI Confi… 0.95 cannot u… #> 11 ARM AGE tol.root tol.root 0 cannot u… #> 12 ARM AGE digits.rank digits.r… Inf cannot u… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-paired_data_pivot_wider.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert long paired data to wide — .paired_data_pivot_wider","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"Convert long paired data wide","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-paired_data_pivot_wider.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"","code":".paired_data_pivot_wider(data, by, variable, id)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-paired_data_pivot_wider.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"data (data.frame) data frame one line per subject per group (string) column name variable (string) variable column name id (string) subject id column name","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-paired_data_pivot_wider.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"wide data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-paired_data_pivot_wider.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"","code":"cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> cardx:::.paired_data_pivot_wider(by = \"ARM\", variable = \"AGE\", id = \"USUBJID\") #> # A tibble: 86 × 3 #> USUBJID by1 by2 #> #> 1 1 63 71 #> 2 2 64 77 #> 3 3 85 81 #> 4 4 52 75 #> 5 5 84 57 #> 6 6 79 56 #> 7 7 81 79 #> 8 8 69 56 #> 9 9 63 61 #> 10 10 81 56 #> # ℹ 76 more rows"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_nested_list_as_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Nested Lists to Column — .process_nested_list_as_df","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"arguments, stat_label, passed nested lists. function properly unnests lists adds results data frame.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_nested_list_as_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"","code":".process_nested_list_as_df(x, arg, new_column, unlist = FALSE)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_nested_list_as_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"x (data.frame) result data frame arg (list) nested list new_column (string) new column name unlist (logical) whether fully unlist final results","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_nested_list_as_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_nested_list_as_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"","code":"ard <- ard_categorical(cards::ADSL, by = \"ARM\", variables = \"AGEGR1\") cardx:::.process_nested_list_as_df(ard, NULL, \"new_col\") #> {cards} data frame: 27 x 12 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 ARM Placebo AGEGR1 65-80 n n 42 #> 2 ARM Placebo AGEGR1 65-80 N N 86 #> 3 ARM Placebo AGEGR1 65-80 p % 0.488 #> 4 ARM Xanomeli… AGEGR1 65-80 n n 55 #> 5 ARM Xanomeli… AGEGR1 65-80 N N 84 #> 6 ARM Xanomeli… AGEGR1 65-80 p % 0.655 #> 7 ARM Xanomeli… AGEGR1 65-80 n n 47 #> 8 ARM Xanomeli… AGEGR1 65-80 N N 84 #> 9 ARM Xanomeli… AGEGR1 65-80 p % 0.56 #> 10 ARM Placebo AGEGR1 <65 n n 14 #> ℹ 17 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 5 more variables: context, fmt_fn, warning, error, new_col"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_probs.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"Process Survival Fit Quantile Estimates","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_probs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"","code":".process_survfit_probs(x, probs)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_probs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"x (survfit data.frame) object class survfit created survival::survfit() data frame. See details. probs (numeric) vector probabilities values (0,1) specifying survival quantiles return.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_probs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"tibble","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_probs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"","code":"survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE) |> cardx:::.process_survfit_probs(probs = c(0.25, 0.75)) #> # A tibble: 6 × 6 #> strata estimate conf.low conf.high prob context #> #> 1 TRTA=Placebo 142 70 181 0.25 survival_survfit #> 2 TRTA=Xanomeline High Dose 44 22 180 0.25 survival_survfit #> 3 TRTA=Xanomeline Low Dose 49 37 180 0.25 survival_survfit #> 4 TRTA=Placebo 184 183 191 0.75 survival_survfit #> 5 TRTA=Xanomeline High Dose 188 167 NA 0.75 survival_survfit #> 6 TRTA=Xanomeline Low Dose 184 180 NA 0.75 survival_survfit"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Survival Fit For Time Estimates — .process_survfit_time","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"Process Survival Fit Time Estimates","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"","code":".process_survfit_time(x, times, type, start.time = NULL)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"x (survfit data.frame) object class survfit created survival::survfit() data frame. See details. times (numeric) vector times return survival probabilities. type (string NULL) type statistic report. Available Kaplan-Meier time estimates , otherwise type ignored. Default NULL. Must one following: start.time (numeric) default starting time. See survival::survfit0() details.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_time.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"tibble","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-process_survfit_time.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"","code":"survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE) |> cardx:::.process_survfit_time(times = c(60, 180), type = \"risk\") #> # A tibble: 6 × 8 #> time n.risk estimate std.error strata conf.high conf.low context #> #> 1 60 59 0.107 0.0360 TRTA=Placebo 0.175 0.0338 risk #> 2 60 14 0.306 0.0712 TRTA=Xanomeline Hi… 0.432 0.151 risk #> 3 60 20 0.268 0.0680 TRTA=Xanomeline Lo… 0.390 0.122 risk #> 4 180 35 0.349 0.0615 TRTA=Placebo 0.459 0.217 risk #> 5 180 3 0.738 0.140 TRTA=Xanomeline Hi… 0.908 0.251 risk #> 6 180 5 0.619 0.130 TRTA=Xanomeline Lo… 0.805 0.257 risk"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-strata_normal_quantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"function wraps estimation stratified percentiles assume approximation large numbers. necessary case proportions strata unequal.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-strata_normal_quantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"","code":".strata_normal_quantile(vars, weights, conf.level)"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-strata_normal_quantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"weights (numeric NULL) weights level strata. NULL, estimated using iterative algorithm minimizes weighted squared length confidence interval. conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-strata_normal_quantile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"Stratified quantile.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/reference/dot-strata_normal_quantile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"","code":"strata_data <- table(data.frame( \"f1\" = sample(c(TRUE, FALSE), 100, TRUE), \"f2\" = sample(c(\"x\", \"y\", \"z\"), 100, TRUE), stringsAsFactors = TRUE )) ns <- colSums(strata_data) ests <- strata_data[\"TRUE\", ] / ns vars <- ests * (1 - ests) / ns weights <- rep(1 / length(ns), length(ns)) cardx:::.strata_normal_quantile(vars, weights, 0.95) #> [1] 1.134584"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-unique_and_sorted.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD-flavor of unique() — .unique_and_sorted","title":"ARD-flavor of unique() — .unique_and_sorted","text":"Essentially wrapper unique(x) |> sort() NA levels removed. factors, levels returned even unobserved. Similarly, logical vectors always return c(TRUE, FALSE), even levels observed.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-unique_and_sorted.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD-flavor of unique() — .unique_and_sorted","text":"","code":".unique_and_sorted(x, useNA = c(\"no\", \"always\"))"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-unique_and_sorted.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD-flavor of unique() — .unique_and_sorted","text":"x () vector","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-unique_and_sorted.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD-flavor of unique() — .unique_and_sorted","text":"vector","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-unique_and_sorted.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD-flavor of unique() — .unique_and_sorted","text":"","code":"cards:::.unique_and_sorted(factor(letters[c(5, 5:1)], levels = letters)) #> [1] a b c d e f g h i j k l m n o p q r s t u v w x y z #> Levels: a b c d e f g h i j k l m n o p q r s t u v w x y z cards:::.unique_and_sorted(c(FALSE, TRUE, TRUE, FALSE)) #> [1] TRUE FALSE cards:::.unique_and_sorted(c(5, 5:1)) #> [1] 1 2 3 4 5"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-update_weights_strat_wilson.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"function wraps iteration procedure allows estimate weights proportional strata. assumes minimize weighted squared length confidence interval.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-update_weights_strat_wilson.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"","code":".update_weights_strat_wilson( vars, strata_qnorm, initial_weights, n_per_strata, max.iterations = 50, conf.level = 0.95, tol = 0.001 )"},{"path":"https://insightsengineering.github.io/cardx/reference/dot-update_weights_strat_wilson.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"vars (numeric) normalized proportions strata. strata_qnorm (numeric) initial estimation identical weights quantiles. initial_weights (numeric) initial weights used calculate strata_qnorm. can optimized future need estimate better initial weights. n_per_strata (numeric) number elements strata. max.iterations (count) maximum number iterations tried. Convergence always checked. conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95 tol (number) tolerance threshold convergence.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/dot-update_weights_strat_wilson.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"list 3 elements: n_it, weights, diff_v.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/reference/dot-update_weights_strat_wilson.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"","code":"vs <- c(0.011, 0.013, 0.012, 0.014, 0.017, 0.018) sq <- 0.674 ws <- rep(1 / length(vs), length(vs)) ns <- c(22, 18, 17, 17, 14, 12) cardx:::.update_weights_strat_wilson(vs, sq, ws, ns, 100, 0.95, 0.001) #> $n_it #> [1] 3 #> #> $weights #> [1] 0.2067191 0.1757727 0.1896962 0.1636346 0.1357615 0.1284160 #> #> $diff_v #> [1] 1.458717e-01 1.497223e-03 1.442189e-06 #>"},{"path":"https://insightsengineering.github.io/cardx/reference/proportion_ci.html","id":null,"dir":"Reference","previous_headings":"","what":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"Functions calculate different proportion confidence intervals use ard_proportion().","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/proportion_ci.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"","code":"proportion_ci_wald(x, conf.level = 0.95, correct = FALSE) proportion_ci_wilson(x, conf.level = 0.95, correct = FALSE) proportion_ci_clopper_pearson(x, conf.level = 0.95) proportion_ci_agresti_coull(x, conf.level = 0.95) proportion_ci_jeffreys(x, conf.level = 0.95) proportion_ci_strat_wilson( x, strata, weights = NULL, conf.level = 0.95, max.iterations = 10L, correct = FALSE ) is_binary(x)"},{"path":"https://insightsengineering.github.io/cardx/reference/proportion_ci.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"x vector binary values, .e. logical vector, numeric values c(0, 1) conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95 correct (flag) include continuity correction. information, see example stats::prop.test(). strata (factor) variable one level per stratum length x. weights (numeric NULL) weights level strata. NULL, estimated using iterative algorithm minimizes weighted squared length confidence interval. max.iterations (count) maximum number iterations iterative procedure used find estimates optimal weights.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/proportion_ci.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"Confidence interval proportion.","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/proportion_ci.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"proportion_ci_wald(): Calculates Wald interval following usual textbook definition single proportion confidence interval using normal approximation. $$\\hat{p} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\hat{p}(1 - \\hat{p})}{n}}$$ proportion_ci_wilson(): Calculates Wilson interval calling stats::prop.test(). Also referred Wilson score interval. $$\\frac{\\hat{p} + \\frac{z^2_{\\alpha/2}}{2n} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\hat{p}(1 - \\hat{p})}{n} + \\frac{z^2_{\\alpha/2}}{4n^2}}}{1 + \\frac{z^2_{\\alpha/2}}{n}}$$ proportion_ci_clopper_pearson(): Calculates Clopper-Pearson interval calling stats::binom.test(). Also referred exact method. $$ \\left( \\frac{k}{n} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\frac{k}{n}(1-\\frac{k}{n})}{n} + \\frac{z^2_{\\alpha/2}}{4n^2}} \\right) / \\left( 1 + \\frac{z^2_{\\alpha/2}}{n} \\right)$$ proportion_ci_agresti_coull(): Calculates Agresti-Coull interval (created Alan Agresti Brent Coull) (95% CI) adding two successes two failures data using Wald formula construct CI. $$ \\left( \\frac{\\tilde{p} + z^2_{\\alpha/2}/2}{n + z^2_{\\alpha/2}} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\tilde{p}(1 - \\tilde{p})}{n} + \\frac{z^2_{\\alpha/2}}{4n^2}} \\right)$$ proportion_ci_jeffreys(): Calculates Jeffreys interval, equal-tailed interval based non-informative Jeffreys prior binomial proportion. $$\\left( \\text{Beta}\\left(\\frac{k}{2} + \\frac{1}{2}, \\frac{n - k}{2} + \\frac{1}{2}\\right)_\\alpha, \\text{Beta}\\left(\\frac{k}{2} + \\frac{1}{2}, \\frac{n - k}{2} + \\frac{1}{2}\\right)_{1-\\alpha} \\right)$$ proportion_ci_strat_wilson(): Calculates stratified Wilson confidence interval unequal proportions described Xin YA, Su XG. Stratified Wilson Newcombe confidence intervals multiple binomial proportions. Statistics Biopharmaceutical Research. 2010;2(3). $$\\frac{\\hat{p}_j + \\frac{z^2_{\\alpha/2}}{2n_j} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\hat{p}_j(1 - \\hat{p}_j)}{n_j} + \\frac{z^2_{\\alpha/2}}{4n_j^2}}}{1 + \\frac{z^2_{\\alpha/2}}{n_j}}$$ is_binary(): Helper determine vector binary (logical 0/1)","code":""},{"path":"https://insightsengineering.github.io/cardx/reference/proportion_ci.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"","code":"x <- c( TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE ) proportion_ci_wald(x, conf.level = 0.9) #> $N #> [1] 10 #> #> $estimate #> [1] 0.5 #> #> $conf.low #> [1] 0.2399258 #> #> $conf.high #> [1] 0.7600742 #> #> $conf.level #> [1] 0.9 #> #> $method #> Wald Confidence Interval without continuity correction #> proportion_ci_wilson(x, correct = TRUE) #> $N #> [1] 10 #> #> $conf.level #> [1] 0.95 #> #> $estimate #> p #> 0.5 #> #> $statistic #> X-squared #> 0 #> #> $p.value #> [1] 1 #> #> $parameter #> df #> 1 #> #> $conf.low #> [1] 0.2365931 #> #> $conf.high #> [1] 0.7634069 #> #> $method #> Wilson Confidence Interval with continuity correction #> #> $alternative #> [1] \"two.sided\" #> proportion_ci_clopper_pearson(x) #> $N #> [1] 10 #> #> $conf.level #> [1] 0.95 #> #> $estimate #> probability of success #> 0.5 #> #> $statistic #> number of successes #> 5 #> #> $p.value #> [1] 1 #> #> $parameter #> number of trials #> 10 #> #> $conf.low #> [1] 0.187086 #> #> $conf.high #> [1] 0.812914 #> #> $method #> [1] \"Clopper-Pearson Confidence Interval\" #> #> $alternative #> [1] \"two.sided\" #> proportion_ci_agresti_coull(x) #> $N #> [1] 10 #> #> $estimate #> [1] 0.5 #> #> $conf.low #> [1] 0.2365931 #> #> $conf.high #> [1] 0.7634069 #> #> $conf.level #> [1] 0.95 #> #> $method #> [1] \"Agresti-Coull Confidence Interval\" #> proportion_ci_jeffreys(x) #> $N #> [1] 10 #> #> $estimate #> [1] 0.5 #> #> $conf.low #> [1] 0.2235287 #> #> $conf.high #> [1] 0.7764713 #> #> $conf.level #> [1] 0.95 #> #> $method #> Jeffreys Interval #> # Stratified Wilson confidence interval with unequal probabilities set.seed(1) rsp <- sample(c(TRUE, FALSE), 100, TRUE) strata_data <- data.frame( \"f1\" = sample(c(\"a\", \"b\"), 100, TRUE), \"f2\" = sample(c(\"x\", \"y\", \"z\"), 100, TRUE), stringsAsFactors = TRUE ) strata <- interaction(strata_data) n_strata <- ncol(table(rsp, strata)) # Number of strata proportion_ci_strat_wilson( x = rsp, strata = strata, conf.level = 0.90 ) #> $N #> [1] 100 #> #> $estimate #> [1] 0.49 #> #> $conf.low #> [1] 0.4072891 #> #> $conf.high #> [1] 0.5647887 #> #> $conf.level #> [1] 0.9 #> #> $weights #> a.x b.x a.y b.y a.z b.z #> 0.2074199 0.1776464 0.1915610 0.1604678 0.1351096 0.1277952 #> #> $method #> Stratified Wilson Confidence Interval without continuity correction #> # Not automatic setting of weights proportion_ci_strat_wilson( x = rsp, strata = strata, weights = rep(1 / n_strata, n_strata), conf.level = 0.90 ) #> $N #> [1] 100 #> #> $estimate #> [1] 0.49 #> #> $conf.low #> [1] 0.4190436 #> #> $conf.high #> [1] 0.5789733 #> #> $conf.level #> [1] 0.9 #> #> $method #> Stratified Wilson Confidence Interval without continuity correction #>"},{"path":"https://insightsengineering.github.io/cardx/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. cards ard_attributes, ard_categorical, ard_continuous, ard_dichotomous, ard_missing, ard_total_n dplyr %>%, all_of, any_of, contains, ends_with, everything, last_col, matches, num_range, one_of, starts_with, ","code":""},{"path":"https://insightsengineering.github.io/cardx/news/index.html","id":"cardx-0219012","dir":"Changelog","previous_headings":"","what":"cardx 0.2.1.9012","title":"cardx 0.2.1.9012","text":"Added data.frame method ard_survival_survfit(). Added warning incorrect formula type ard_survival_survfit(). (#223) Implemented summary(extend=TRUE) ard_survival_survfit() return results time points bounds. (#224) Methods {survey} {survival} packages retain inputs variables types outputs. now able retain variable types ARDs returned ard_continuous.survey.design(), ard_categorical.survey.design(), ard_continuous_ci.survey.design(), ard_categorical_ci.survey.design(), ard_survival_survfit.data.frame() (notably, ard_survival_survfit.survfit()).","code":""},{"path":"https://insightsengineering.github.io/cardx/news/index.html","id":"cardx-021","dir":"Changelog","previous_headings":"","what":"cardx 0.2.1","title":"cardx 0.2.1","text":"CRAN release: 2024-09-03","code":""},{"path":"https://insightsengineering.github.io/cardx/news/index.html","id":"new-features-and-updates-0-2-1","dir":"Changelog","previous_headings":"","what":"New Features and Updates","title":"cardx 0.2.1","text":"Added S3 method ard_total_n.survey.design() returns ARD survey-weighted unweighted total sample size. Added warning error columns ard_regression() output. (#148) Implemented cards::as_card() needed package convert data frames class ‘card’. (#200)","code":""},{"path":"https://insightsengineering.github.io/cardx/news/index.html","id":"bug-fixes-0-2-1","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"cardx 0.2.1","text":"Bug fix ard_categorical.survey.design() unweighted statistics returned, even case explicitly requested.","code":""},{"path":"https://insightsengineering.github.io/cardx/news/index.html","id":"lifecycle-changes-0-2-1","dir":"Changelog","previous_headings":"","what":"Lifecycle Changes","title":"cardx 0.2.1","text":"bt(pattern), reformulate2(pattern_term), reformulate2(pattern_response) arguments deprecated now ignored. now use make.names() determine whether column name needs wrapped backticks. (#192)","code":""},{"path":"https://insightsengineering.github.io/cardx/news/index.html","id":"cardx-020","dir":"Changelog","previous_headings":"","what":"cardx 0.2.0","title":"cardx 0.2.0","text":"CRAN release: 2024-07-20","code":""},{"path":"https://insightsengineering.github.io/cardx/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"cardx 0.2.0","text":"Updated function names follow pattern ard__(). change immediate: previous functions names deprecated. (#106)","code":"ard_ttest() -> ard_stats_t_test() ard_paired_ttest() -> ard_stats_paired_t_test() ard_wilcoxtest() -> ard_stats_wilcox_test() ard_paired_wilcoxtest() -> ard_stats_paired_wilcox_test() ard_chisqtest() -> ard_stats_chisq_test() ard_fishertest() -> ard_stats_fisher_test() ard_kruskaltest() -> ard_stats_kruskal_test() ard_mcnemartest() -> ard_stats_mcnemar_test() ard_moodtest() -> ard_stats_mood_test()"},{"path":"https://insightsengineering.github.io/cardx/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"cardx 0.2.0","text":"ard_categorical_ci(value) argument added. Previously, binary variables (0/1 TRUE/FALSE) summarized. value supplied, level variable summarized independently. default, binary variables 1/TRUE level summarized. Added following functions calculating Analysis Results Datasets (ARDs). ard_stats_aov() calculating ANOVA results using stats::aov(). (#3) ard_stats_anova() calculating ANOVA results using stats::anova(). (#12) ard_stats_mcnemar_test_long() McNemar’s test long data using stats::mcnemar.test(). ard_stats_prop_test() tests proportions using stats::prop.test(). (#64) ard_stats_t_test_onesample() calculating one-sample results. ard_stats_wilcox_test_onesample() calculating one-sample results. ard_stats_oneway_test() calculating ANOVA results using stats::oneway.test(). (#3) ard_aod_wald_test() calculating Wald Tests regression models using aod::wald.test(). (#84) ard_car_anova() calculating ANOVA results using car::Anova(). (#3) ard_car_vif() calculating variance inflation factor using car::vif(). (#10) ard_effectsize_cohens_d(), ard_effectsize_paired_cohens_d(), ard_effectsize_hedges_g(), ard_effectsize_paired_hedges_g() standardized differences using effectsize::cohens_d() effectsize::hedges_g(). (#50) ard_emmeans_mean_difference() calculating least-squares mean differences using {emmeans} package. (#34) ard_smd_smd() calculating standardized mean differences using smd::smd(). (#4) ard_survival_survfit() survival analyses using survival::survfit(). (#43) ard_continuous.survey.design() calculating univariate summary statistics weighted/survey data using many functions {survey} package. (#68) ard_categorical.survey.design() tabulating summary statistics weighted/survey data using many functions {survey} package. (#140) ard_dichotomous.survey.design() tabulating dichotomous summary statistics weighted/survey data using many functions {survey} package. (#2) ard_missing.survey.design() tabulating missing summary statistics weighted/survey data using many functions {survey} package. (#2) ard_attributes.survey.design() summarizing labels attributes weighted/survey data using many functions {survey} package. ard_survey_svychisq() weighted/survey chi-squared test using survey::svychisq(). (#72) ard_survey_svyttest() weighted/survey t-tests using survey::svyttest(). (#70) ard_survey_svyranktest() weighted/survey rank tests using survey::svyranktest(). (#71) ard_survival_survdiff() creating results survival::survdiff(). (#113) ard_regression_basic() basic regression models. function focuses matching model terms underlying variables names. (#46) Updated functions ard_stats_t_test(), ard_stats_paired_t_test(), ard_stats_wilcox_test(), ard_stats_paired_wilcox_test(), ard_stats_chisq_test(), ard_stats_fisher_test(), ard_stats_kruskal_test(), ard_stats_mcnemar_test(), ard_stats_mood_test() accept multiple variables . Independent tests calculated variable. variable argument renamed variables. (#77) Updated ard_stats_t_test() ard_stats_wilcox_test() longer require argument, yields central estimates confidence intervals. (#82) Added model construction helpers, construct_model(), reformulate2(), bt(), bt_strip(). Imported cli call environment functions https://github.com/ddsjoberg/standalone/blob/main/R/standalone-cli_call_env.R implemented set_cli_abort_call user-facing functions. (#111)","code":""},{"path":"https://insightsengineering.github.io/cardx/news/index.html","id":"cardx-010","dir":"Changelog","previous_headings":"","what":"cardx 0.1.0","title":"cardx 0.1.0","text":"CRAN release: 2024-03-18 Initial release.","code":""}] +[{"path":[]},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement [INSERT CONTACT METHOD]. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contribution Guidelines","title":"Contribution Guidelines","text":"🙏 Thank taking time contribute! input deeply valued, whether issue, pull request, even feedback, regardless size, content scope.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"table-of-contents","dir":"","previous_headings":"","what":"Table of contents","title":"Contribution Guidelines","text":"👶 Getting started 📔 Code Conduct 🗃 License 📜 Issues 🚩 Pull requests 💻 Coding guidelines 🏆 Recognition model ❓ Questions","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting started","title":"Contribution Guidelines","text":"Please refer project documentation brief introduction. Please also see articles within project documentation additional information.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contribution Guidelines","text":"Code Conduct governs project. Participants contributors expected follow rules outlined therein.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Contribution Guidelines","text":"contributions covered project’s license.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"issues","dir":"","previous_headings":"","what":"Issues","title":"Contribution Guidelines","text":"use GitHub track issues, feature requests, bugs. submitting new issue, please check issue already reported. issue already exists, please upvote existing issue 👍. new feature requests, please elaborate context benefit feature users, developers, relevant personas.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"github-flow","dir":"","previous_headings":"Pull requests","what":"GitHub Flow","title":"Contribution Guidelines","text":"repository uses GitHub Flow model collaboration. submit pull request: Create branch Please see branch naming convention . don’t write access repository, please fork . Make changes Make sure code passes checks imposed GitHub Actions well documented well tested unit tests sufficiently covering changes introduced Create pull request (PR) pull request description, please link relevant issue (), provide detailed description change, include assumptions. Address review comments, Post approval Merge PR write access. Otherwise, reviewer merge PR behalf. Pat back Congratulations! 🎉 now official contributor project! grateful contribution.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"branch-naming-convention","dir":"","previous_headings":"Pull requests","what":"Branch naming convention","title":"Contribution Guidelines","text":"Suppose changes related current issue current project; please name branch follows: _. Please use underscore (_) delimiter word separation. example, 420_fix_ui_bug suitable branch name change resolving UI-related bug reported issue number 420 current project. change affects multiple repositories, please name branches follows: __. example, 69_awesomeproject_fix_spelling_error reference issue 69 reported project awesomeproject aims resolve one spelling errors multiple (likely related) repositories.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"monorepo-and-stageddependencies","dir":"","previous_headings":"Pull requests","what":"monorepo and staged.dependencies","title":"Contribution Guidelines","text":"Sometimes might need change upstream dependent package(s) able submit meaningful change. using staged.dependencies functionality simulate monorepo behavior. dependency configuration already specified project’s staged_dependencies.yaml file. need name feature branches appropriately. exception branch naming convention described . Please refer staged.dependencies package documentation details.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"coding-guidelines","dir":"","previous_headings":"","what":"Coding guidelines","title":"Contribution Guidelines","text":"repository follows unified processes standards adopted maintainers ensure software development carried consistently within teams cohesively across repositories.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"style-guide","dir":"","previous_headings":"Coding guidelines","what":"Style guide","title":"Contribution Guidelines","text":"repository follows standard tidyverse style guide uses lintr lint checks. Customized lint configurations available repository’s .lintr file.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"dependency-management","dir":"","previous_headings":"Coding guidelines","what":"Dependency management","title":"Contribution Guidelines","text":"Lightweight right weight. repository follows tinyverse recommedations limiting dependencies minimum.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"dependency-version-management","dir":"","previous_headings":"Coding guidelines","what":"Dependency version management","title":"Contribution Guidelines","text":"code compatible (!) historical versions given dependenct package, required specify minimal version DESCRIPTION file. particular: development version requires (imports) development version another package - required put abc (>= 1.2.3.9000).","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"r--package-versions","dir":"","previous_headings":"Coding guidelines > Recommended development environment & tools","what":"R & package versions","title":"Contribution Guidelines","text":"continuously test packages newest R version along recent dependencies CRAN BioConductor. recommend working environment also set way. can find details R version packages used R CMD check GitHub Action execution log - step prints R sessionInfo(). discover bugs older R versions older set dependencies, please create relevant bug reports.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"pre-commit","dir":"","previous_headings":"Coding guidelines > Recommended development environment & tools","what":"pre-commit","title":"Contribution Guidelines","text":"highly recommend use pre-commit tool combined R hooks pre-commit execute checks committing pushing changes. Pre-commit hooks already available repository’s .pre-commit-config.yaml file.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"recognition-model","dir":"","previous_headings":"","what":"Recognition model","title":"Contribution Guidelines","text":"mentioned previously, contributions deeply valued appreciated. contribution data available part repository insights, recognize significant contribution hence add contributor package authors list, following rules enforced: Minimum 5% lines code authored* (determined git blame query) top 5 contributors terms number commits lines added lines removed* *Excluding auto-generated code, including limited roxygen comments renv.lock files. package maintainer also reserves right adjust criteria recognize contributions.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/CONTRIBUTING.html","id":"questions","dir":"","previous_headings":"","what":"Questions","title":"Contribution Guidelines","text":"questions regarding contribution guidelines, please contact package/repository maintainer.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/main/SECURITY.html","id":"reporting-security-issues","dir":"","previous_headings":"","what":"Reporting Security Issues","title":"Security Policy","text":"believe found security vulnerability repositories organization, please report us coordinated disclosure. Please report security vulnerabilities public GitHub issues, discussions, pull requests. Instead, please send email vulnerability.management[@]roche.com. Please include much information listed can help us better understand resolve issue: type issue (e.g., buffer overflow, SQL injection, cross-site scripting) Full paths source file(s) related manifestation issue location affected source code (tag/branch/commit direct URL) special configuration required reproduce issue Step--step instructions reproduce issue Proof--concept exploit code (possible) Impact issue, including attacker might exploit issue information help us triage report quickly.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/SECURITY.html","id":"data-security-standards-dss","dir":"","previous_headings":"","what":"Data Security Standards (DSS)","title":"Security Policy","text":"Please make sure reporting issues form bug, feature, pull request, sensitive information PII, PHI, PCI completely removed text attachments, including pictures videos.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Daniel Sjoberg. Author, maintainer. Abinaya Yogasekaram. Author. Emily de la Rua. Author. F. Hoffmann-La Roche AG. Copyright holder, funder.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Sjoberg D, Yogasekaram , de la Rua E (2024). cardx: Extra Analysis Results Data Utilities. R package version 0.2.1.9012, https://github.com/insightsengineering/cardx/, https://insightsengineering.github.io/cardx/main/.","code":"@Manual{, title = {cardx: Extra Analysis Results Data Utilities}, author = {Daniel Sjoberg and Abinaya Yogasekaram and Emily {de la Rua}}, year = {2024}, note = {R package version 0.2.1.9012, https://github.com/insightsengineering/cardx/}, url = {https://insightsengineering.github.io/cardx/main/}, }"},{"path":"https://insightsengineering.github.io/cardx/main/index.html","id":"cardx-","dir":"","previous_headings":"","what":"Extra Analysis Results Data Utilities","title":"Extra Analysis Results Data Utilities","text":"{cardx} package extension {cards} package, providing additional functions create Analysis Results Data Objects (ARDs) using R programming language. {cardx} package exports ARD functions uses utility functions {cards} statistical functions additional packages (, {stats}, {mmrm}, {emmeans}, {car}, {survey}, etc.) construct summary objects. Summary objects can used : Generate Tables visualizations Regulatory Submission easily R. Perfect presenting descriptive statistics, statistical analyses, regressions, etc. . Conduct Quality Control checks existing Tables R. Storing results test parameters supports re-use verification data analyses.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Extra Analysis Results Data Utilities","text":"Install cards CRAN : can install development version cards GitHub :","code":"install.packages(\"cardx\") # install.packages(\"devtools\") devtools::install_github(\"insightsengineering/cardx\")"},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/main/index.html","id":"example-ard-creation","dir":"","previous_headings":"Examples","what":"Example ARD Creation","title":"Extra Analysis Results Data Utilities","text":"Example t-test: Note returned ARD contains analysis results addition function parameters used calculate results allowing reproducible future analyses customization.","code":"library(cardx) cards::ADSL |> # keep two treatment arms for the t-test calculation dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> cardx::ard_stats_t_test(by = ARM, variable = AGE) ## {cards} data frame: 14 x 9 ## group1 variable context stat_name stat_label stat ## 1 ARM AGE stats_t_… estimate Mean Dif… 0.828 ## 2 ARM AGE stats_t_… estimate1 Group 1 … 75.209 ## 3 ARM AGE stats_t_… estimate2 Group 2 … 74.381 ## 4 ARM AGE stats_t_… statistic t Statis… 0.655 ## 5 ARM AGE stats_t_… p.value p-value 0.513 ## 6 ARM AGE stats_t_… parameter Degrees … 167.362 ## 7 ARM AGE stats_t_… conf.low CI Lower… -1.668 ## 8 ARM AGE stats_t_… conf.high CI Upper… 3.324 ## 9 ARM AGE stats_t_… method method Welch Tw… ## 10 ARM AGE stats_t_… alternative alternat… two.sided ## 11 ARM AGE stats_t_… mu H0 Mean 0 ## 12 ARM AGE stats_t_… paired Paired t… FALSE ## 13 ARM AGE stats_t_… var.equal Equal Va… FALSE ## 14 ARM AGE stats_t_… conf.level CI Confi… 0.95 ## ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/index.html","id":"model-input","dir":"","previous_headings":"Examples","what":"Model Input","title":"Extra Analysis Results Data Utilities","text":"{cardx} functions accept regression model objects input: Note Analysis Results Standard begin data set rather model object. accomplish include model construction helpers.","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_aod_wald_test() construct_model( data = cards::ADSL, formula = reformulate2(\"ARM\", response = \"AGE\"), method = \"lm\" ) |> ard_aod_wald_test() ## {cards} data frame: 6 x 8 ## variable context stat_name stat_label stat fmt_fn ## 1 (Intercept) aod_wald… df Degrees … 1 1 ## 2 (Intercept) aod_wald… statistic Statistic 7126.713 1 ## 3 (Intercept) aod_wald… p.value p-value 0 1 ## 4 ARM aod_wald… df Degrees … 2 1 ## 5 ARM aod_wald… statistic Statistic 1.046 1 ## 6 ARM aod_wald… p.value p-value 0.593 1 ## ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/index.html","id":"additional-resources","dir":"","previous_headings":"","what":"Additional Resources","title":"Extra Analysis Results Data Utilities","text":"best resources help documents accompanying {cardx} function. Supporting documentation companion packages {cards} {gtsummary} useful understanding ARD workflow capabilities.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_aod_wald_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Wald Test — ard_aod_wald_test","title":"ARD Wald Test — ard_aod_wald_test","text":"Function takes regression model object calculates Wald statistical test using aod::wald.test().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_aod_wald_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Wald Test — ard_aod_wald_test","text":"","code":"ard_aod_wald_test( x, tidy_fun = broom.helpers::tidy_with_broom_or_parameters, ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_aod_wald_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Wald Test — ard_aod_wald_test","text":"x regression model object tidy_fun (function) tidier. Default broom.helpers::tidy_with_broom_or_parameters ... arguments passed aod::wald.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_aod_wald_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Wald Test — ard_aod_wald_test","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_aod_wald_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Wald Test — ard_aod_wald_test","text":"","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_aod_wald_test() #> {cards} data frame: 6 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 (Intercept) aod_wald… df Degrees … 1 1 #> 2 (Intercept) aod_wald… statistic Statistic 7126.713 1 #> 3 (Intercept) aod_wald… p.value p-value 0 1 #> 4 ARM aod_wald… df Degrees … 2 1 #> 5 ARM aod_wald… statistic Statistic 1.046 1 #> 6 ARM aod_wald… p.value p-value 0.593 1 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_attributes.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Attributes — ard_attributes.survey.design","title":"ARD Attributes — ard_attributes.survey.design","text":"Add variable attributes ARD data frame. label attribute added columns, label specified label set column using label= argument, column name placed label statistic. class attribute also returned columns. attribute returned attributes() also added, e.g. factor levels.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_attributes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Attributes — ard_attributes.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_attributes(data, variables = everything(), label = NULL, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_attributes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Attributes — ard_attributes.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) variables include label (named list) named list variable labels, e.g. list(cyl = \". Cylinders\"). Default NULL ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_attributes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Attributes — ard_attributes.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_attributes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Attributes — ard_attributes.survey.design","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_attributes( data = dclus1, variables = c(sname, dname), label = list(sname = \"School Name\", dname = \"District Name\") ) #> {cards} data frame: 4 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 sname attribut… label Variable… School N… #> 2 sname attribut… class Variable… character NULL #> 3 dname attribut… label Variable… District… #> 4 dname attribut… class Variable… character NULL #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_anova.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD ANOVA from car Package — ard_car_anova","title":"ARD ANOVA from car Package — ard_car_anova","text":"Function takes regression model object calculated ANOVA using car::Anova().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_anova.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD ANOVA from car Package — ard_car_anova","text":"","code":"ard_car_anova(x, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_anova.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD ANOVA from car Package — ard_car_anova","text":"x regression model object ... arguments passed car::Anova(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_anova.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD ANOVA from car Package — ard_car_anova","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_anova.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD ANOVA from car Package — ard_car_anova","text":"","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_car_anova() #> {cards} data frame: 5 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 ARM car_anova sumsq sumsq 71.386 1 #> 2 ARM car_anova df Degrees … 2 1 #> 3 ARM car_anova meansq meansq 35.693 1 #> 4 ARM car_anova statistic Statistic 0.523 1 #> 5 ARM car_anova p.value p-value 0.593 1 #> ℹ 2 more variables: warning, error glm(vs ~ factor(cyl) + factor(am), data = mtcars, family = binomial) |> ard_car_anova(test.statistic = \"Wald\") #> {cards} data frame: 6 x 8 #> variable context stat_name stat_label stat warning #> 1 factor(cyl) car_anova statistic Statistic 0 glm.fit:… #> 2 factor(cyl) car_anova df Degrees … 2 glm.fit:… #> 3 factor(cyl) car_anova p.value p-value 1 glm.fit:… #> 4 factor(am) car_anova statistic Statistic 0 glm.fit:… #> 5 factor(am) car_anova df Degrees … 1 glm.fit:… #> 6 factor(am) car_anova p.value p-value 0.998 glm.fit:… #> ℹ 2 more variables: fmt_fn, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_vif.html","id":null,"dir":"Reference","previous_headings":"","what":"Regression VIF ARD — ard_car_vif","title":"Regression VIF ARD — ard_car_vif","text":"Function takes regression model object returns variance inflation factor (VIF) using car::vif() converts ARD structure","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_vif.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression VIF ARD — ard_car_vif","text":"","code":"ard_car_vif(x, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_vif.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression VIF ARD — ard_car_vif","text":"x regression model object See car::vif() details ... arguments passed car::vif(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_vif.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Regression VIF ARD — ard_car_vif","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_car_vif.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Regression VIF ARD — ard_car_vif","text":"","code":"lm(AGE ~ ARM + SEX, data = cards::ADSL) |> ard_car_vif() #> {cards} data frame: 6 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 ARM car_vif GVIF GVIF 1.016 1 #> 2 ARM car_vif df df 2 1 #> 3 ARM car_vif aGVIF Adjusted… 1.004 1 #> 4 SEX car_vif GVIF GVIF 1.016 1 #> 5 SEX car_vif df df 1 1 #> 6 SEX car_vif aGVIF Adjusted… 1.008 1 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Categorical Survey Statistics — ard_categorical.survey.design","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"Compute tabulations survey-weighted data. counts proportion (\"N\", \"n\", \"p\") calculated using survey::svytable(), standard errors design effect (\"p.std.error\", \"deff\") calculated using survey::svymean(). unweighted statistics calculated cards::ard_categorical.data.frame().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_categorical( data, variables, by = NULL, statistic = everything() ~ c(\"n\", \"N\", \"p\", \"p.std.error\", \"deff\", \"n_unweighted\", \"N_unweighted\", \"p_unweighted\"), denominator = c(\"column\", \"row\", \"cell\"), fmt_fn = NULL, stat_label = everything() ~ list(p = \"%\", p.std.error = \"SE(%)\", deff = \"Design Effect\", n_unweighted = \"Unweighted n\", N_unweighted = \"Unweighted N\", p_unweighted = \"Unweighted %\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations column specified variables. single column may specified. statistic (formula-list-selector) named list, list formulas, single formula list element character vector statistic names include. See default value options. denominator (string) string indicating type proportions calculate. Must one \"column\" (default), \"row\", \"cell\". fmt_fn (formula-list-selector) named list, list formulas, single formula list element named list functions (RHS formula), e.g. list(mpg = list(mean = \\(x) round(x, digits = 2) |> .character())). stat_label (formula-list-selector) named list, list formulas, single formula list element either named list list formulas defining statistic labels, e.g. everything() ~ list(mean = \"Mean\", sd = \"SD\") everything() ~ list(mean ~ \"Mean\", sd ~ \"SD\"). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Categorical Survey Statistics — ard_categorical.survey.design","text":"","code":"svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) ard_categorical(svy_titanic, variables = c(Class, Age), by = Survived) #> {cards} data frame: 96 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 Survived No Class 1st n n 122 #> 2 Survived No Class 1st N N 1490 #> 3 Survived No Class 1st p % 0.082 #> 4 Survived No Class 1st p.std.error SE(%) 0.086 #> 5 Survived No Class 1st deff Design E… 0.896 #> 6 Survived No Class 2nd n n 167 #> 7 Survived No Class 2nd N N 1490 #> 8 Survived No Class 2nd p % 0.112 #> 9 Survived No Class 2nd p.std.error SE(%) 0.111 #> 10 Survived No Class 2nd deff Design E… 1.128 #> ℹ 86 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Proportion Confidence Intervals — ard_categorical_ci","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"Calculate confidence intervals proportions.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"","code":"ard_categorical_ci(data, ...) # S3 method for class 'data.frame' ard_categorical_ci( data, variables, by = dplyr::group_vars(data), method = c(\"waldcc\", \"wald\", \"clopper-pearson\", \"wilson\", \"wilsoncc\", \"strat_wilson\", \"strat_wilsoncc\", \"agresti-coull\", \"jeffreys\"), conf.level = 0.95, value = list(where(is_binary) ~ 1L, where(is.logical) ~ TRUE), strata = NULL, weights = NULL, max.iterations = 10, ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"data (data.frame) data frame ... Arguments passed methods. variables (tidy-select) columns include summaries. Columns must class values coded c(0, 1). (tidy-select) columns stratify calculations method (string) string indicating type confidence interval calculate. Must one . See ?proportion_ci details. conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95 value (formula-list-selector) function calculate CIs levels variables specified. Use argument instead request single level summarized. Default list((is_binary) ~ 1L, (.logical) ~ TRUE), columns coded 0/1 TRUE/FALSE summarize 1 TRUE levels. strata, weights, max.iterations arguments passed proportion_ci_strat_wilson(), method='strat_wilson'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Proportion Confidence Intervals — ard_categorical_ci","text":"","code":"# compute CI for binary variables ard_categorical_ci(mtcars, variables = c(vs, am), method = \"wilson\") #> {cards} data frame: 20 x 9 #> variable variable_level context stat_name stat_label stat #> 1 vs 1 proporti… N N 32 #> 2 vs 1 proporti… conf.level conf.lev… 0.95 #> 3 vs 1 proporti… estimate estimate 0.438 #> 4 vs 1 proporti… statistic statistic 0.5 #> 5 vs 1 proporti… p.value p.value 0.48 #> 6 vs 1 proporti… parameter parameter 1 #> 7 vs 1 proporti… conf.low conf.low 0.282 #> 8 vs 1 proporti… conf.high conf.high 0.607 #> 9 vs 1 proporti… method method Wilson C… #> 10 vs 1 proporti… alternative alternat… two.sided #> 11 am 1 proporti… N N 32 #> 12 am 1 proporti… conf.level conf.lev… 0.95 #> 13 am 1 proporti… estimate estimate 0.406 #> 14 am 1 proporti… statistic statistic 1.125 #> 15 am 1 proporti… p.value p.value 0.289 #> 16 am 1 proporti… parameter parameter 1 #> 17 am 1 proporti… conf.low conf.low 0.255 #> 18 am 1 proporti… conf.high conf.high 0.577 #> 19 am 1 proporti… method method Wilson C… #> 20 am 1 proporti… alternative alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error # compute CIs for each level of a categorical variable ard_categorical_ci(mtcars, variables = cyl, method = \"jeffreys\") #> {cards} data frame: 18 x 9 #> variable variable_level context stat_name stat_label stat #> 1 cyl 4 proporti… N N 32 #> 2 cyl 4 proporti… estimate estimate 0.344 #> 3 cyl 4 proporti… conf.low conf.low 0.198 #> 4 cyl 4 proporti… conf.high conf.high 0.516 #> 5 cyl 4 proporti… conf.level conf.lev… 0.95 #> 6 cyl 4 proporti… method method Jeffreys… #> 7 cyl 6 proporti… N N 32 #> 8 cyl 6 proporti… estimate estimate 0.219 #> 9 cyl 6 proporti… conf.low conf.low 0.104 #> 10 cyl 6 proporti… conf.high conf.high 0.382 #> 11 cyl 6 proporti… conf.level conf.lev… 0.95 #> 12 cyl 6 proporti… method method Jeffreys… #> 13 cyl 8 proporti… N N 32 #> 14 cyl 8 proporti… estimate estimate 0.438 #> 15 cyl 8 proporti… conf.low conf.low 0.277 #> 16 cyl 8 proporti… conf.high conf.high 0.609 #> 17 cyl 8 proporti… conf.level conf.lev… 0.95 #> 18 cyl 8 proporti… method method Jeffreys… #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD survey categorical CIs — ard_categorical_ci.survey.design","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"Confidence intervals categorical variables calculated via survey::svyciprop().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_categorical_ci( data, variables, by = NULL, method = c(\"logit\", \"likelihood\", \"asin\", \"beta\", \"mean\", \"xlogit\"), conf.level = 0.95, value = list(where(is_binary) ~ 1L, where(is.logical) ~ TRUE), df = survey::degf(data), ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations columns specified, including unobserved combinations unobserved factor levels. method (string) Method passed survey::svyciprop(method) conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95 value (formula-list-selector) function calculate CIs levels variables specified. Use argument instead request single level summarized. Default list((is_binary) ~ 1L, (.logical) ~ TRUE), columns coded 0/1 TRUE/FALSE summarize 1 TRUE levels. df (numeric) denominator degrees freedom, passed survey::svyciprop(df). Default survey::degf(data). ... arguments passed survey::svyciprop()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_categorical_ci.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD survey categorical CIs — ard_categorical_ci.survey.design","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_categorical_ci(dclus1, variables = sch.wide) #> {cards} data frame: 10 x 9 #> variable variable_level context stat_name stat_label stat #> 1 sch.wide No categori… estimate estimate 0.126 #> 2 sch.wide No categori… conf.low conf.low 0.088 #> 3 sch.wide No categori… conf.high conf.high 0.176 #> 4 sch.wide No categori… method method logit #> 5 sch.wide No categori… conf.level conf.lev… 0.95 #> 6 sch.wide Yes categori… estimate estimate 0.874 #> 7 sch.wide Yes categori… conf.low conf.low 0.824 #> 8 sch.wide Yes categori… conf.high conf.high 0.912 #> 9 sch.wide Yes categori… method method logit #> 10 sch.wide Yes categori… conf.level conf.lev… 0.95 #> ℹ 3 more variables: fmt_fn, warning, error ard_categorical_ci(dclus1, variables = sch.wide, value = sch.wide ~ \"Yes\", method = \"xlogit\") #> {cards} data frame: 5 x 9 #> variable variable_level context stat_name stat_label stat #> 1 sch.wide Yes categori… estimate estimate 0.874 #> 2 sch.wide Yes categori… conf.low conf.low 0.824 #> 3 sch.wide Yes categori… conf.high conf.high 0.912 #> 4 sch.wide Yes categori… method method xlogit #> 5 sch.wide Yes categori… conf.level conf.lev… 0.95 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Continuous Survey Statistics — ard_continuous.survey.design","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"Returns ARD weighted statistics using {survey} package.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_continuous( data, variables, by = NULL, statistic = everything() ~ c(\"median\", \"p25\", \"p75\"), fmt_fn = NULL, stat_label = NULL, ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations columns specified, including unobserved combinations unobserved factor levels. statistic (formula-list-selector) named list, list formulas, single formula list element character vector statistic names include. See options. fmt_fn (formula-list-selector) named list, list formulas, single formula list element named list functions (RHS formula), e.g. list(mpg = list(mean = \\(x) round(x, digits = 2) |> .character)). stat_label (formula-list-selector) named list, list formulas, single formula list element either named list list formulas defining statistic labels, e.g. everything() ~ list(mean = \"Mean\", sd = \"SD\") everything() ~ list(mean ~ \"Mean\", sd ~ \"SD\"). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous.survey.design.html","id":"statistic-argument","dir":"Reference","previous_headings":"","what":"statistic argument","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"following statistics available: 'mean', 'median', 'min', 'max', 'sum', 'var', 'sd', 'mean.std.error', 'deff', 'p##', 'p##' percentiles ## integer 0 100.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Continuous Survey Statistics — ard_continuous.survey.design","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_continuous( data = dclus1, variables = api00, by = stype ) #> {cards} data frame: 9 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 stype E api00 median Median 652 #> 2 stype H api00 median Median 608 #> 3 stype M api00 median Median 642 #> 4 stype E api00 p25 25% Perc… 553 #> 5 stype H api00 p25 25% Perc… 529 #> 6 stype M api00 p25 25% Perc… 547 #> 7 stype E api00 p75 75% Perc… 729 #> 8 stype H api00 p75 75% Perc… 703 #> 9 stype M api00 p75 75% Perc… 699 #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD continuous CIs — ard_continuous_ci","title":"ARD continuous CIs — ard_continuous_ci","text":"One-sample confidence intervals continuous variable means medians.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD continuous CIs — ard_continuous_ci","text":"","code":"ard_continuous_ci(data, ...) # S3 method for class 'data.frame' ard_continuous_ci( data, variables, by = dplyr::group_vars(data), conf.level = 0.95, method = c(\"t.test\", \"wilcox.test\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD continuous CIs — ard_continuous_ci","text":"data (data.frame) data frame. See details. ... arguments passed t.test() wilcox.test() variables (tidy-select) column names compared. Independent t-tests computed variable. (tidy-select) optional column name compare . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. method (string) string indicating method use confidence interval calculation. Must one \"t.test\" \"wilcox.test\"","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD continuous CIs — ard_continuous_ci","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD continuous CIs — ard_continuous_ci","text":"","code":"ard_continuous_ci(mtcars, variables = c(mpg, hp), method = \"wilcox.test\") #> {cards} data frame: 24 x 8 #> variable context stat_name stat_label stat warning #> 1 mpg continuo… estimate Mean 19.6 cannot c… #> 2 mpg continuo… statistic t Statis… 528 cannot c… #> 3 mpg continuo… p.value p-value 0 cannot c… #> 4 mpg continuo… conf.low CI Lower… 17.5 cannot c… #> 5 mpg continuo… conf.high CI Upper… 22.1 cannot c… #> 6 mpg continuo… method method Wilcoxon… cannot c… #> 7 mpg continuo… alternative alternat… two.sided cannot c… #> 8 mpg continuo… mu H0 Mean 0 #> 9 mpg continuo… conf.int conf.int TRUE #> 10 mpg continuo… tol.root tol.root 0 #> ℹ 14 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 2 more variables: fmt_fn, error ard_continuous_ci(mtcars, variables = mpg, by = am, method = \"t.test\") #> {cards} data frame: 20 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 am 0 mpg estimate Mean 17.147 #> 2 am 0 mpg statistic t Statis… 19.495 #> 3 am 0 mpg p.value p-value 0 #> 4 am 0 mpg parameter Degrees … 18 #> 5 am 0 mpg conf.low CI Lower… 15.299 #> 6 am 0 mpg conf.high CI Upper… 18.995 #> 7 am 0 mpg method method One Samp… #> 8 am 0 mpg alternative alternat… two.sided #> 9 am 0 mpg mu H0 Mean 0 #> 10 am 0 mpg conf.level CI Confi… 0.95 #> 11 am 1 mpg estimate Mean 24.392 #> 12 am 1 mpg statistic t Statis… 14.262 #> 13 am 1 mpg p.value p-value 0 #> 14 am 1 mpg parameter Degrees … 12 #> 15 am 1 mpg conf.low CI Lower… 20.666 #> 16 am 1 mpg conf.high CI Upper… 28.119 #> 17 am 1 mpg method method One Samp… #> 18 am 1 mpg alternative alternat… two.sided #> 19 am 1 mpg mu H0 Mean 0 #> 20 am 1 mpg conf.level CI Confi… 0.95 #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD survey continuous CIs — ard_continuous_ci.survey.design","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"One-sample confidence intervals continuous variables' means medians. Confidence limits calculated survey::svymean() survey::svyquantile().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_continuous_ci( data, variables, by = NULL, method = c(\"svymean\", \"svymedian.mean\", \"svymedian.beta\", \"svymedian.xlogit\", \"svymedian.asin\", \"svymedian.score\"), conf.level = 0.95, df = survey::degf(data), ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations columns specified, including unobserved combinations unobserved factor levels. method (string) Method confidence interval calculation. \"svymean\", calculation computed via survey::svymean(). Otherwise, calculated viasurvey::svyquantile(interval.type=method) conf.level (scalar numeric) confidence level confidence interval. Default 0.95. df (numeric) denominator degrees freedom, passed survey::confint(df). Default survey::degf(data). ... arguments passed survey::confint()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_continuous_ci.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD survey continuous CIs — ard_continuous_ci.survey.design","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_continuous_ci(dclus1, variables = api00) #> {cards} data frame: 5 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 api00 survey_c… estimate estimate 644.169 2 #> 2 api00 survey_c… std.error std.error 23.542 2 #> 3 api00 survey_c… conf.low conf.low 593.676 2 #> 4 api00 survey_c… conf.high conf.high 694.662 2 #> 5 api00 survey_c… conf.level conf.lev… 0.95 2 #> ℹ 2 more variables: warning, error ard_continuous_ci(dclus1, variables = api00, method = \"svymedian.xlogit\") #> {cards} data frame: 5 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 api00 survey_c… estimate estimate 652 2 #> 2 api00 survey_c… std.error std.error 34.969 2 #> 3 api00 survey_c… conf.low conf.low 564 2 #> 4 api00 survey_c… conf.high conf.high 714 2 #> 5 api00 survey_c… conf.level conf.lev… 0.95 2 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_dichotomous.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"Compute Analysis Results Data (ARD) dichotomous summary statistics.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_dichotomous.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_dichotomous( data, variables, by = NULL, value = cards::maximum_variable_value(data$variables[variables]), statistic = everything() ~ c(\"n\", \"N\", \"p\", \"p.std.error\", \"deff\", \"n_unweighted\", \"N_unweighted\", \"p_unweighted\"), denominator = c(\"column\", \"row\", \"cell\"), fmt_fn = NULL, stat_label = everything() ~ list(p = \"%\", p.std.error = \"SE(%)\", deff = \"Design Effect\", n_unweighted = \"Unweighted n\", N_unweighted = \"Unweighted N\", p_unweighted = \"Unweighted %\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_dichotomous.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations column specified variables. single column may specified. value (named list) named list dichotomous values tabulate. Default cards::maximum_variable_value(data$variables), returns largest/last value sort. statistic (formula-list-selector) named list, list formulas, single formula list element character vector statistic names include. See default value options. denominator (string) string indicating type proportions calculate. Must one \"column\" (default), \"row\", \"cell\". fmt_fn (formula-list-selector) named list, list formulas, single formula list element named list functions (RHS formula), e.g. list(mpg = list(mean = \\(x) round(x, digits = 2) |> .character())). stat_label (formula-list-selector) named list, list formulas, single formula list element either named list list formulas defining statistic labels, e.g. everything() ~ list(mean = \"Mean\", sd = \"SD\") everything() ~ list(mean ~ \"Mean\", sd ~ \"SD\"). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_dichotomous.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_dichotomous.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Dichotomous Survey Statistics — ard_dichotomous.survey.design","text":"","code":"survey::svydesign(ids = ~1, data = mtcars, weights = ~1) |> ard_dichotomous(by = vs, variables = c(cyl, am), value = list(cyl = 4)) #> {cards} data frame: 32 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 vs 0 cyl 4 n n 1 #> 2 vs 0 cyl 4 N N 18 #> 3 vs 0 cyl 4 p % 0.056 #> 4 vs 0 cyl 4 p.std.error SE(%) 0.055 #> 5 vs 0 cyl 4 deff Design E… Inf #> 6 vs 0 cyl 4 n_unweighted Unweight… 1 #> 7 vs 0 cyl 4 N_unweighted Unweight… 18 #> 8 vs 0 cyl 4 p_unweighted Unweight… 0.056 #> 9 vs 1 cyl 4 n n 10 #> 10 vs 1 cyl 4 N N 14 #> ℹ 22 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_cohens_d.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Cohen's D Test — ard_effectsize_cohens_d","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"Analysis results data paired non-paired Cohen's D Effect Size Test using effectsize::cohens_d().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_cohens_d.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"","code":"ard_effectsize_cohens_d(data, by, variables, conf.level = 0.95, ...) ard_effectsize_paired_cohens_d(data, by, variables, id, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_cohens_d.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"data (data.frame) data frame. See details. (tidy-select) column name compare . Must categorical variable exactly two levels. variables (tidy-select) column names compared. Must continuous variables. Independent tests run variable. conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed effectsize::cohens_d(...) id (tidy-select) column name subject participant ID","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_cohens_d.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_cohens_d.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"ard_effectsize_cohens_d() function, data expected one row per subject. data passed effectsize::cohens_d(data[[variable]]~data[[]], data, paired = FALSE, ...). ard_effectsize_paired_cohens_d() function, data expected one row per subject per level. effect size calculated, data reshaped wide format one row per subject. data passed effectsize::cohens_d(x = data_wide[[]], y = data_wide[[]], paired = TRUE, ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_cohens_d.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Cohen's D Test — ard_effectsize_cohens_d","text":"","code":"cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_effectsize_cohens_d(by = ARM, variables = AGE) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE effectsi… estimate Effect S… 0.1 #> 2 ARM AGE effectsi… conf.level CI Confi… 0.95 #> 3 ARM AGE effectsi… conf.low CI Lower… -0.201 #> 4 ARM AGE effectsi… conf.high CI Upper… 0.401 #> 5 ARM AGE effectsi… method method Cohen's D #> 6 ARM AGE effectsi… mu H0 Mean 0 #> 7 ARM AGE effectsi… paired Paired t… FALSE #> 8 ARM AGE effectsi… pooled_sd Pooled S… TRUE #> 9 ARM AGE effectsi… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error # constructing a paired data set, # where patients receive both treatments cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> dplyr::group_by(USUBJID) |> dplyr::filter(dplyr::n() > 1) |> ard_effectsize_paired_cohens_d(by = ARM, variables = AGE, id = USUBJID) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE effectsi… estimate Effect S… 0.069 #> 2 ARM AGE effectsi… conf.level CI Confi… 0.95 #> 3 ARM AGE effectsi… conf.low CI Lower… -0.146 #> 4 ARM AGE effectsi… conf.high CI Upper… 0.282 #> 5 ARM AGE effectsi… method method Paired C… #> 6 ARM AGE effectsi… mu H0 Mean 0 #> 7 ARM AGE effectsi… paired Paired t… TRUE #> 8 ARM AGE effectsi… pooled_sd Pooled S… TRUE #> 9 ARM AGE effectsi… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_hedges_g.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Hedge's G Test — ard_effectsize_hedges_g","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"Analysis results data paired non-paired Hedge's G Effect Size Test using effectsize::hedges_g().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_hedges_g.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"","code":"ard_effectsize_hedges_g(data, by, variables, conf.level = 0.95, ...) ard_effectsize_paired_hedges_g(data, by, variables, id, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_hedges_g.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"data (data.frame) data frame. See details. (tidy-select) column name compare . Must categorical variable exactly two levels. variables (tidy-select) column names compared. Must continuous variable. Independent tests run variable conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed effectsize::hedges_g(...) id (tidy-select) column name subject participant ID","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_hedges_g.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_hedges_g.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"ard_effectsize_hedges_g() function, data expected one row per subject. data passed effectsize::hedges_g(data[[variable]]~data[[]], data, paired = FALSE, ...). ard_effectsize_paired_hedges_g() function, data expected one row per subject per level. effect size calculated, data reshaped wide format one row per subject. data passed effectsize::hedges_g(x = data_wide[[]], y = data_wide[[]], paired = TRUE, ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_effectsize_hedges_g.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Hedge's G Test — ard_effectsize_hedges_g","text":"","code":"cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_effectsize_hedges_g(by = ARM, variables = AGE) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE effectsi… estimate Effect S… 0.1 #> 2 ARM AGE effectsi… conf.level CI Confi… 0.95 #> 3 ARM AGE effectsi… conf.low CI Lower… -0.2 #> 4 ARM AGE effectsi… conf.high CI Upper… 0.399 #> 5 ARM AGE effectsi… method method Hedge's G #> 6 ARM AGE effectsi… mu H0 Mean 0 #> 7 ARM AGE effectsi… paired Paired t… FALSE #> 8 ARM AGE effectsi… pooled_sd Pooled S… TRUE #> 9 ARM AGE effectsi… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error # constructing a paired data set, # where patients receive both treatments cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> dplyr::group_by(USUBJID) |> dplyr::filter(dplyr::n() > 1) |> ard_effectsize_paired_hedges_g(by = ARM, variables = AGE, id = USUBJID) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE effectsi… estimate Effect S… 0.068 #> 2 ARM AGE effectsi… conf.level CI Confi… 0.95 #> 3 ARM AGE effectsi… conf.low CI Lower… -0.144 #> 4 ARM AGE effectsi… conf.high CI Upper… 0.28 #> 5 ARM AGE effectsi… method method Paired H… #> 6 ARM AGE effectsi… mu H0 Mean 0 #> 7 ARM AGE effectsi… paired Paired t… TRUE #> 8 ARM AGE effectsi… pooled_sd Pooled S… TRUE #> 9 ARM AGE effectsi… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_emmeans_mean_difference.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD for LS Mean Difference — ard_emmeans_mean_difference","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"function calculates least-squares mean differences using 'emmeans' package using following arguments data, formula, method, method.args, package used construct regression model via cardx::construct_model().","code":"emmeans::emmeans(object = , specs = ~ ) |> emmeans::contrast(method = \"pairwise\") |> summary(infer = TRUE, level = )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_emmeans_mean_difference.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"","code":"ard_emmeans_mean_difference( data, formula, method, method.args = list(), package = \"base\", response_type = c(\"continuous\", \"dichotomous\"), conf.level = 0.95, primary_covariate = getElement(attr(stats::terms(formula), \"term.labels\"), 1L) )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_emmeans_mean_difference.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"data (data.frame/survey.design) data frame survey design object formula (formula) formula method (string) string function naming function called, e.g. \"glm\". function belongs library attached, package name must specified package argument. method.args (named list) named list arguments passed method. Note list may contain non-standard evaluation components. wrapping function functions, argument must passed way evaluate list, e.g. using rlang's embrace operator {{ . }}. package (string) string package name temporarily loaded function specified method executed. response_type (string) string indicating whether model outcome 'continuous' 'dichotomous'. 'dichotomous', call emmeans::emmeans() supplemented argument regrid=\"response\". conf.level (scalar numeric) confidence level confidence interval. Default 0.95. primary_covariate (string) string indicating primary covariate (typically dichotomous treatment variable). Default first covariate listed formula.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_emmeans_mean_difference.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_emmeans_mean_difference.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD for LS Mean Difference — ard_emmeans_mean_difference","text":"","code":"ard_emmeans_mean_difference( data = mtcars, formula = mpg ~ am + cyl, method = \"lm\" ) #> {cards} data frame: 8 x 10 #> group1 variable variable_level stat_name stat_label stat #> 1 am contrast am0 - am1 estimate Mean Dif… -2.567 #> 2 am contrast am0 - am1 std.error std.error 1.291 #> 3 am contrast am0 - am1 df df 29 #> 4 am contrast am0 - am1 conf.low CI Lower… -5.208 #> 5 am contrast am0 - am1 conf.high CI Upper… 0.074 #> 6 am contrast am0 - am1 p.value p-value 0.056 #> 7 am contrast am0 - am1 conf.level CI Confi… 0.95 #> 8 am contrast am0 - am1 method method Least-sq… #> ℹ 4 more variables: context, fmt_fn, warning, error ard_emmeans_mean_difference( data = mtcars, formula = vs ~ am + mpg, method = \"glm\", method.args = list(family = binomial), response_type = \"dichotomous\" ) #> {cards} data frame: 8 x 10 #> group1 variable variable_level stat_name stat_label stat #> 1 am contrast am0 - am1 estimate Mean Dif… 0.61 #> 2 am contrast am0 - am1 std.error std.error 0.229 #> 3 am contrast am0 - am1 df df Inf #> 4 am contrast am0 - am1 conf.low CI Lower… 0.162 #> 5 am contrast am0 - am1 conf.high CI Upper… 1.059 #> 6 am contrast am0 - am1 p.value p-value 0.008 #> 7 am contrast am0 - am1 conf.level CI Confi… 0.95 #> 8 am contrast am0 - am1 method method Least-sq… #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_missing.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Missing Survey Statistics — ard_missing.survey.design","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"Compute Analysis Results Data (ARD) statistics related data missingness survey objects","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_missing.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_missing( data, variables, by = NULL, statistic = everything() ~ c(\"N_obs\", \"N_miss\", \"N_nonmiss\", \"p_miss\", \"p_nonmiss\", \"N_obs_unweighted\", \"N_miss_unweighted\", \"N_nonmiss_unweighted\", \"p_miss_unweighted\", \"p_nonmiss_unweighted\"), fmt_fn = NULL, stat_label = everything() ~ list(N_obs = \"Total N\", N_miss = \"N Missing\", N_nonmiss = \"N not Missing\", p_miss = \"% Missing\", p_nonmiss = \"% not Missing\", N_obs_unweighted = \"Total N (unweighted)\", N_miss_unweighted = \"N Missing (unweighted)\", N_nonmiss_unweighted = \"N not Missing (unweighted)\", p_miss_unweighted = \"% Missing (unweighted)\", p_nonmiss_unweighted = \"% not Missing (unweighted)\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_missing.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"data (survey.design) design object often created survey::svydesign(). variables (tidy-select) columns include summaries. (tidy-select) results calculated combinations column specified variables. single column may specified. statistic (formula-list-selector) named list, list formulas, single formula list element character vector statistic names include. See default value options. fmt_fn (formula-list-selector) named list, list formulas, single formula list element named list functions (RHS formula), e.g. list(mpg = list(mean = \\(x) round(x, digits = 2) |> .character())). stat_label (formula-list-selector) named list, list formulas, single formula list element either named list list formulas defining statistic labels, e.g. everything() ~ list(mean = \"Mean\", sd = \"SD\") everything() ~ list(mean ~ \"Mean\", sd ~ \"SD\"). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_missing.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_missing.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Missing Survey Statistics — ard_missing.survey.design","text":"","code":"svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) ard_missing(svy_titanic, variables = c(Class, Age), by = Survived) #> {cards} data frame: 40 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 Survived No Class N_nonmiss N not Mi… 1490 #> 2 Survived No Class N_obs Total N 1490 #> 3 Survived No Class p_nonmiss % not Mi… 1 #> 4 Survived No Class N_miss N Missing 0 #> 5 Survived No Class p_miss % Missing 0 #> 6 Survived No Class N_miss_unweighted N Missin… 0 #> 7 Survived No Class N_obs_unweighted Total N … 16 #> 8 Survived No Class p_miss_unweighted % Missin… 0 #> 9 Survived No Class N_nonmiss_unweighted N not Mi… 16 #> 10 Survived No Class p_nonmiss_unweighted % not Mi… 1 #> ℹ 30 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression.html","id":null,"dir":"Reference","previous_headings":"","what":"Regression ARD — ard_regression","title":"Regression ARD — ard_regression","text":"Function takes regression model object converts ARD structure using broom.helpers package.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Regression ARD — ard_regression","text":"","code":"ard_regression(x, ...) # Default S3 method ard_regression(x, tidy_fun = broom.helpers::tidy_with_broom_or_parameters, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Regression ARD — ard_regression","text":"x regression model object ... Arguments passed broom.helpers::tidy_plus_plus() tidy_fun (function) tidier. Default broom.helpers::tidy_with_broom_or_parameters","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Regression ARD — ard_regression","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Regression ARD — ard_regression","text":"","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_regression(add_estimate_to_reference_rows = TRUE) #> {cards} data frame: 43 x 9 #> variable variable_level context stat_name stat_label stat #> 1 ARM Placebo regressi… term term ARMPlace… #> 2 ARM Placebo regressi… var_label Label Descript… #> 3 ARM Placebo regressi… var_class Class character #> 4 ARM Placebo regressi… var_type Type categori… #> 5 ARM Placebo regressi… var_nlevels N Levels 3 #> 6 ARM Placebo regressi… contrasts contrasts contr.tr… #> 7 ARM Placebo regressi… contrasts_type Contrast… treatment #> 8 ARM Placebo regressi… reference_row referenc… TRUE #> 9 ARM Placebo regressi… label Level La… Placebo #> 10 ARM Placebo regressi… n_obs N Obs. 86 #> ℹ 33 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression_basic.html","id":null,"dir":"Reference","previous_headings":"","what":"Basic Regression ARD — ard_regression_basic","title":"Basic Regression ARD — ard_regression_basic","text":"function takes regression model provides basic statistics ARD structure. default output simpler ard_regression(). function primarily matches regression terms underlying variable names levels. default arguments used ","code":"broom.helpers::tidy_plus_plus( add_reference_rows = FALSE, add_estimate_to_reference_rows = FALSE, add_n = FALSE, intercept = FALSE )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression_basic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Basic Regression ARD — ard_regression_basic","text":"","code":"ard_regression_basic( x, tidy_fun = broom.helpers::tidy_with_broom_or_parameters, stats_to_remove = c(\"term\", \"var_type\", \"var_label\", \"var_class\", \"label\", \"contrasts_type\", \"contrasts\", \"var_nlevels\"), ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression_basic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Basic Regression ARD — ard_regression_basic","text":"x regression model object tidy_fun (function) tidier. Default broom.helpers::tidy_with_broom_or_parameters stats_to_remove (character) character vector statistic names remove. Default c(\"term\", \"var_type\", \"var_label\", \"var_class\", \"label\", \"contrasts_type\", \"contrasts\", \"var_nlevels\"). ... Arguments passed broom.helpers::tidy_plus_plus()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression_basic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Basic Regression ARD — ard_regression_basic","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_regression_basic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Basic Regression ARD — ard_regression_basic","text":"","code":"lm(AGE ~ ARM, data = cards::ADSL) |> ard_regression_basic() #> {cards} data frame: 12 x 9 #> variable variable_level context stat_name stat_label stat #> 1 ARM Xanomeli… regressi… estimate Coeffici… -0.828 #> 2 ARM Xanomeli… regressi… std.error Standard… 1.267 #> 3 ARM Xanomeli… regressi… statistic statistic -0.654 #> 4 ARM Xanomeli… regressi… p.value p-value 0.514 #> 5 ARM Xanomeli… regressi… conf.low CI Lower… -3.324 #> 6 ARM Xanomeli… regressi… conf.high CI Upper… 1.668 #> 7 ARM Xanomeli… regressi… estimate Coeffici… 0.457 #> 8 ARM Xanomeli… regressi… std.error Standard… 1.267 #> 9 ARM Xanomeli… regressi… statistic statistic 0.361 #> 10 ARM Xanomeli… regressi… p.value p-value 0.719 #> 11 ARM Xanomeli… regressi… conf.low CI Lower… -2.039 #> 12 ARM Xanomeli… regressi… conf.high CI Upper… 2.953 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_smd_smd.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Standardized Mean Difference — ard_smd_smd","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"Standardized mean difference calculated via smd::smd() na.rm = TRUE. Additionally, function add confidence interval SMD std.error=TRUE, original smd::smd() include.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_smd_smd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"","code":"ard_smd_smd(data, by, variables, std.error = TRUE, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_smd_smd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"data (data.frame/survey.design) data frame object class 'survey.design' (typically created survey::svydesign()). (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable. std.error (scalar logical) Logical indicator computing standard errors using smd::compute_smd_var(). Default TRUE. conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed smd::smd()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_smd_smd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_smd_smd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Standardized Mean Difference — ard_smd_smd","text":"","code":"ard_smd_smd(cards::ADSL, by = SEX, variables = AGE) #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 SEX AGE smd_smd estimate Standard… 0.157 #> 2 SEX AGE smd_smd std.error Standard… 0.127 #> 3 SEX AGE smd_smd conf.low conf.low -0.091 #> 4 SEX AGE smd_smd conf.high conf.high 0.405 #> 5 SEX AGE smd_smd method method Standard… #> 6 SEX AGE smd_smd gref Integer … 1 #> ℹ 3 more variables: fmt_fn, warning, error ard_smd_smd(cards::ADSL, by = SEX, variables = AGEGR1) #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 SEX AGEGR1 smd_smd estimate Standard… 0.103 #> 2 SEX AGEGR1 smd_smd std.error Standard… 0.127 #> 3 SEX AGEGR1 smd_smd conf.low conf.low -0.145 #> 4 SEX AGEGR1 smd_smd conf.high conf.high 0.351 #> 5 SEX AGEGR1 smd_smd method method Standard… #> 6 SEX AGEGR1 smd_smd gref Integer … 1 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_anova.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD ANOVA — ard_stats_anova","title":"ARD ANOVA — ard_stats_anova","text":"Prepare ANOVA results stats::anova() function. Users may pass pre-calculated stats::anova() object list formulas. latter case, models constructed using information passed models passed stats::anova().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_anova.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD ANOVA — ard_stats_anova","text":"","code":"ard_stats_anova(x, ...) # S3 method for class 'anova' ard_stats_anova(x, method_text = \"ANOVA results from `stats::anova()`\", ...) # S3 method for class 'data.frame' ard_stats_anova( x, formulas, method, method.args = list(), package = \"base\", method_text = \"ANOVA results from `stats::anova()`\", ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_anova.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD ANOVA — ard_stats_anova","text":"x (anova data.frame) object class 'anova' created stats::anova() data frame ... dots future extensions must empty. method_text (string) string method used. Default \"ANOVA results stats::anova()\". provide option change stats::anova() can produce results many types models may warrant precise description. formulas (list) list formulas method (string) string function naming function called, e.g. \"glm\". function belongs library attached, package name must specified package argument. method.args (named list) named list arguments passed method. Note list may contain non-standard evaluation components. wrapping function functions, argument must passed way evaluate list, e.g. using rlang's embrace operator {{ . }}. package (string) string package name temporarily loaded function specified method executed.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_anova.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD ANOVA — ard_stats_anova","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_anova.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD ANOVA — ard_stats_anova","text":"list formulas supplied ard_stats_anova(), formulas along information arguments, used construct models pass models stats::anova(). models constructed using rlang::exec(), similar .call(). function executed withr::with_namespace(package), allows use ard_stats_anova(method) packages, e.g. package = 'lme4' must specified method = 'glmer'. See example .","code":"rlang::exec(.fn = method, formula = formula, data = data, !!!method.args)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_anova.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD ANOVA — ard_stats_anova","text":"","code":"anova( lm(mpg ~ am, mtcars), lm(mpg ~ am + hp, mtcars) ) |> ard_stats_anova() #> {cards} data frame: 11 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 model_1 stats_an… term term mpg ~ am NULL #> 2 model_1 stats_an… df.residual df for r… 30 1 #> 3 model_1 stats_an… rss Residual… 720.897 1 #> 4 model_2 stats_an… term term mpg ~ am… NULL #> 5 model_2 stats_an… df.residual df for r… 29 1 #> 6 model_2 stats_an… rss Residual… 245.439 1 #> 7 model_2 stats_an… df Degrees … 1 1 #> 8 model_2 stats_an… sumsq Sum of S… 475.457 1 #> 9 model_2 stats_an… statistic statistic 56.178 1 #> 10 model_2 stats_an… p.value p-value 0 1 #> 11 model_2 stats_an… method method ANOVA re… NULL #> ℹ 2 more variables: warning, error ard_stats_anova( x = mtcars, formulas = list(am ~ mpg, am ~ mpg + hp), method = \"glm\", method.args = list(family = binomial) ) #> {cards} data frame: 10 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 model_1 stats_an… term term am ~ mpg NULL #> 2 model_1 stats_an… df.residual df for r… 30 1 #> 3 model_1 stats_an… residual.deviance residual… 29.675 1 #> 4 model_2 stats_an… term term am ~ mpg… NULL #> 5 model_2 stats_an… df.residual df for r… 29 1 #> 6 model_2 stats_an… residual.deviance residual… 19.233 1 #> 7 model_2 stats_an… df Degrees … 1 1 #> 8 model_2 stats_an… deviance deviance 10.443 1 #> 9 model_2 stats_an… p.value p-value 0.001 1 #> 10 model_2 stats_an… method method ANOVA re… NULL #> ℹ 2 more variables: warning, error ard_stats_anova( x = mtcars, formulas = list(am ~ 1 + (1 | vs), am ~ mpg + (1 | vs)), method = \"glmer\", method.args = list(family = binomial), package = \"lme4\" ) #> {cards} data frame: 16 x 8 #> variable context stat_name stat_label stat warning #> 1 model_1 stats_an… term term MODEL1 failed t… #> 2 model_1 stats_an… npar npar 2 failed t… #> 3 model_1 stats_an… AIC AIC 47.23 failed t… #> 4 model_1 stats_an… BIC BIC 50.161 failed t… #> 5 model_1 stats_an… logLik logLik -21.615 failed t… #> 6 model_1 stats_an… deviance deviance 43.23 failed t… #> 7 model_2 stats_an… term term MODEL2 failed t… #> 8 model_2 stats_an… npar npar 3 failed t… #> 9 model_2 stats_an… AIC AIC 35.25 failed t… #> 10 model_2 stats_an… BIC BIC 39.647 failed t… #> 11 model_2 stats_an… logLik logLik -14.625 failed t… #> 12 model_2 stats_an… deviance deviance 29.25 failed t… #> 13 model_2 stats_an… statistic statistic 13.979 failed t… #> 14 model_2 stats_an… df Degrees … 1 failed t… #> 15 model_2 stats_an… p.value p-value 0 failed t… #> 16 model_2 stats_an… method method ANOVA re… failed t… #> ℹ 2 more variables: fmt_fn, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_aov.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD ANOVA — ard_stats_aov","title":"ARD ANOVA — ard_stats_aov","text":"Analysis results data Analysis Variance. Calculated stats::aov()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_aov.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD ANOVA — ard_stats_aov","text":"","code":"ard_stats_aov(formula, data, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_aov.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD ANOVA — ard_stats_aov","text":"formula formula specifying model. data data frame variables specified formula found. missing, variables searched standard way. ... arguments passed stats::aov(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_aov.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD ANOVA — ard_stats_aov","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_aov.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD ANOVA — ard_stats_aov","text":"","code":"ard_stats_aov(AGE ~ ARM, data = cards::ADSL) #> {cards} data frame: 5 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 ARM stats_aov sumsq Sum of S… 71.386 1 #> 2 ARM stats_aov df Degrees … 2 1 #> 3 ARM stats_aov meansq Mean of … 35.693 1 #> 4 ARM stats_aov statistic Statistic 0.523 1 #> 5 ARM stats_aov p.value p-value 0.593 1 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_chisq_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Chi-squared Test — ard_stats_chisq_test","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"Analysis results data Pearson's Chi-squared Test. Calculated chisq.test(x = data[[variable]], y = data[[]], ...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_chisq_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"","code":"ard_stats_chisq_test(data, by, variables, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_chisq_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"data (data.frame) data frame. (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable. ... additional arguments passed chisq.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_chisq_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_chisq_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Chi-squared Test — ard_stats_chisq_test","text":"","code":"cards::ADSL |> ard_stats_chisq_test(by = \"ARM\", variables = \"AGEGR1\") #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label #> 1 ARM AGEGR1 stats_ch… statistic X-square… #> 2 ARM AGEGR1 stats_ch… p.value p-value #> 3 ARM AGEGR1 stats_ch… parameter Degrees … #> 4 ARM AGEGR1 stats_ch… method method #> 5 ARM AGEGR1 stats_ch… correct correct #> 6 ARM AGEGR1 stats_ch… p p #> 7 ARM AGEGR1 stats_ch… rescale.p rescale.p #> 8 ARM AGEGR1 stats_ch… simulate.p.value simulate… #> 9 ARM AGEGR1 stats_ch… B B #> stat #> 1 6.852 #> 2 0.144 #> 3 4 #> 4 Pearson'… #> 5 TRUE #> 6 rep, 1/length(x), length(x) #> 7 FALSE #> 8 FALSE #> 9 2000 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_fisher_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Fisher's Exact Test — ard_stats_fisher_test","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"Analysis results data Fisher's Exact Test. Calculated fisher.test(x = data[[variable]], y = data[[]], ...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_fisher_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"","code":"ard_stats_fisher_test(data, by, variables, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_fisher_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"data (data.frame) data frame. (tidy-select) column name compare variables (tidy-select) column names compared. Independent tests computed variable. conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... additional arguments passed fisher.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_fisher_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_fisher_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Fisher's Exact Test — ard_stats_fisher_test","text":"","code":"cards::ADSL[1:30, ] |> ard_stats_fisher_test(by = \"ARM\", variables = \"AGEGR1\") #> {cards} data frame: 12 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGEGR1 stats_fi… p.value p-value 0.089 #> 2 ARM AGEGR1 stats_fi… method method Fisher's… #> 3 ARM AGEGR1 stats_fi… alternative alternat… two.sided #> 4 ARM AGEGR1 stats_fi… workspace workspace 2e+05 #> 5 ARM AGEGR1 stats_fi… hybrid hybrid FALSE #> 6 ARM AGEGR1 stats_fi… hybridPars hybridPa… c, 5, 80, 1 #> 7 ARM AGEGR1 stats_fi… control control list #> 8 ARM AGEGR1 stats_fi… or or 1 #> 9 ARM AGEGR1 stats_fi… conf.int conf.int TRUE #> 10 ARM AGEGR1 stats_fi… conf.level conf.lev… 0.95 #> 11 ARM AGEGR1 stats_fi… simulate.p.value simulate… FALSE #> 12 ARM AGEGR1 stats_fi… B B 2000 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_kruskal_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"Analysis results data Kruskal-Wallis Rank Sum Test. Calculated kruskal.test(data[[variable]], data[[]], ...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_kruskal_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"","code":"ard_stats_kruskal_test(data, by, variables)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_kruskal_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"data (data.frame) data frame. (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_kruskal_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_kruskal_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Kruskal-Wallis Test — ard_stats_kruskal_test","text":"","code":"cards::ADSL |> ard_stats_kruskal_test(by = \"ARM\", variables = \"AGE\") #> {cards} data frame: 4 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_kr… statistic Kruskal-… 1.635 #> 2 ARM AGE stats_kr… p.value p-value 0.442 #> 3 ARM AGE stats_kr… parameter Degrees … 2 #> 4 ARM AGE stats_kr… method method Kruskal-… #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mcnemar_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD McNemar's Test — ard_stats_mcnemar_test","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"Analysis results data McNemar's statistical test. two functions depending structure data. ard_stats_mcnemar_test() structure expected stats::mcnemar.test() ard_stats_mcnemar_test_long() one row per ID per group","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mcnemar_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"","code":"ard_stats_mcnemar_test(data, by, variables, ...) ard_stats_mcnemar_test_long(data, by, variables, id, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mcnemar_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"data (data.frame) data frame. See details. (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable. ... arguments passed stats::mcnemar.test(...) id (tidy-select) column name subject participant ID","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mcnemar_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mcnemar_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"ard_stats_mcnemar_test() function, data expected one row per subject. data passed stats::mcnemar.test(x = data[[variable]], y = data[[]], ...). Please use table(x = data[[variable]], y = data[[]]) check contingency table.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mcnemar_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD McNemar's Test — ard_stats_mcnemar_test","text":"","code":"cards::ADSL |> ard_stats_mcnemar_test(by = \"SEX\", variables = \"EFFFL\") #> {cards} data frame: 5 x 9 #> group1 variable context stat_name stat_label stat #> 1 SEX EFFFL stats_mc… statistic X-square… 111.91 #> 2 SEX EFFFL stats_mc… p.value p-value 0 #> 3 SEX EFFFL stats_mc… parameter Degrees … 1 #> 4 SEX EFFFL stats_mc… method method McNemar'… #> 5 SEX EFFFL stats_mc… correct correct TRUE #> ℹ 3 more variables: fmt_fn, warning, error set.seed(1234) cards::ADSL[c(\"USUBJID\", \"TRT01P\")] |> dplyr::mutate(TYPE = \"PLANNED\") |> dplyr::rename(TRT01 = TRT01P) %>% dplyr::bind_rows(dplyr::mutate(., TYPE = \"ACTUAL\", TRT01 = sample(TRT01))) |> ard_stats_mcnemar_test_long( by = TYPE, variable = TRT01, id = USUBJID ) #> {cards} data frame: 5 x 9 #> group1 variable context stat_name stat_label stat #> 1 TYPE TRT01 stats_mc… statistic X-square… 1.353 #> 2 TYPE TRT01 stats_mc… p.value p-value 0.717 #> 3 TYPE TRT01 stats_mc… parameter Degrees … 3 #> 4 TYPE TRT01 stats_mc… method method McNemar'… #> 5 TYPE TRT01 stats_mc… correct correct TRUE #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mood_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Mood Test — ard_stats_mood_test","title":"ARD Mood Test — ard_stats_mood_test","text":"Analysis results data Mood two sample test scale. Note confused Brown-Mood test medians.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mood_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Mood Test — ard_stats_mood_test","text":"","code":"ard_stats_mood_test(data, by, variables, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mood_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Mood Test — ard_stats_mood_test","text":"data (data.frame) data frame. See details. (tidy-select) column name compare . variables (tidy-select) column name compared. Independent tests run variable. ... arguments passed mood.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mood_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Mood Test — ard_stats_mood_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mood_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Mood Test — ard_stats_mood_test","text":"ard_stats_mood_test() function, data expected one row per subject. data passed mood.test(data[[variable]] ~ data[[]], ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_mood_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Mood Test — ard_stats_mood_test","text":"","code":"cards::ADSL |> ard_stats_mood_test(by = \"SEX\", variables = \"AGE\") #> {cards} data frame: 4 x 9 #> group1 variable context stat_name stat_label stat #> 1 SEX AGE stats_mo… statistic Z-Statis… 0.129 #> 2 SEX AGE stats_mo… p.value p-value 0.897 #> 3 SEX AGE stats_mo… method method Mood two… #> 4 SEX AGE stats_mo… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_oneway_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD One-way Test — ard_stats_oneway_test","title":"ARD One-way Test — ard_stats_oneway_test","text":"Analysis results data Testing Equal Means One-Way Layout. calculated oneway.test()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_oneway_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD One-way Test — ard_stats_oneway_test","text":"","code":"ard_stats_oneway_test(formula, data, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_oneway_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD One-way Test — ard_stats_oneway_test","text":"formula formula form lhs ~ rhs lhs gives sample values rhs corresponding groups. data optional matrix data frame (similar: see model.frame) containing variables formula formula. default variables taken environment(formula). ... additional arguments passed oneway.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_oneway_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD One-way Test — ard_stats_oneway_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_oneway_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD One-way Test — ard_stats_oneway_test","text":"","code":"ard_stats_oneway_test(AGE ~ ARM, data = cards::ADSL) #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_on… num.df Degrees … 2 #> 2 ARM AGE stats_on… den.df Denomina… 167.237 #> 3 ARM AGE stats_on… statistic F Statis… 0.547 #> 4 ARM AGE stats_on… p.value p-value 0.58 #> 5 ARM AGE stats_on… method Method One-way … #> 6 ARM AGE stats_on… var.equal var.equal FALSE #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_poisson_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Poisson Test — ard_stats_poisson_test","title":"ARD Poisson Test — ard_stats_poisson_test","text":"Analysis results data exact tests simple null hypothesis rate parameter Poisson distribution, comparison two rate parameters.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_poisson_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Poisson Test — ard_stats_poisson_test","text":"","code":"ard_stats_poisson_test( data, variables, na.rm = TRUE, by = NULL, conf.level = 0.95, ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_poisson_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Poisson Test — ard_stats_poisson_test","text":"data (data.frame) data frame. See details. variables (tidy-select) names event time variables (order) used computations. Must length 2. na.rm (scalar logical) whether missing values removed computations. Default TRUE. (tidy-select) optional column name compare . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed poisson.test().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_poisson_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Poisson Test — ard_stats_poisson_test","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_poisson_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Poisson Test — ard_stats_poisson_test","text":"ard_stats_poisson_test() function, data expected one row per subject. specified, exact Poisson test rate parameter performed. Otherwise, Poisson comparison two rate parameters performed levels . 2 levels, error occur.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_poisson_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Poisson Test — ard_stats_poisson_test","text":"","code":"# Exact test of rate parameter against null hypothesis cards::ADTTE |> ard_stats_poisson_test(variables = c(CNSR, AVAL)) #> {cards} data frame: 10 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 AVAL stats_po… estimate Estimate… 0.006 1 #> 2 AVAL stats_po… statistic Number o… 102 1 #> 3 AVAL stats_po… p.value p-value 0 1 #> 4 AVAL stats_po… parameter Expected… 16853 1 #> 5 AVAL stats_po… conf.low CI Lower… 0.005 1 #> 6 AVAL stats_po… conf.high CI Upper… 0.007 1 #> 7 AVAL stats_po… method method Exact Po… NULL #> 8 AVAL stats_po… alternative alternat… two.sided NULL #> 9 AVAL stats_po… conf.level CI Confi… 0.95 1 #> 10 AVAL stats_po… mu H0 Mean 1 1 #> ℹ 2 more variables: warning, error # Comparison test of ratio of 2 rate parameters against null hypothesis cards::ADTTE |> dplyr::filter(TRTA %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_stats_poisson_test(by = TRTA, variables = c(CNSR, AVAL)) #> {cards} data frame: 10 x 9 #> group1 variable context stat_name stat_label stat #> 1 TRTA AVAL stats_po… estimate Estimate… 0.768 #> 2 TRTA AVAL stats_po… statistic Number o… 57 #> 3 TRTA AVAL stats_po… p.value p-value 0.293 #> 4 TRTA AVAL stats_po… parameter Expected… 61.078 #> 5 TRTA AVAL stats_po… conf.low CI Lower… 0.466 #> 6 TRTA AVAL stats_po… conf.high CI Upper… 1.306 #> 7 TRTA AVAL stats_po… method method Comparis… #> 8 TRTA AVAL stats_po… alternative alternat… two.sided #> 9 TRTA AVAL stats_po… conf.level CI Confi… 0.95 #> 10 TRTA AVAL stats_po… mu H0 Mean 1 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_prop_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD 2-sample proportion test — ard_stats_prop_test","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"Analysis results data 2-sample test proportions using stats::prop.test().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_prop_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"","code":"ard_stats_prop_test(data, by, variables, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_prop_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"data (data.frame) data frame. (tidy-select) column name compare variables (tidy-select) column names compared. Must binary column coded TRUE/FALSE 1/0. Independent tests computed variable. conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed prop.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_prop_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_prop_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD 2-sample proportion test — ard_stats_prop_test","text":"","code":"mtcars |> ard_stats_prop_test(by = vs, variables = am) #> {cards} data frame: 13 x 9 #> group1 variable context stat_name stat_label stat #> 1 vs am stats_pr… estimate Rate Dif… -0.167 #> 2 vs am stats_pr… estimate1 Group 1 … 0.333 #> 3 vs am stats_pr… estimate2 Group 2 … 0.5 #> 4 vs am stats_pr… statistic X-square… 0.348 #> 5 vs am stats_pr… p.value p-value 0.556 #> 6 vs am stats_pr… parameter Degrees … 1 #> 7 vs am stats_pr… conf.low CI Lower… -0.571 #> 8 vs am stats_pr… conf.high CI Upper… 0.237 #> 9 vs am stats_pr… method method 2-sample… #> 10 vs am stats_pr… alternative alternat… two.sided #> 11 vs am stats_pr… p p #> 12 vs am stats_pr… conf.level CI Confi… 0.95 #> 13 vs am stats_pr… correct Yates' c… TRUE #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD t-test — ard_stats_t_test","title":"ARD t-test — ard_stats_t_test","text":"Analysis results data paired non-paired t-tests.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD t-test — ard_stats_t_test","text":"","code":"ard_stats_t_test(data, variables, by = NULL, conf.level = 0.95, ...) ard_stats_paired_t_test(data, by, variables, id, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD t-test — ard_stats_t_test","text":"data (data.frame) data frame. See details. variables (tidy-select) column names compared. Independent t-tests computed variable. (tidy-select) optional column name compare . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed t.test() id (tidy-select) column name subject participant ID","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD t-test — ard_stats_t_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD t-test — ard_stats_t_test","text":"ard_stats_t_test() function, data expected one row per subject. data passed t.test(data[[variable]] ~ data[[]], paired = FALSE, ...). ard_stats_paired_t_test() function, data expected one row per subject per level. t-test calculated, data reshaped wide format one row per subject. data passed t.test(x = data_wide[[]], y = data_wide[[]], paired = TRUE, ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD t-test — ard_stats_t_test","text":"","code":"cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_stats_t_test(by = ARM, variables = c(AGE, BMIBL)) #> {cards} data frame: 28 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_t_… estimate Mean Dif… 0.828 #> 2 ARM AGE stats_t_… estimate1 Group 1 … 75.209 #> 3 ARM AGE stats_t_… estimate2 Group 2 … 74.381 #> 4 ARM AGE stats_t_… statistic t Statis… 0.655 #> 5 ARM AGE stats_t_… p.value p-value 0.513 #> 6 ARM AGE stats_t_… parameter Degrees … 167.362 #> 7 ARM AGE stats_t_… conf.low CI Lower… -1.668 #> 8 ARM AGE stats_t_… conf.high CI Upper… 3.324 #> 9 ARM AGE stats_t_… method method Welch Tw… #> 10 ARM AGE stats_t_… alternative alternat… two.sided #> ℹ 18 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 3 more variables: fmt_fn, warning, error # constructing a paired data set, # where patients receive both treatments cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> ard_stats_paired_t_test(by = ARM, variables = AGE, id = USUBJID) #> {cards} data frame: 12 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_t_… estimate Mean Dif… 0.798 #> 2 ARM AGE stats_t_… statistic t Statis… 0.628 #> 3 ARM AGE stats_t_… p.value p-value 0.531 #> 4 ARM AGE stats_t_… parameter Degrees … 83 #> 5 ARM AGE stats_t_… conf.low CI Lower… -1.727 #> 6 ARM AGE stats_t_… conf.high CI Upper… 3.322 #> 7 ARM AGE stats_t_… method method Paired t… #> 8 ARM AGE stats_t_… alternative alternat… two.sided #> 9 ARM AGE stats_t_… mu H0 Mean 0 #> 10 ARM AGE stats_t_… paired Paired t… TRUE #> 11 ARM AGE stats_t_… var.equal Equal Va… FALSE #> 12 ARM AGE stats_t_… conf.level CI Confi… 0.95 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test_onesample.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD one-sample t-test — ard_stats_t_test_onesample","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"Analysis results data one-sample t-tests. Result may stratified including argument.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test_onesample.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"","code":"ard_stats_t_test_onesample( data, variables, by = dplyr::group_vars(data), conf.level = 0.95, ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test_onesample.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"data (data.frame) data frame. See details. variables (tidy-select) column names analyzed. Independent t-tests computed variable. (tidy-select) optional column name stratify results . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed t.test()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test_onesample.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_t_test_onesample.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD one-sample t-test — ard_stats_t_test_onesample","text":"","code":"cards::ADSL |> ard_stats_t_test_onesample(by = ARM, variables = AGE) #> {cards} data frame: 30 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 ARM Placebo AGE estimate Mean 75.209 #> 2 ARM Placebo AGE statistic t Statis… 81.193 #> 3 ARM Placebo AGE p.value p-value 0 #> 4 ARM Placebo AGE parameter Degrees … 85 #> 5 ARM Placebo AGE conf.low CI Lower… 73.368 #> 6 ARM Placebo AGE conf.high CI Upper… 77.051 #> 7 ARM Placebo AGE method method One Samp… #> 8 ARM Placebo AGE alternative alternat… two.sided #> 9 ARM Placebo AGE mu H0 Mean 0 #> 10 ARM Placebo AGE conf.level CI Confi… 0.95 #> ℹ 20 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"Analysis results data paired non-paired Wilcoxon Rank-Sum tests.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"","code":"ard_stats_wilcox_test(data, variables, by = NULL, conf.level = 0.95, ...) ard_stats_paired_wilcox_test(data, by, variables, id, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"data (data.frame) data frame. See details. variables (tidy-select) column names compared. Independent tests computed variable. (tidy-select) optional column name compare . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed wilcox.test(...) id (tidy-select) column name subject participant ID.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"ard_stats_wilcox_test() function, data expected one row per subject. data passed wilcox.test(data[[variable]] ~ data[[]], paired = FALSE, ...). ard_stats_paired_wilcox_test() function, data expected one row per subject per level. test calculated, data reshaped wide format one row per subject. data passed wilcox.test(x = data_wide[[]], y = data_wide[[]], paired = TRUE, ...).","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Wilcoxon Rank-Sum Test — ard_stats_wilcox_test","text":"","code":"cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_stats_wilcox_test(by = \"ARM\", variables = \"AGE\") #> {cards} data frame: 12 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_wi… statistic X-square… 3862.5 #> 2 ARM AGE stats_wi… p.value p-value 0.435 #> 3 ARM AGE stats_wi… method method Wilcoxon… #> 4 ARM AGE stats_wi… alternative alternat… two.sided #> 5 ARM AGE stats_wi… mu mu 0 #> 6 ARM AGE stats_wi… paired Paired t… FALSE #> 7 ARM AGE stats_wi… exact exact #> 8 ARM AGE stats_wi… correct correct TRUE #> 9 ARM AGE stats_wi… conf.int conf.int FALSE #> 10 ARM AGE stats_wi… conf.level CI Confi… 0.95 #> 11 ARM AGE stats_wi… tol.root tol.root 0 #> 12 ARM AGE stats_wi… digits.rank digits.r… Inf #> ℹ 3 more variables: fmt_fn, warning, error # constructing a paired data set, # where patients receive both treatments cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> ard_stats_paired_wilcox_test(by = ARM, variables = AGE, id = USUBJID) #> {cards} data frame: 12 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_wi… statistic X-square… 1754 #> 2 ARM AGE stats_wi… p.value p-value 0.522 #> 3 ARM AGE stats_wi… method method Wilcoxon… #> 4 ARM AGE stats_wi… alternative alternat… two.sided #> 5 ARM AGE stats_wi… mu mu 0 #> 6 ARM AGE stats_wi… paired Paired t… TRUE #> 7 ARM AGE stats_wi… exact exact #> 8 ARM AGE stats_wi… correct correct TRUE #> 9 ARM AGE stats_wi… conf.int conf.int FALSE #> 10 ARM AGE stats_wi… conf.level CI Confi… 0.95 #> 11 ARM AGE stats_wi… tol.root tol.root 0 #> 12 ARM AGE stats_wi… digits.rank digits.r… Inf #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test_onesample.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"Analysis results data one-sample Wilcox Rank-sum. Result may stratified including argument.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test_onesample.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"","code":"ard_stats_wilcox_test_onesample( data, variables, by = dplyr::group_vars(data), conf.level = 0.95, ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test_onesample.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"data (data.frame) data frame. See details. variables (tidy-select) column names analyzed. Independent Wilcox Rank-sum tests computed variable. (tidy-select) optional column name stratify results . conf.level (scalar numeric) confidence level confidence interval. Default 0.95. ... arguments passed wilcox.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test_onesample.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_stats_wilcox_test_onesample.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD one-sample Wilcox Rank-sum — ard_stats_wilcox_test_onesample","text":"","code":"cards::ADSL |> ard_stats_wilcox_test_onesample(by = ARM, variables = AGE) #> {cards} data frame: 27 x 10 #> group1 group1_level variable stat_name stat_label stat #> 1 ARM Placebo AGE statistic t Statis… 3741 #> 2 ARM Placebo AGE p.value p-value 0 #> 3 ARM Placebo AGE method method Wilcoxon… #> 4 ARM Placebo AGE alternative alternat… two.sided #> 5 ARM Placebo AGE mu H0 Mean 0 #> 6 ARM Placebo AGE conf.int conf.int FALSE #> 7 ARM Placebo AGE tol.root tol.root 0 #> 8 ARM Placebo AGE digits.rank digits.r… Inf #> 9 ARM Placebo AGE conf.level CI Confi… 0.95 #> 10 ARM Xanomeli… AGE statistic t Statis… 3570 #> ℹ 17 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svychisq.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survey Chi-Square Test — ard_survey_svychisq","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"Analysis results data survey Chi-Square test using survey::svychisq(). two-way comparisons supported.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svychisq.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"","code":"ard_survey_svychisq(data, by, variables, statistic = \"F\", ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svychisq.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"data (survey.design) survey design object often created {survey} package (tidy-select) column name compare . variables (tidy-select) column names compared. Independent tests computed variable. statistic (character) statistic used estimate Chisq p-value. Default Rao-Scott second-order correction (\"F\"). See survey::svychisq available statistics options. ... arguments passed survey::svychisq().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svychisq.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svychisq.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survey Chi-Square Test — ard_survey_svychisq","text":"","code":"data(api, package = \"survey\") dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc) ard_survey_svychisq(dclus1, variables = sch.wide, by = comp.imp, statistic = \"F\") #> {cards} data frame: 5 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp sch.wide survey_s… ndf Nominato… 1 #> 2 comp.imp sch.wide survey_s… ddf Denomina… 14 #> 3 comp.imp sch.wide survey_s… statistic Statistic 236.895 #> 4 comp.imp sch.wide survey_s… p.value p-value 0 #> 5 comp.imp sch.wide survey_s… method method Pearson'… #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyranktest.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survey rank test — ard_survey_svyranktest","title":"ARD Survey rank test — ard_survey_svyranktest","text":"Analysis results data survey wilcox test using survey::svyranktest().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyranktest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survey rank test — ard_survey_svyranktest","text":"","code":"ard_survey_svyranktest(data, by, variables, test, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyranktest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survey rank test — ard_survey_svyranktest","text":"data (survey.design) survey design object often created survey::svydesign() (tidy-select) column name compare variables (tidy-select) column names compared. Independent tests run variable. test (string) string denote rank test use: \"wilcoxon\", \"vanderWaerden\", \"median\", \"KruskalWallis\" ... arguments passed survey::svyranktest()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyranktest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survey rank test — ard_survey_svyranktest","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyranktest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survey rank test — ard_survey_svyranktest","text":"","code":"data(api, package = \"survey\") dclus2 <- survey::svydesign(id = ~ dnum + snum, fpc = ~ fpc1 + fpc2, data = apiclus2) ard_survey_svyranktest(dclus2, variables = enroll, by = comp.imp, test = \"wilcoxon\") #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Median o… -0.106 #> 2 comp.imp enroll survey_s… statistic Statistic -1.719 #> 3 comp.imp enroll survey_s… p.value p-value 0.094 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error ard_survey_svyranktest(dclus2, variables = enroll, by = comp.imp, test = \"vanderWaerden\") #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Median o… -0.379 #> 2 comp.imp enroll survey_s… statistic Statistic -1.584 #> 3 comp.imp enroll survey_s… p.value p-value 0.122 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error ard_survey_svyranktest(dclus2, variables = enroll, by = comp.imp, test = \"median\") #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Median o… -0.124 #> 2 comp.imp enroll survey_s… statistic Statistic -0.914 #> 3 comp.imp enroll survey_s… p.value p-value 0.367 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error ard_survey_svyranktest(dclus2, variables = enroll, by = comp.imp, test = \"KruskalWallis\") #> {cards} data frame: 6 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Median o… -0.106 #> 2 comp.imp enroll survey_s… statistic Statistic -1.719 #> 3 comp.imp enroll survey_s… p.value p-value 0.094 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative Alternat… two.sided #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyttest.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survey t-test — ard_survey_svyttest","title":"ARD Survey t-test — ard_survey_svyttest","text":"Analysis results data survey t-test using survey::svyttest().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyttest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survey t-test — ard_survey_svyttest","text":"","code":"ard_survey_svyttest(data, by, variables, conf.level = 0.95, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyttest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survey t-test — ard_survey_svyttest","text":"data (survey.design) survey design object often created survey::svydesign() (tidy-select) column name compare variables (tidy-select) column names compared. Independent tests run variable. conf.level (double) confidence level returned confidence interval. Must c(0, 1). Default 0.95 ... arguments passed survey::svyttest()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyttest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survey t-test — ard_survey_svyttest","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survey_svyttest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survey t-test — ard_survey_svyttest","text":"","code":"data(api, package = \"survey\") dclus2 <- survey::svydesign(id = ~ dnum + snum, fpc = ~ fpc1 + fpc2, data = apiclus2) ard_survey_svyttest(dclus2, variables = enroll, by = comp.imp, conf.level = 0.9) #> {cards} data frame: 9 x 9 #> group1 variable context stat_name stat_label stat #> 1 comp.imp enroll survey_s… estimate Mean -225.737 #> 2 comp.imp enroll survey_s… statistic t Statis… -2.888 #> 3 comp.imp enroll survey_s… p.value p-value 0.007 #> 4 comp.imp enroll survey_s… parameter Degrees … 36 #> 5 comp.imp enroll survey_s… method method Design-b… #> 6 comp.imp enroll survey_s… alternative alternat… two.sided #> 7 comp.imp enroll survey_s… conf.low CI Lower… -357.69 #> 8 comp.imp enroll survey_s… conf.high CI Upper… -93.784 #> 9 comp.imp enroll survey_s… conf.level CI Confi… 0.9 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survdiff.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD for Difference in Survival — ard_survival_survdiff","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"Analysis results data comparison survival using survival::survdiff().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survdiff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"","code":"ard_survival_survdiff(formula, data, rho = 0, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survdiff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"formula (formula) formula data (data.frame) data frame rho (scalar numeric) numeric scalar passed survival::survdiff(rho). Default rho=0. ... additional arguments passed survival::survdiff()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survdiff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survdiff.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD for Difference in Survival — ard_survival_survdiff","text":"","code":"library(survival) library(ggsurvfit) #> Loading required package: ggplot2 ard_survival_survdiff(Surv_CNSR(AVAL, CNSR) ~ TRTA, data = cards::ADTTE) #> {cards} data frame: 4 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 TRTA survival… statistic X^2 Stat… 60.27 1 #> 2 TRTA survival… df Degrees … 2 1 #> 3 TRTA survival… p.value p-value 0 1 #> 4 TRTA survival… method method Log-rank… NULL #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survival Estimates — ard_survival_survfit","title":"ARD Survival Estimates — ard_survival_survfit","text":"Analysis results data survival quantiles x-year survival estimates, extracted survival::survfit() model.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survival Estimates — ard_survival_survfit","text":"","code":"ard_survival_survfit(x, ...) # S3 method for class 'survfit' ard_survival_survfit(x, times = NULL, probs = NULL, type = NULL, ...) # S3 method for class 'data.frame' ard_survival_survfit( x, y, variables, times = NULL, probs = NULL, type = NULL, method.args = list(conf.int = 0.95), ... )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survival Estimates — ard_survival_survfit","text":"x (survfit data.frame) object class survfit created survival::survfit() data frame. See details. ... dots future extensions must empty. times (numeric) vector times return survival probabilities. probs (numeric) vector probabilities values (0,1) specifying survival quantiles return. type (string NULL) type statistic report. Available Kaplan-Meier time estimates , otherwise type ignored. Default NULL. Must one following: y (Surv string) object class Surv created using survival::Surv(). object passed left-hand side formula constructed passed survival::survfit(). object can also passed string. variables (character) stratification variables passed right-hand side formula constructed passed survival::survfit(). method.args (named list) named list arguments passed survival::survfit().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survival Estimates — ard_survival_survfit","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"ARD Survival Estimates — ard_survival_survfit","text":"one either times probs parameters can specified. Times provided using scale time variable used fit provided survival fit model.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit.html","id":"formula-specification","dir":"Reference","previous_headings":"","what":"Formula Specification","title":"ARD Survival Estimates — ard_survival_survfit","text":"passing survival::survfit() object ard_survival_survfit(), survfit() call must use evaluated formula stored formula. Including proper formula call allows function accurately identify variables included estimation. See examples: , however, pass stored formula, e.g. survfit(my_formula, lung)","code":"library(cardx) library(survival) # include formula in `survfit()` call survfit(Surv(time, status) ~ sex, lung) |> ard_survival_survfit(time = 500) # you can also pass a data frame to `ard_survival_survfit()` as well. lung |> ard_survival_survfit(y = Surv(time, status), variables = \"sex\", time = 500)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit.html","id":"variable-classes","dir":"Reference","previous_headings":"","what":"Variable Classes","title":"ARD Survival Estimates — ard_survival_survfit","text":"survfit method called, class stratifying variables returned factor. data frame method called, original classes retained resulting ARD.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survival Estimates — ard_survival_survfit","text":"","code":"library(survival) library(ggsurvfit) survfit(Surv_CNSR(AVAL, CNSR) ~ TRTA, data = cards::ADTTE) |> ard_survival_survfit(times = c(60, 180)) #> {cards} data frame: 30 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 TRTA Placebo time 60 n.risk Number o… 59 #> 2 TRTA Placebo time 60 estimate Survival… 0.768 #> 3 TRTA Placebo time 60 std.error Standard… 0.047 #> 4 TRTA Placebo time 60 conf.high CI Upper… 0.866 #> 5 TRTA Placebo time 60 conf.low CI Lower… 0.682 #> 6 TRTA Placebo time 180 n.risk Number o… 35 #> 7 TRTA Placebo time 180 estimate Survival… 0.626 #> 8 TRTA Placebo time 180 std.error Standard… 0.056 #> 9 TRTA Placebo time 180 conf.high CI Upper… 0.746 #> 10 TRTA Placebo time 180 conf.low CI Lower… 0.526 #> ℹ 20 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error survfit(Surv_CNSR(AVAL, CNSR) ~ TRTA, data = cards::ADTTE, conf.int = 0.90) |> ard_survival_survfit(probs = c(0.25, 0.5, 0.75)) #> {cards} data frame: 27 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 TRTA Placebo prob 0.25 estimate Survival… 70 #> 2 TRTA Placebo prob 0.25 conf.high CI Upper… 110 #> 3 TRTA Placebo prob 0.25 conf.low CI Lower… 42 #> 4 TRTA Placebo prob 0.5 estimate Survival… NA #> 5 TRTA Placebo prob 0.5 conf.high CI Upper… NA #> 6 TRTA Placebo prob 0.5 conf.low CI Lower… NA #> 7 TRTA Placebo prob 0.75 estimate Survival… NA #> 8 TRTA Placebo prob 0.75 conf.high CI Upper… NA #> 9 TRTA Placebo prob 0.75 conf.low CI Lower… NA #> 10 TRTA Xanomeli… prob 0.25 estimate Survival… 14 #> ℹ 17 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error cards::ADTTE |> ard_survival_survfit(y = Surv_CNSR(AVAL, CNSR), variables = c(\"TRTA\", \"SEX\"), times = 90) #> {cards} data frame: 30 x 13 #> group1 group1_level group2 group2_level variable variable_level stat_name #> 1 TRTA Placebo SEX F time 90 n.risk #> 2 TRTA Placebo SEX F time 90 estimate #> 3 TRTA Placebo SEX F time 90 std.error #> 4 TRTA Placebo SEX F time 90 conf.high #> 5 TRTA Placebo SEX F time 90 conf.low #> 6 TRTA Placebo SEX M time 90 n.risk #> 7 TRTA Placebo SEX M time 90 estimate #> 8 TRTA Placebo SEX M time 90 std.error #> 9 TRTA Placebo SEX M time 90 conf.high #> 10 TRTA Placebo SEX M time 90 conf.low #> stat_label stat #> 1 Number o… 27 #> 2 Survival… 0.619 #> 3 Standard… 0.072 #> 4 CI Upper… 0.777 #> 5 CI Lower… 0.493 #> 6 Number o… 22 #> 7 Survival… 0.748 #> 8 Standard… 0.077 #> 9 CI Upper… 0.916 #> 10 CI Lower… 0.611 #> ℹ 20 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error # Competing Risks Example --------------------------- set.seed(1) ADTTE_MS <- cards::ADTTE %>% dplyr::mutate( CNSR = dplyr::case_when( CNSR == 0 ~ \"censor\", runif(dplyr::n()) < 0.5 ~ \"death from cancer\", TRUE ~ \"death other causes\" ) %>% factor() ) survfit(Surv(AVAL, CNSR) ~ TRTA, data = ADTTE_MS) %>% ard_survival_survfit(times = c(60, 180)) #> Multi-state model detected. Showing probabilities into state 'death from #> cancer'. #> {cards} data frame: 30 x 11 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 TRTA Placebo time 60 n.risk Number o… 59 #> 2 TRTA Placebo time 60 estimate Survival… 0.054 #> 3 TRTA Placebo time 60 std.error Standard… 0.026 #> 4 TRTA Placebo time 60 conf.high CI Upper… 0.14 #> 5 TRTA Placebo time 60 conf.low CI Lower… 0.021 #> 6 TRTA Placebo time 180 n.risk Number o… 35 #> 7 TRTA Placebo time 180 estimate Survival… 0.226 #> 8 TRTA Placebo time 180 std.error Standard… 0.054 #> 9 TRTA Placebo time 180 conf.high CI Upper… 0.361 #> 10 TRTA Placebo time 180 conf.low CI Lower… 0.142 #> ℹ 20 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit_diff.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Survival Differences — ard_survival_survfit_diff","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"Calculate differences Kaplan-Meier estimator survival using results survival::survfit().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit_diff.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"","code":"ard_survival_survfit_diff(x, times, conf.level = 0.95)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit_diff.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"x (survift) object class 'survfit' typically created survival::survfit() times (numeric) vector times return survival probabilities. conf.level (scalar numeric) confidence level confidence interval. Default 0.95.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit_diff.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_survival_survfit_diff.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Survival Differences — ard_survival_survfit_diff","text":"","code":"library(ggsurvfit) library(survival) survfit(Surv_CNSR() ~ TRTA, data = cards::ADTTE) |> ard_survival_survfit_diff(times = c(25, 50)) #> {cards} data frame: 32 x 11 #> group1 group1_level variable variable_level stat_name stat_label #> 1 TRTA Xanomeli… time 25 reference_level referenc… #> 2 TRTA Xanomeli… time 25 method method #> 3 TRTA Xanomeli… time 25 estimate Survival… #> 4 TRTA Xanomeli… time 25 std.error Survival… #> 5 TRTA Xanomeli… time 25 statistic z statis… #> 6 TRTA Xanomeli… time 25 conf.low CI Lower… #> 7 TRTA Xanomeli… time 25 conf.high CI Upper… #> 8 TRTA Xanomeli… time 25 p.value p-value #> 9 TRTA Xanomeli… time 50 reference_level referenc… #> 10 TRTA Xanomeli… time 50 method method #> stat #> 1 Placebo #> 2 Survival… #> 3 0.293 #> 4 0.067 #> 5 4.392 #> 6 0.162 #> 7 0.424 #> 8 0 #> 9 Placebo #> 10 Survival… #> ℹ 22 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 4 more variables: context, fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_total_n.survey.design.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD Total N — ard_total_n.survey.design","title":"ARD Total N — ard_total_n.survey.design","text":"Returns total N survey object. placeholder variable name returned object \"..ard_total_n..\"","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_total_n.survey.design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD Total N — ard_total_n.survey.design","text":"","code":"# S3 method for class 'survey.design' ard_total_n(data, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_total_n.survey.design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD Total N — ard_total_n.survey.design","text":"data (survey.design) design object often created survey::svydesign(). ... dots future extensions must empty.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_total_n.survey.design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD Total N — ard_total_n.survey.design","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/ard_total_n.survey.design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD Total N — ard_total_n.survey.design","text":"","code":"svy_titanic <- survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) ard_total_n(svy_titanic) #> {cards} data frame: 2 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 ..ard_total_n.. total_n N N 2201 #> 2 ..ard_total_n.. total_n N_unweighted Unweight… 32 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/cardx-package.html","id":null,"dir":"Reference","previous_headings":"","what":"cardx: Extra Analysis Results Data Utilities — cardx-package","title":"cardx: Extra Analysis Results Data Utilities — cardx-package","text":"Create extra Analysis Results Data (ARD) summary objects. package supplements simple ARD functions 'cards' package, exporting functions put statistical results ARD format. objects used re-used construct summary tables, visualizations, written reports.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/main/reference/cardx-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"cardx: Extra Analysis Results Data Utilities — cardx-package","text":"Maintainer: Daniel Sjoberg danield.sjoberg@gmail.com Authors: Abinaya Yogasekaram abinaya.yogasekaram@contractors.roche.com Emily de la Rua emily.de_la_rua@contractors.roche.com contributors: F. Hoffmann-La Roche AG [copyright holder, funder]","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/construction_helpers.html","id":null,"dir":"Reference","previous_headings":"","what":"Construction Helpers — construction_helpers","title":"Construction Helpers — construction_helpers","text":"functions help construct calls various types models.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/construction_helpers.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construction Helpers — construction_helpers","text":"","code":"construct_model(data, ...) # S3 method for class 'data.frame' construct_model( data, formula, method, method.args = list(), package = \"base\", env = caller_env(), ... ) # S3 method for class 'survey.design' construct_model( data, formula, method, method.args = list(), package = \"survey\", env = caller_env(), ... ) reformulate2( termlabels, response = NULL, intercept = TRUE, env = parent.frame(), pattern_term = NULL, pattern_response = NULL ) bt(x, pattern = NULL) bt_strip(x)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/construction_helpers.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construction Helpers — construction_helpers","text":"data construct_model.data.frame() (data.frame) data frame construct_model.survey.design() (survey.design) survey design object ... dots future extensions must empty. formula (formula) formula method (string) string function naming function called, e.g. \"glm\". function belongs library attached, package name must specified package argument. method.args (named list) named list arguments passed method. Note list may contain non-standard evaluation components. wrapping function functions, argument must passed way evaluate list, e.g. using rlang's embrace operator {{ . }}. package (string) string package name temporarily loaded function specified method executed. env environment evaluate expr. environment applicable quosures environments. termlabels character vector giving right-hand side model formula. zero-length. response character string, symbol call giving left-hand side model formula, NULL. intercept logical: formula intercept? x (character) character vector, typically variable names pattern, pattern_term, pattern_response DEPRECATED","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/construction_helpers.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Construction Helpers — construction_helpers","text":"depends calling function","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/construction_helpers.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Construction Helpers — construction_helpers","text":"construct_model(): Builds models form method(data = data, formula = formula, method.args!!!). package argument specified, package temporarily attached model evaluated. reformulate2(): copy reformulate() except variable names contain space wrapped backticks. bt(): Adds backticks character vector. bt_strip(): Removes backticks string begins ends backtick.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/construction_helpers.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Construction Helpers — construction_helpers","text":"","code":"construct_model( data = mtcars, formula = am ~ mpg + (1 | vs), method = \"glmer\", method.args = list(family = binomial), package = \"lme4\" ) |> broom.mixed::tidy() #> # A tibble: 3 × 7 #> effect group term estimate std.error statistic p.value #> #> 1 fixed NA (Intercept) -8.70 4.12 -2.11 0.0347 #> 2 fixed NA mpg 0.409 0.199 2.05 0.0403 #> 3 ran_pars vs sd__(Intercept) 0.790 NA NA NA construct_model( data = mtcars |> dplyr::rename(`M P G` = mpg), formula = reformulate2(c(\"M P G\", \"cyl\"), response = \"hp\"), method = \"lm\" ) |> ard_regression() |> dplyr::filter(stat_name %in% c(\"term\", \"estimate\", \"p.value\")) #> {cards} data frame: 6 x 8 #> variable context stat_name stat_label stat fmt_fn #> 1 M P G regressi… term term `M P G` NULL #> 2 M P G regressi… estimate Coeffici… -2.775 1 #> 3 M P G regressi… p.value p-value 0.213 1 #> 4 cyl regressi… term term cyl NULL #> 5 cyl regressi… estimate Coeffici… 23.979 1 #> 6 cyl regressi… p.value p-value 0.003 1 #> ℹ 2 more variables: warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-check_dichotomous_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform Value Checks — .check_dichotomous_value","title":"Perform Value Checks — .check_dichotomous_value","text":"Check validity values passed ard_dichotomous(value).","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-check_dichotomous_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform Value Checks — .check_dichotomous_value","text":"","code":".check_dichotomous_value(data, value)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-check_dichotomous_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform Value Checks — .check_dichotomous_value","text":"data (data.frame) data frame value (named list) named list","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-check_dichotomous_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform Value Checks — .check_dichotomous_value","text":"returns invisible check successful, throws error message .","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-check_dichotomous_value.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform Value Checks — .check_dichotomous_value","text":"","code":"cardx:::.check_dichotomous_value(mtcars, list(cyl = 4))"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-extract_wald_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Extract data from wald.test object — .extract_wald_results","title":"Extract data from wald.test object — .extract_wald_results","text":"Extract data wald.test object","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-extract_wald_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extract data from wald.test object — .extract_wald_results","text":"","code":".extract_wald_results(wald_test)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-extract_wald_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extract data from wald.test object — .extract_wald_results","text":"wald_test (data.frame) wald test object object aod::wald.test()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-extract_wald_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extract data from wald.test object — .extract_wald_results","text":"data frame containing wald test results.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_cohens_d_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Cohen's D Test to ARD — .format_cohens_d_results","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"Convert Cohen's D Test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_cohens_d_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"","code":".format_cohens_d_results(by, variable, lst_tidy, paired, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_cohens_d_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). paired TRUE, values x y considered paired. produces effect size equivalent one-sample effect size x - y. See also repeated_measures_d() options. ... passed cohens_d(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_cohens_d_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_cohens_d_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Cohen's D Test to ARD — .format_cohens_d_results","text":"","code":"cardx:::.format_cohens_d_results( by = \"ARM\", variable = \"AGE\", paired = FALSE, lst_tidy = cards::eval_capture_conditions( effectsize::hedges_g(data[[variable]] ~ data[[by]], paired = FALSE) |> parameters::standardize_names(style = \"broom\") ) ) #> {cards} data frame: 8 x 9 #> group1 variable stat_name stat_label stat error #> 1 ARM AGE estimate Effect S… object '… #> 2 ARM AGE conf.level CI Confi… object '… #> 3 ARM AGE conf.low CI Lower… object '… #> 4 ARM AGE conf.high CI Upper… object '… #> 5 ARM AGE mu H0 Mean 0 object '… #> 6 ARM AGE paired Paired t… FALSE object '… #> 7 ARM AGE pooled_sd Pooled S… TRUE object '… #> 8 ARM AGE alternative Alternat… two.sided object '… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_hedges_g_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Hedge's G Test to ARD — .format_hedges_g_results","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"Convert Hedge's G Test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_hedges_g_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"","code":".format_hedges_g_results(by, variable, lst_tidy, paired, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_hedges_g_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). paired TRUE, values x y considered paired. produces effect size equivalent one-sample effect size x - y. See also repeated_measures_d() options. ... passed hedges_g(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_hedges_g_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_hedges_g_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Hedge's G Test to ARD — .format_hedges_g_results","text":"","code":"cardx:::.format_hedges_g_results( by = \"ARM\", variable = \"AGE\", paired = FALSE, lst_tidy = cards::eval_capture_conditions( effectsize::hedges_g(data[[variable]] ~ data[[by]], paired = FALSE) |> parameters::standardize_names(style = \"broom\") ) ) #> {cards} data frame: 8 x 9 #> group1 variable stat_name stat_label stat error #> 1 ARM AGE estimate Effect S… object '… #> 2 ARM AGE conf.level CI Confi… object '… #> 3 ARM AGE conf.low CI Lower… object '… #> 4 ARM AGE conf.high CI Upper… object '… #> 5 ARM AGE mu H0 Mean 0 object '… #> 6 ARM AGE paired Paired t… FALSE object '… #> 7 ARM AGE pooled_sd Pooled S… TRUE object '… #> 8 ARM AGE alternative Alternat… two.sided object '… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_mcnemartest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert McNemar's test to ARD — .format_mcnemartest_results","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"Convert McNemar's test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_mcnemartest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"","code":".format_mcnemartest_results(by, variable, lst_tidy, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_mcnemartest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). ... passed stats::mcnemar.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_mcnemartest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_mcnemartest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert McNemar's test to ARD — .format_mcnemartest_results","text":"","code":"cardx:::.format_mcnemartest_results( by = \"ARM\", variable = \"AGE\", lst_tidy = cards::eval_capture_conditions( stats::mcnemar.test(cards::ADSL[[\"SEX\"]], cards::ADSL[[\"EFFFL\"]]) |> broom::tidy() ) ) #> {cards} data frame: 5 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AGE stats_mc… statistic X-square… 111.91 #> 2 ARM AGE stats_mc… p.value p-value 0 #> 3 ARM AGE stats_mc… parameter Degrees … 1 #> 4 ARM AGE stats_mc… method method McNemar'… #> 5 ARM AGE stats_mc… correct correct TRUE #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_moodtest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert mood test results to ARD — .format_moodtest_results","title":"Convert mood test results to ARD — .format_moodtest_results","text":"Convert mood test results ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_moodtest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert mood test results to ARD — .format_moodtest_results","text":"","code":".format_moodtest_results(by, variable, lst_tidy, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_moodtest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert mood test results to ARD — .format_moodtest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). ... passed mood.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_moodtest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert mood test results to ARD — .format_moodtest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_moodtest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert mood test results to ARD — .format_moodtest_results","text":"","code":"cardx:::.format_moodtest_results( by = \"SEX\", variable = \"AGE\", lst_tidy = cards::eval_capture_conditions( stats::mood.test(ADSL[[\"AGE\"]] ~ ADSL[[\"SEX\"]]) |> broom::tidy() ) ) #> {cards} data frame: 4 x 9 #> group1 variable stat_name stat_label stat error #> 1 SEX AGE statistic Z-Statis… object '… #> 2 SEX AGE p.value p-value object '… #> 3 SEX AGE method method object '… #> 4 SEX AGE alternative Alternat… object '… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_poissontest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Poisson test to ARD — .format_poissontest_results","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"Convert Poisson test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_poissontest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"","code":".format_poissontest_results(by = NULL, variables, lst_tidy, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_poissontest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"(string) column name variables (character) names event time variables lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). ... passed poisson.test()","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_poissontest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_poissontest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Poisson test to ARD — .format_poissontest_results","text":"","code":"cardx:::.format_poissontest_results( by = \"ARM\", variables = c(\"CNSR\", \"AVAL\"), lst_tidy = cards::eval_capture_conditions( stats::poisson.test(sum(cards::ADTTE[[\"CNSR\"]]), sum(cards::ADTTE[[\"AVAL\"]])) |> broom::tidy() ) ) #> {cards} data frame: 10 x 9 #> group1 variable context stat_name stat_label stat #> 1 ARM AVAL stats_po… estimate Estimate… 0.006 #> 2 ARM AVAL stats_po… statistic Number o… 102 #> 3 ARM AVAL stats_po… p.value p-value 0 #> 4 ARM AVAL stats_po… parameter Expected… 16853 #> 5 ARM AVAL stats_po… conf.low CI Lower… 0.005 #> 6 ARM AVAL stats_po… conf.high CI Upper… 0.007 #> 7 ARM AVAL stats_po… method method Exact Po… #> 8 ARM AVAL stats_po… alternative alternat… two.sided #> 9 ARM AVAL stats_po… conf.level CI Confi… 0.95 #> 10 ARM AVAL stats_po… mu H0 Mean 1 #> ℹ 3 more variables: fmt_fn, warning, error"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_proptest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert prop.test to ARD — .format_proptest_results","title":"Convert prop.test to ARD — .format_proptest_results","text":"Convert prop.test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_proptest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert prop.test to ARD — .format_proptest_results","text":"","code":".format_proptest_results(by, variable, lst_tidy, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_proptest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert prop.test to ARD — .format_proptest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). ... passed prop.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_proptest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert prop.test to ARD — .format_proptest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_survfit_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Tidied Survival Fit to ARD — .format_survfit_results","title":"Convert Tidied Survival Fit to ARD — .format_survfit_results","text":"Convert Tidied Survival Fit ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_survfit_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Tidied Survival Fit to ARD — .format_survfit_results","text":"","code":".format_survfit_results(tidy_survfit)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_survfit_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Tidied Survival Fit to ARD — .format_survfit_results","text":"ARD data frame class 'card'","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_survfit_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Tidied Survival Fit to ARD — .format_survfit_results","text":"","code":"cardx:::.format_survfit_results( broom::tidy(survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE)) ) #> {cards} data frame: 805 x 12 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 TRTA Placebo time 1 n.risk Number o… 86 #> 2 TRTA Placebo time 1 estimate Survival… 1 #> 3 TRTA Placebo time 1 std.error Standard… 0 #> 4 TRTA Placebo time 1 conf.high CI Upper… 1 #> 5 TRTA Placebo time 1 conf.low CI Lower… 1 #> 6 TRTA Placebo time 2 n.risk Number o… 85 #> 7 TRTA Placebo time 2 estimate Survival… 1 #> 8 TRTA Placebo time 2 std.error Standard… 0 #> 9 TRTA Placebo time 2 conf.high CI Upper… 1 #> 10 TRTA Placebo time 2 conf.low CI Lower… 1 #> ℹ 795 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 5 more variables: fmt_fn, warning, error, n.event, n.censor"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_ttest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert t-test to ARD — .format_ttest_results","title":"Convert t-test to ARD — .format_ttest_results","text":"Convert t-test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_ttest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert t-test to ARD — .format_ttest_results","text":"","code":".format_ttest_results(by = NULL, variable, lst_tidy, paired, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_ttest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert t-test to ARD — .format_ttest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). paired logical indicating whether want paired t-test. ... passed t.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_ttest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert t-test to ARD — .format_ttest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_ttest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert t-test to ARD — .format_ttest_results","text":"","code":"cardx:::.format_ttest_results( by = \"ARM\", variable = \"AGE\", paired = FALSE, lst_tidy = cards::eval_capture_conditions( stats::t.test(ADSL[[\"AGE\"]] ~ ADSL[[\"ARM\"]], paired = FALSE) |> broom::tidy() ) ) #> {cards} data frame: 14 x 9 #> group1 variable stat_name stat_label stat error #> 1 ARM AGE estimate Mean Dif… cannot u… #> 2 ARM AGE estimate1 Group 1 … cannot u… #> 3 ARM AGE estimate2 Group 2 … cannot u… #> 4 ARM AGE statistic t Statis… cannot u… #> 5 ARM AGE p.value p-value cannot u… #> 6 ARM AGE parameter Degrees … cannot u… #> 7 ARM AGE conf.low CI Lower… cannot u… #> 8 ARM AGE conf.high CI Upper… cannot u… #> 9 ARM AGE method method cannot u… #> 10 ARM AGE alternative alternat… cannot u… #> 11 ARM AGE mu H0 Mean 0 cannot u… #> 12 ARM AGE paired Paired t… FALSE cannot u… #> 13 ARM AGE var.equal Equal Va… FALSE cannot u… #> 14 ARM AGE conf.level CI Confi… 0.95 cannot u… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_wilcoxtest_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"Convert Wilcoxon test ARD","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_wilcoxtest_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"","code":".format_wilcoxtest_results(by = NULL, variable, lst_tidy, paired, ...)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_wilcoxtest_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"(string) column name variable (string) variable column name lst_tidy (named list) list tidied results constructed eval_capture_conditions(), e.g. eval_capture_conditions(t.test(mtcars$mpg ~ mtcars$) |> broom::tidy()). paired logical indicating whether want paired test. ... passed stats::wilcox.test(...)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_wilcoxtest_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"ARD data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-format_wilcoxtest_results.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Wilcoxon test to ARD — .format_wilcoxtest_results","text":"","code":"# Pre-processing ADSL to have grouping factor (ARM here) with 2 levels ADSL <- cards::ADSL |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> ard_stats_wilcox_test(by = \"ARM\", variables = \"AGE\") cardx:::.format_wilcoxtest_results( by = \"ARM\", variable = \"AGE\", paired = FALSE, lst_tidy = cards::eval_capture_conditions( stats::wilcox.test(ADSL[[\"AGE\"]] ~ ADSL[[\"ARM\"]], paired = FALSE) |> broom::tidy() ) ) #> {cards} data frame: 12 x 9 #> group1 variable stat_name stat_label stat error #> 1 ARM AGE statistic X-square… cannot u… #> 2 ARM AGE p.value p-value cannot u… #> 3 ARM AGE method method cannot u… #> 4 ARM AGE alternative alternat… cannot u… #> 5 ARM AGE mu mu 0 cannot u… #> 6 ARM AGE paired Paired t… FALSE cannot u… #> 7 ARM AGE exact exact cannot u… #> 8 ARM AGE correct correct TRUE cannot u… #> 9 ARM AGE conf.int conf.int FALSE cannot u… #> 10 ARM AGE conf.level CI Confi… 0.95 cannot u… #> 11 ARM AGE tol.root tol.root 0 cannot u… #> 12 ARM AGE digits.rank digits.r… Inf cannot u… #> ℹ 3 more variables: context, fmt_fn, warning"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-paired_data_pivot_wider.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert long paired data to wide — .paired_data_pivot_wider","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"Convert long paired data wide","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-paired_data_pivot_wider.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"","code":".paired_data_pivot_wider(data, by, variable, id)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-paired_data_pivot_wider.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"data (data.frame) data frame one line per subject per group (string) column name variable (string) variable column name id (string) subject id column name","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-paired_data_pivot_wider.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"wide data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-paired_data_pivot_wider.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert long paired data to wide — .paired_data_pivot_wider","text":"","code":"cards::ADSL[c(\"ARM\", \"AGE\")] |> dplyr::filter(ARM %in% c(\"Placebo\", \"Xanomeline High Dose\")) |> dplyr::mutate(.by = ARM, USUBJID = dplyr::row_number()) |> dplyr::arrange(USUBJID, ARM) |> cardx:::.paired_data_pivot_wider(by = \"ARM\", variable = \"AGE\", id = \"USUBJID\") #> # A tibble: 86 × 3 #> USUBJID by1 by2 #> #> 1 1 63 71 #> 2 2 64 77 #> 3 3 85 81 #> 4 4 52 75 #> 5 5 84 57 #> 6 6 79 56 #> 7 7 81 79 #> 8 8 69 56 #> 9 9 63 61 #> 10 10 81 56 #> # ℹ 76 more rows"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_nested_list_as_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Nested Lists to Column — .process_nested_list_as_df","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"arguments, stat_label, passed nested lists. function properly unnests lists adds results data frame.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_nested_list_as_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"","code":".process_nested_list_as_df(x, arg, new_column, unlist = FALSE)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_nested_list_as_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"x (data.frame) result data frame arg (list) nested list new_column (string) new column name unlist (logical) whether fully unlist final results","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_nested_list_as_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"data frame","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_nested_list_as_df.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert Nested Lists to Column — .process_nested_list_as_df","text":"","code":"ard <- ard_categorical(cards::ADSL, by = \"ARM\", variables = \"AGEGR1\") cardx:::.process_nested_list_as_df(ard, NULL, \"new_col\") #> {cards} data frame: 27 x 12 #> group1 group1_level variable variable_level stat_name stat_label stat #> 1 ARM Placebo AGEGR1 65-80 n n 42 #> 2 ARM Placebo AGEGR1 65-80 N N 86 #> 3 ARM Placebo AGEGR1 65-80 p % 0.488 #> 4 ARM Xanomeli… AGEGR1 65-80 n n 55 #> 5 ARM Xanomeli… AGEGR1 65-80 N N 84 #> 6 ARM Xanomeli… AGEGR1 65-80 p % 0.655 #> 7 ARM Xanomeli… AGEGR1 65-80 n n 47 #> 8 ARM Xanomeli… AGEGR1 65-80 N N 84 #> 9 ARM Xanomeli… AGEGR1 65-80 p % 0.56 #> 10 ARM Placebo AGEGR1 <65 n n 14 #> ℹ 17 more rows #> ℹ Use `print(n = ...)` to see more rows #> ℹ 5 more variables: context, fmt_fn, warning, error, new_col"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_probs.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"Process Survival Fit Quantile Estimates","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_probs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"","code":".process_survfit_probs(x, probs)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_probs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"x (survfit data.frame) object class survfit created survival::survfit() data frame. See details. probs (numeric) vector probabilities values (0,1) specifying survival quantiles return.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_probs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"tibble","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_probs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process Survival Fit For Quantile Estimates — .process_survfit_probs","text":"","code":"survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE) |> cardx:::.process_survfit_probs(probs = c(0.25, 0.75)) #> # A tibble: 6 × 6 #> strata estimate conf.low conf.high prob context #> #> 1 TRTA=Placebo 142 70 181 0.25 survival_survfit #> 2 TRTA=Xanomeline High Dose 44 22 180 0.25 survival_survfit #> 3 TRTA=Xanomeline Low Dose 49 37 180 0.25 survival_survfit #> 4 TRTA=Placebo 184 183 191 0.75 survival_survfit #> 5 TRTA=Xanomeline High Dose 188 167 NA 0.75 survival_survfit #> 6 TRTA=Xanomeline Low Dose 184 180 NA 0.75 survival_survfit"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Process Survival Fit For Time Estimates — .process_survfit_time","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"Process Survival Fit Time Estimates","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"","code":".process_survfit_time(x, times, type, start.time = NULL)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"x (survfit data.frame) object class survfit created survival::survfit() data frame. See details. times (numeric) vector times return survival probabilities. type (string NULL) type statistic report. Available Kaplan-Meier time estimates , otherwise type ignored. Default NULL. Must one following: start.time (numeric) default starting time. See survival::survfit0() details.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_time.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"tibble","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-process_survfit_time.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Process Survival Fit For Time Estimates — .process_survfit_time","text":"","code":"survival::survfit(survival::Surv(AVAL, CNSR) ~ TRTA, cards::ADTTE) |> cardx:::.process_survfit_time(times = c(60, 180), type = \"risk\") #> # A tibble: 6 × 8 #> time n.risk estimate std.error strata conf.high conf.low context #> #> 1 60 59 0.107 0.0360 TRTA=Placebo 0.175 0.0338 risk #> 2 60 14 0.306 0.0712 TRTA=Xanomeline Hi… 0.432 0.151 risk #> 3 60 20 0.268 0.0680 TRTA=Xanomeline Lo… 0.390 0.122 risk #> 4 180 35 0.349 0.0615 TRTA=Placebo 0.459 0.217 risk #> 5 180 3 0.738 0.140 TRTA=Xanomeline Hi… 0.908 0.251 risk #> 6 180 5 0.619 0.130 TRTA=Xanomeline Lo… 0.805 0.257 risk"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-strata_normal_quantile.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"function wraps estimation stratified percentiles assume approximation large numbers. necessary case proportions strata unequal.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-strata_normal_quantile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"","code":".strata_normal_quantile(vars, weights, conf.level)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-strata_normal_quantile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"weights (numeric NULL) weights level strata. NULL, estimated using iterative algorithm minimizes weighted squared length confidence interval. conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-strata_normal_quantile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"Stratified quantile.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-strata_normal_quantile.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper Function for the Estimation of Stratified Quantiles — .strata_normal_quantile","text":"","code":"strata_data <- table(data.frame( \"f1\" = sample(c(TRUE, FALSE), 100, TRUE), \"f2\" = sample(c(\"x\", \"y\", \"z\"), 100, TRUE), stringsAsFactors = TRUE )) ns <- colSums(strata_data) ests <- strata_data[\"TRUE\", ] / ns vars <- ests * (1 - ests) / ns weights <- rep(1 / length(ns), length(ns)) cardx:::.strata_normal_quantile(vars, weights, 0.95) #> [1] 1.134584"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-unique_and_sorted.html","id":null,"dir":"Reference","previous_headings":"","what":"ARD-flavor of unique() — .unique_and_sorted","title":"ARD-flavor of unique() — .unique_and_sorted","text":"Essentially wrapper unique(x) |> sort() NA levels removed. factors, levels returned even unobserved. Similarly, logical vectors always return c(TRUE, FALSE), even levels observed.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-unique_and_sorted.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ARD-flavor of unique() — .unique_and_sorted","text":"","code":".unique_and_sorted(x, useNA = c(\"no\", \"always\"))"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-unique_and_sorted.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ARD-flavor of unique() — .unique_and_sorted","text":"x () vector","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-unique_and_sorted.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ARD-flavor of unique() — .unique_and_sorted","text":"vector","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-unique_and_sorted.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ARD-flavor of unique() — .unique_and_sorted","text":"","code":"cards:::.unique_and_sorted(factor(letters[c(5, 5:1)], levels = letters)) #> [1] a b c d e f g h i j k l m n o p q r s t u v w x y z #> Levels: a b c d e f g h i j k l m n o p q r s t u v w x y z cards:::.unique_and_sorted(c(FALSE, TRUE, TRUE, FALSE)) #> [1] TRUE FALSE cards:::.unique_and_sorted(c(5, 5:1)) #> [1] 1 2 3 4 5"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-update_weights_strat_wilson.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"function wraps iteration procedure allows estimate weights proportional strata. assumes minimize weighted squared length confidence interval.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-update_weights_strat_wilson.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"","code":".update_weights_strat_wilson( vars, strata_qnorm, initial_weights, n_per_strata, max.iterations = 50, conf.level = 0.95, tol = 0.001 )"},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-update_weights_strat_wilson.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"vars (numeric) normalized proportions strata. strata_qnorm (numeric) initial estimation identical weights quantiles. initial_weights (numeric) initial weights used calculate strata_qnorm. can optimized future need estimate better initial weights. n_per_strata (numeric) number elements strata. max.iterations (count) maximum number iterations tried. Convergence always checked. conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95 tol (number) tolerance threshold convergence.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-update_weights_strat_wilson.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"list 3 elements: n_it, weights, diff_v.","code":""},{"path":[]},{"path":"https://insightsengineering.github.io/cardx/main/reference/dot-update_weights_strat_wilson.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Helper Function for the Estimation of Weights for proportion_ci_strat_wilson() — .update_weights_strat_wilson","text":"","code":"vs <- c(0.011, 0.013, 0.012, 0.014, 0.017, 0.018) sq <- 0.674 ws <- rep(1 / length(vs), length(vs)) ns <- c(22, 18, 17, 17, 14, 12) cardx:::.update_weights_strat_wilson(vs, sq, ws, ns, 100, 0.95, 0.001) #> $n_it #> [1] 3 #> #> $weights #> [1] 0.2067191 0.1757727 0.1896962 0.1636346 0.1357615 0.1284160 #> #> $diff_v #> [1] 1.458717e-01 1.497223e-03 1.442189e-06 #>"},{"path":"https://insightsengineering.github.io/cardx/main/reference/proportion_ci.html","id":null,"dir":"Reference","previous_headings":"","what":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"Functions calculate different proportion confidence intervals use ard_proportion().","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/proportion_ci.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"","code":"proportion_ci_wald(x, conf.level = 0.95, correct = FALSE) proportion_ci_wilson(x, conf.level = 0.95, correct = FALSE) proportion_ci_clopper_pearson(x, conf.level = 0.95) proportion_ci_agresti_coull(x, conf.level = 0.95) proportion_ci_jeffreys(x, conf.level = 0.95) proportion_ci_strat_wilson( x, strata, weights = NULL, conf.level = 0.95, max.iterations = 10L, correct = FALSE ) is_binary(x)"},{"path":"https://insightsengineering.github.io/cardx/main/reference/proportion_ci.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"x vector binary values, .e. logical vector, numeric values c(0, 1) conf.level (numeric) scalar (0, 1) indicating confidence level. Default 0.95 correct (flag) include continuity correction. information, see example stats::prop.test(). strata (factor) variable one level per stratum length x. weights (numeric NULL) weights level strata. NULL, estimated using iterative algorithm minimizes weighted squared length confidence interval. max.iterations (count) maximum number iterations iterative procedure used find estimates optimal weights.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/proportion_ci.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"Confidence interval proportion.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/proportion_ci.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"proportion_ci_wald(): Calculates Wald interval following usual textbook definition single proportion confidence interval using normal approximation. $$\\hat{p} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\hat{p}(1 - \\hat{p})}{n}}$$ proportion_ci_wilson(): Calculates Wilson interval calling stats::prop.test(). Also referred Wilson score interval. $$\\frac{\\hat{p} + \\frac{z^2_{\\alpha/2}}{2n} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\hat{p}(1 - \\hat{p})}{n} + \\frac{z^2_{\\alpha/2}}{4n^2}}}{1 + \\frac{z^2_{\\alpha/2}}{n}}$$ proportion_ci_clopper_pearson(): Calculates Clopper-Pearson interval calling stats::binom.test(). Also referred exact method. $$ \\left( \\frac{k}{n} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\frac{k}{n}(1-\\frac{k}{n})}{n} + \\frac{z^2_{\\alpha/2}}{4n^2}} \\right) / \\left( 1 + \\frac{z^2_{\\alpha/2}}{n} \\right)$$ proportion_ci_agresti_coull(): Calculates Agresti-Coull interval (created Alan Agresti Brent Coull) (95% CI) adding two successes two failures data using Wald formula construct CI. $$ \\left( \\frac{\\tilde{p} + z^2_{\\alpha/2}/2}{n + z^2_{\\alpha/2}} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\tilde{p}(1 - \\tilde{p})}{n} + \\frac{z^2_{\\alpha/2}}{4n^2}} \\right)$$ proportion_ci_jeffreys(): Calculates Jeffreys interval, equal-tailed interval based non-informative Jeffreys prior binomial proportion. $$\\left( \\text{Beta}\\left(\\frac{k}{2} + \\frac{1}{2}, \\frac{n - k}{2} + \\frac{1}{2}\\right)_\\alpha, \\text{Beta}\\left(\\frac{k}{2} + \\frac{1}{2}, \\frac{n - k}{2} + \\frac{1}{2}\\right)_{1-\\alpha} \\right)$$ proportion_ci_strat_wilson(): Calculates stratified Wilson confidence interval unequal proportions described Xin YA, Su XG. Stratified Wilson Newcombe confidence intervals multiple binomial proportions. Statistics Biopharmaceutical Research. 2010;2(3). $$\\frac{\\hat{p}_j + \\frac{z^2_{\\alpha/2}}{2n_j} \\pm z_{\\alpha/2} \\sqrt{\\frac{\\hat{p}_j(1 - \\hat{p}_j)}{n_j} + \\frac{z^2_{\\alpha/2}}{4n_j^2}}}{1 + \\frac{z^2_{\\alpha/2}}{n_j}}$$ is_binary(): Helper determine vector binary (logical 0/1)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/reference/proportion_ci.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Functions for Calculating Proportion Confidence Intervals — proportion_ci","text":"","code":"x <- c( TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE ) proportion_ci_wald(x, conf.level = 0.9) #> $N #> [1] 10 #> #> $estimate #> [1] 0.5 #> #> $conf.low #> [1] 0.2399258 #> #> $conf.high #> [1] 0.7600742 #> #> $conf.level #> [1] 0.9 #> #> $method #> Wald Confidence Interval without continuity correction #> proportion_ci_wilson(x, correct = TRUE) #> $N #> [1] 10 #> #> $conf.level #> [1] 0.95 #> #> $estimate #> p #> 0.5 #> #> $statistic #> X-squared #> 0 #> #> $p.value #> [1] 1 #> #> $parameter #> df #> 1 #> #> $conf.low #> [1] 0.2365931 #> #> $conf.high #> [1] 0.7634069 #> #> $method #> Wilson Confidence Interval with continuity correction #> #> $alternative #> [1] \"two.sided\" #> proportion_ci_clopper_pearson(x) #> $N #> [1] 10 #> #> $conf.level #> [1] 0.95 #> #> $estimate #> probability of success #> 0.5 #> #> $statistic #> number of successes #> 5 #> #> $p.value #> [1] 1 #> #> $parameter #> number of trials #> 10 #> #> $conf.low #> [1] 0.187086 #> #> $conf.high #> [1] 0.812914 #> #> $method #> [1] \"Clopper-Pearson Confidence Interval\" #> #> $alternative #> [1] \"two.sided\" #> proportion_ci_agresti_coull(x) #> $N #> [1] 10 #> #> $estimate #> [1] 0.5 #> #> $conf.low #> [1] 0.2365931 #> #> $conf.high #> [1] 0.7634069 #> #> $conf.level #> [1] 0.95 #> #> $method #> [1] \"Agresti-Coull Confidence Interval\" #> proportion_ci_jeffreys(x) #> $N #> [1] 10 #> #> $estimate #> [1] 0.5 #> #> $conf.low #> [1] 0.2235287 #> #> $conf.high #> [1] 0.7764713 #> #> $conf.level #> [1] 0.95 #> #> $method #> Jeffreys Interval #> # Stratified Wilson confidence interval with unequal probabilities set.seed(1) rsp <- sample(c(TRUE, FALSE), 100, TRUE) strata_data <- data.frame( \"f1\" = sample(c(\"a\", \"b\"), 100, TRUE), \"f2\" = sample(c(\"x\", \"y\", \"z\"), 100, TRUE), stringsAsFactors = TRUE ) strata <- interaction(strata_data) n_strata <- ncol(table(rsp, strata)) # Number of strata proportion_ci_strat_wilson( x = rsp, strata = strata, conf.level = 0.90 ) #> $N #> [1] 100 #> #> $estimate #> [1] 0.49 #> #> $conf.low #> [1] 0.4072891 #> #> $conf.high #> [1] 0.5647887 #> #> $conf.level #> [1] 0.9 #> #> $weights #> a.x b.x a.y b.y a.z b.z #> 0.2074199 0.1776464 0.1915610 0.1604678 0.1351096 0.1277952 #> #> $method #> Stratified Wilson Confidence Interval without continuity correction #> # Not automatic setting of weights proportion_ci_strat_wilson( x = rsp, strata = strata, weights = rep(1 / n_strata, n_strata), conf.level = 0.90 ) #> $N #> [1] 100 #> #> $estimate #> [1] 0.49 #> #> $conf.low #> [1] 0.4190436 #> #> $conf.high #> [1] 0.5789733 #> #> $conf.level #> [1] 0.9 #> #> $method #> Stratified Wilson Confidence Interval without continuity correction #>"},{"path":"https://insightsengineering.github.io/cardx/main/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. cards ard_attributes, ard_categorical, ard_continuous, ard_dichotomous, ard_missing, ard_total_n dplyr %>%, all_of, any_of, contains, ends_with, everything, last_col, matches, num_range, one_of, starts_with, ","code":""},{"path":"https://insightsengineering.github.io/cardx/main/news/index.html","id":"cardx-0219012","dir":"Changelog","previous_headings":"","what":"cardx 0.2.1.9012","title":"cardx 0.2.1.9012","text":"Added data.frame method ard_survival_survfit(). Added warning incorrect formula type ard_survival_survfit(). (#223) Implemented summary(extend=TRUE) ard_survival_survfit() return results time points bounds. (#224) Methods {survey} {survival} packages retain inputs variables types outputs. now able retain variable types ARDs returned ard_continuous.survey.design(), ard_categorical.survey.design(), ard_continuous_ci.survey.design(), ard_categorical_ci.survey.design(), ard_survival_survfit.data.frame() (notably, ard_survival_survfit.survfit()).","code":""},{"path":"https://insightsengineering.github.io/cardx/main/news/index.html","id":"cardx-021","dir":"Changelog","previous_headings":"","what":"cardx 0.2.1","title":"cardx 0.2.1","text":"CRAN release: 2024-09-03","code":""},{"path":"https://insightsengineering.github.io/cardx/main/news/index.html","id":"new-features-and-updates-0-2-1","dir":"Changelog","previous_headings":"","what":"New Features and Updates","title":"cardx 0.2.1","text":"Added S3 method ard_total_n.survey.design() returns ARD survey-weighted unweighted total sample size. Added warning error columns ard_regression() output. (#148) Implemented cards::as_card() needed package convert data frames class ‘card’. (#200)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/news/index.html","id":"bug-fixes-0-2-1","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"cardx 0.2.1","text":"Bug fix ard_categorical.survey.design() unweighted statistics returned, even case explicitly requested.","code":""},{"path":"https://insightsengineering.github.io/cardx/main/news/index.html","id":"lifecycle-changes-0-2-1","dir":"Changelog","previous_headings":"","what":"Lifecycle Changes","title":"cardx 0.2.1","text":"bt(pattern), reformulate2(pattern_term), reformulate2(pattern_response) arguments deprecated now ignored. now use make.names() determine whether column name needs wrapped backticks. (#192)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/news/index.html","id":"cardx-020","dir":"Changelog","previous_headings":"","what":"cardx 0.2.0","title":"cardx 0.2.0","text":"CRAN release: 2024-07-20","code":""},{"path":"https://insightsengineering.github.io/cardx/main/news/index.html","id":"breaking-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Breaking Changes","title":"cardx 0.2.0","text":"Updated function names follow pattern ard__(). change immediate: previous functions names deprecated. (#106)","code":"ard_ttest() -> ard_stats_t_test() ard_paired_ttest() -> ard_stats_paired_t_test() ard_wilcoxtest() -> ard_stats_wilcox_test() ard_paired_wilcoxtest() -> ard_stats_paired_wilcox_test() ard_chisqtest() -> ard_stats_chisq_test() ard_fishertest() -> ard_stats_fisher_test() ard_kruskaltest() -> ard_stats_kruskal_test() ard_mcnemartest() -> ard_stats_mcnemar_test() ard_moodtest() -> ard_stats_mood_test()"},{"path":"https://insightsengineering.github.io/cardx/main/news/index.html","id":"new-features-0-2-0","dir":"Changelog","previous_headings":"","what":"New Features","title":"cardx 0.2.0","text":"ard_categorical_ci(value) argument added. Previously, binary variables (0/1 TRUE/FALSE) summarized. value supplied, level variable summarized independently. default, binary variables 1/TRUE level summarized. Added following functions calculating Analysis Results Datasets (ARDs). ard_stats_aov() calculating ANOVA results using stats::aov(). (#3) ard_stats_anova() calculating ANOVA results using stats::anova(). (#12) ard_stats_mcnemar_test_long() McNemar’s test long data using stats::mcnemar.test(). ard_stats_prop_test() tests proportions using stats::prop.test(). (#64) ard_stats_t_test_onesample() calculating one-sample results. ard_stats_wilcox_test_onesample() calculating one-sample results. ard_stats_oneway_test() calculating ANOVA results using stats::oneway.test(). (#3) ard_aod_wald_test() calculating Wald Tests regression models using aod::wald.test(). (#84) ard_car_anova() calculating ANOVA results using car::Anova(). (#3) ard_car_vif() calculating variance inflation factor using car::vif(). (#10) ard_effectsize_cohens_d(), ard_effectsize_paired_cohens_d(), ard_effectsize_hedges_g(), ard_effectsize_paired_hedges_g() standardized differences using effectsize::cohens_d() effectsize::hedges_g(). (#50) ard_emmeans_mean_difference() calculating least-squares mean differences using {emmeans} package. (#34) ard_smd_smd() calculating standardized mean differences using smd::smd(). (#4) ard_survival_survfit() survival analyses using survival::survfit(). (#43) ard_continuous.survey.design() calculating univariate summary statistics weighted/survey data using many functions {survey} package. (#68) ard_categorical.survey.design() tabulating summary statistics weighted/survey data using many functions {survey} package. (#140) ard_dichotomous.survey.design() tabulating dichotomous summary statistics weighted/survey data using many functions {survey} package. (#2) ard_missing.survey.design() tabulating missing summary statistics weighted/survey data using many functions {survey} package. (#2) ard_attributes.survey.design() summarizing labels attributes weighted/survey data using many functions {survey} package. ard_survey_svychisq() weighted/survey chi-squared test using survey::svychisq(). (#72) ard_survey_svyttest() weighted/survey t-tests using survey::svyttest(). (#70) ard_survey_svyranktest() weighted/survey rank tests using survey::svyranktest(). (#71) ard_survival_survdiff() creating results survival::survdiff(). (#113) ard_regression_basic() basic regression models. function focuses matching model terms underlying variables names. (#46) Updated functions ard_stats_t_test(), ard_stats_paired_t_test(), ard_stats_wilcox_test(), ard_stats_paired_wilcox_test(), ard_stats_chisq_test(), ard_stats_fisher_test(), ard_stats_kruskal_test(), ard_stats_mcnemar_test(), ard_stats_mood_test() accept multiple variables . Independent tests calculated variable. variable argument renamed variables. (#77) Updated ard_stats_t_test() ard_stats_wilcox_test() longer require argument, yields central estimates confidence intervals. (#82) Added model construction helpers, construct_model(), reformulate2(), bt(), bt_strip(). Imported cli call environment functions https://github.com/ddsjoberg/standalone/blob/main/R/standalone-cli_call_env.R implemented set_cli_abort_call user-facing functions. (#111)","code":""},{"path":"https://insightsengineering.github.io/cardx/main/news/index.html","id":"cardx-010","dir":"Changelog","previous_headings":"","what":"cardx 0.1.0","title":"cardx 0.1.0","text":"CRAN release: 2024-03-18 Initial release.","code":""}] diff --git a/pkgdown.yml b/pkgdown.yml index 2519491b..46598011 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: '3.4' pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2024-11-05T15:40Z +last_built: 2024-11-27T16:05Z urls: reference: https://insightsengineering.github.io/cardx/main/reference article: https://insightsengineering.github.io/cardx/main/articles