runes: Reading Runes and Terms

runesR Documentation

Reading Runes and Terms

Description

[Experimental]

Usage

rx(x = unspecified(), ...)

## S3 method for class 'character'
rx(
  x,
  side = character(),
  role = character(),
  tier = character(),
  label = character(),
  description = character(),
  distribution = character(),
  operation = character(),
  type = character(),
  subtype = character(),
  ...
)

## S3 method for class 'formula'
rx(
  x,
  role = list(),
  tier = list(),
  label = list(),
  description = list(),
  distribution = list(),
  type = list(),
  subtype = list(),
  ...
)

## S3 method for class 'lm'
rx(
  x,
  role = list(),
  tier = list(),
  label = list(),
  description = list(),
  distribution = list(),
  type = list(),
  subtype = list(),
  ...
)

## S3 method for class 'glm'
rx(
  x,
  role = list(),
  tier = list(),
  label = list(),
  description = list(),
  distribution = list(),
  type = list(),
  subtype = list(),
  ...
)

## S3 method for class 'coxph'
rx(
  x,
  role = list(),
  tier = list(),
  label = list(),
  description = list(),
  distribution = list(),
  type = list(),
  subtype = list(),
  ...
)

## S3 method for class 'model_fit'
rx(
  x,
  role = list(),
  tier = list(),
  label = list(),
  description = list(),
  distribution = list(),
  type = list(),
  subtype = list(),
  ...
)

## S3 method for class 'rune'
rx(x, ...)

## S3 method for class 'fmls'
rx(x, ...)

## S3 method for class 'spell'
rx(x, ...)

## Default S3 method:
rx(x = unspecified(), ...)

distill_rune(x = unspecified(), ...)

Arguments

x

An object of the following types that can be coerced to a rune object. If it is an object that contains multiple terms, such as formula, the parameters are pluralized and should be contained via a list of formulas. See details for further explanation.

  • character

  • formula

  • lm

  • glm

side

states the side of the formula the variable belongs on:

  • left: for variables that are intended to be dependent

  • right: for variables that are intended to be independent

  • meta: for variables that are intended to explain relationships

  • unknown: for variables that have unknown or undetermined sides, such as unknown position between other variables (e.g. potential mediators, conditioning variables, etc)

role

Specific roles the variable plays within the formula. These are of particular importance, as they serve as special terms that can effect how a formula is interpreted. Please see the Roles section below for further details. The options for roles are as below:

  • outcome: outcome/dependent variable that serves as an individual variable in the exposure -> outcome relationship (DEFAULT for LHS variables)

  • predictor: predictors of the outcomes (DEFAULT for RHS variables)

  • exposure: predictor variable that serves as a primary or key variable in the exposure -> outcome relationship

  • confounder: predictor variable that is thought to be a confounder of the causal relationship in the exposure <- confounder -> outcome pathway, normally thought of as an adjustment or controlling variable

  • mediator: predictor variable that is thought to be a causal intermediary in the exposure -> mediator -> outcome pathway

  • interaction: predictor variable that is proposed as an interaction term with a exposure variable, and currently only supported if exposure variables are declared

  • unknown: default role of a variable that has not yet been assigned a place, such as a potential intermediary object

tier

Grouping variable names for covariates or confounders for modeling terms together

label

Display-quality label describing the variable

description

Option for further descriptions or definitions needed for the rune, potentially part of a data dictionary

distribution

If its associated with a data vector, describes the distribution pattern of the original rune

operation

Modification of the term to be applied when combining with data

type

Type of variable, either categorical (qualitative) or continuous (quantitative)

subtype

How the variable itself is more specifically subcategorized, e.g. ordinal, continuous, dichotomous, etc

class

Class of the variable itself, either expected or measured, such as character or numeric or factor

Pluralized Arguments

For the arguments that would be dispatched for objects that are plural, e.g. containing multiple terms such as a formula object, the input should be wrapped within a list().

For example, for the role argument, it would be written:

role = list(X ~ "exposure", M ~ "mediator", C ~ "confounder")

This applies for all others plural objects and arguments.

Roles

Specific roles the variable plays within the formula. These are of particular importance, as they serve as special runes that can effect how a formula is interpreted. The specialized options for roles are as below:

  • exposure or X(...)

  • outcome or O(...) or placement of variable on LHS of formula

  • confounder or C(...)

  • mediator or M(...)

  • strata or S(...)

  • interaction or In()

Formulas can be condensed by applying their specific role to individual runes as a function/wrapper. For example, y ~ X(x1) + x2 + x3. This would signify that x1 has the specific role of an exposure.


asshah4/axe documentation built on Nov. 9, 2022, 12:45 a.m.