Skip to content

Commit

Permalink
Merge pull request #279 from istallworthy/debugging
Browse files Browse the repository at this point in the history
Debugging
  • Loading branch information
istallworthy authored Oct 10, 2024
2 parents 0fab4db + e8cadbd commit f216515
Show file tree
Hide file tree
Showing 27 changed files with 948 additions and 791 deletions.
26 changes: 14 additions & 12 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ More specifically, scientists, clinicians, educators, and policymakers alike are
However, for many, conceptual, methodological, and practical barriers have prevented the use of methods for causal inference developed in other fields.
<br>

The goal of this *devMSMs* package and accompanying tutorial paper, *Investigating Causal Questions in Human Development Using Marginal Structural Models: A Tutorial Introduction to the devMSMs Package in R* (*insert preprint link here*), is to provide a set of tools for implementing marginal structural models (**MSMs**; Robins et al., 2000).
The goal of this *devMSMs* package and accompanying tutorial paper, *Investigating Causal Questions in Human Development Using Marginal Structural Models: A Tutorial Introduction to the devMSMs Package in R* (<a href="https://osf.io/preprints/psyarxiv/284mb">preprint</a>), is to provide a set of tools for implementing marginal structural models (**MSMs**; Robins et al., 2000).

MSMs orginated in epidemiology and public health and represent one under-utilized tool for improving causal inference with longitudinal observational data, given certain assumptions.
In brief, MSMs leverage inverse-probability-of-treatment-weights (IPTW) and the potential outcomes framework.
Expand All @@ -50,27 +50,27 @@ Exposures could also reflect factors internal to the child, including neurodevel

Core features of *devMSMs* include:

- flexible functions with built-in user guidance, drawing on established expertise and best practices for implementing longitudinal IPTW weighting and outcome modeling, to answer substantive causal questions about dose and timing
- Flexible functions with built-in user guidance, drawing on established expertise and best practices for implementing longitudinal IPTW weighting and outcome modeling, to answer substantive causal questions about dose and timing

- functions that accept complete or imputed data to accommodate missingness often found in human studies
- Functions that accept complete or imputed data to accommodate missingness often found in human studies

- a novel recommended workflow, based on expertise from several disciplines, for using the *devMSMs* functions with longitudinal data (see *Workflows* vignettes)
- A novel recommended workflow, based on expertise from several disciplines, for using the *devMSMs* functions with longitudinal data (see *Workflows* vignettes)

- an accompanying simulated longitudinal dataset, based on the real-world, Family Life Project (FLP) study of human development, for getting to know the package functions
- An accompanying simulated longitudinal dataset, based on the real-world, Family Life Project (FLP) study of human development, for getting to know the package functions

- an accompanying suite of <a href="https://github.com/istallworthy/devMSMsHelpers">helper functions</a> to assist users in preparing and inspecting their data prior to the implementation of *devMSMs*
- An accompanying suite of <a href="https://github.com/istallworthy/devMSMsHelpers">helper functions</a> to assist users in preparing and inspecting their data prior to the implementation of *devMSMs*

- executable, step-by-step user guidance for implementing the *devMSMs* workflow and preliminary steps in the form of vignettes geared toward users of all levels of R programming experience, along with a <a href="https://github.com/istallworthy/devMSMs/blob/main/ExampleWorkflow.Rmd">R markdown template file</a>
- Executable, step-by-step user guidance for implementing the *devMSMs* workflow and preliminary steps in the form of vignettes geared toward users of all levels of R programming experience, along with a <a href="https://github.com/istallworthy/devMSMs/blob/main/ExampleWorkflow.Rmd">R markdown template file</a>

- a brief conceptual introduction, example empirical application, and additional resources in the accompanying tutorial paper
- A brief conceptual introduction, example empirical application, and additional resources in the accompanying tutorial paper

<br>

## Overview

The package contains 7 core functions for implementing the two phases of the MSM process: longitudinal confounder adjustment and outcome modeling of longitudinal data with time-varying exposures.
<br>\
<img src="https://raw.githubusercontent.com/istallworthy/devMSMs/main/man/figures/devMSMs_overview.png" alt="devMSMs overview" width="900"/> <br>\
<br>
<img src="https://raw.githubusercontent.com/istallworthy/devMSMs/main/man/figures/devMSMs_overview.png" alt="devMSMs overview" width="900"/> <br>
<br>

Below is a summary of the terms used in the *devMSMs* vignettes and functions.
Expand All @@ -83,7 +83,7 @@ terms = data.frame(
Definition = c(
"Exposure or experience that constitutes the causal event of interest and is measured at at least two time points, with at least one time point occurring prior to the outcome.",
"Any developmental construct measured at least once at a final outcome time point upon which the exposure is theorized to have causal effects.",
"Time points in development when the exposure was measured, at which balancing formulas will be created.",
"Time points in development when the exposure was measured, at which weights formulas will be created.",
"*(optional)* Further delineation of exposure time points into meaningful units of developmental time, each of which could encompass multiple exposure time points, that together constitute exposure main effects in the outcome model and exposure histories.",
"Sequences of relatively high (`'h'`) or low (`'l'`) levels of exposure at each exposure time point or exposure epoch.",
"Total cumulative exposure epochs/time points during which an individual experienced high (or low) levels of exposure, across an entire exposure history.",
Expand Down Expand Up @@ -134,7 +134,9 @@ We then recommend downloading the <a href="https://github.com/istallworthy/devMS

## Citation & Bug Reports

Please cite your use *devMSMs* using the following citation: <br> Stallworthy I, Greifer N, DeJoseph M, Padrutt E, Butts K, Berry D (2024).
Please cite your use *devMSMs* using the following citation:
<br>
Stallworthy I, Greifer N, DeJoseph M, Padrutt E, Butts K, Berry D (2024).
<br>
*devMSMs*: Implementing Marginal Structural Models with Longitudinal Data.
R package version 0.0.0.9000, <https://istallworthy.github.io/devMSMs/>.
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ other fields. <br>
The goal of this *devMSMs* package and accompanying tutorial paper,
*Investigating Causal Questions in Human Development Using Marginal
Structural Models: A Tutorial Introduction to the devMSMs Package in R*
(*insert preprint link here*), is to provide a set of tools for
implementing marginal structural models (**MSMs**; Robins et al., 2000).
(<a href="https://osf.io/preprints/psyarxiv/284mb">preprint</a>), is to
provide a set of tools for implementing marginal structural models
(**MSMs**; Robins et al., 2000).

MSMs orginated in epidemiology and public health and represent one
under-utilized tool for improving causal inference with longitudinal
Expand Down Expand Up @@ -53,34 +54,34 @@ also reflect factors internal to the child, including neurodevelopmental

Core features of *devMSMs* include:

- flexible functions with built-in user guidance, drawing on established
- Flexible functions with built-in user guidance, drawing on established
expertise and best practices for implementing longitudinal IPTW
weighting and outcome modeling, to answer substantive causal questions
about dose and timing

- functions that accept complete or imputed data to accommodate
- Functions that accept complete or imputed data to accommodate
missingness often found in human studies

- a novel recommended workflow, based on expertise from several
- A novel recommended workflow, based on expertise from several
disciplines, for using the *devMSMs* functions with longitudinal data
(see *Workflows* vignettes)

- an accompanying simulated longitudinal dataset, based on the
- An accompanying simulated longitudinal dataset, based on the
real-world, Family Life Project (FLP) study of human development, for
getting to know the package functions

- an accompanying suite of
- An accompanying suite of
<a href="https://github.com/istallworthy/devMSMsHelpers">helper
functions</a> to assist users in preparing and inspecting their data
prior to the implementation of *devMSMs*

- executable, step-by-step user guidance for implementing the *devMSMs*
- Executable, step-by-step user guidance for implementing the *devMSMs*
workflow and preliminary steps in the form of vignettes geared toward
users of all levels of R programming experience, along with a
<a href="https://github.com/istallworthy/devMSMs/blob/main/ExampleWorkflow.Rmd">R
markdown template file</a>

- a brief conceptual introduction, example empirical application, and
- A brief conceptual introduction, example empirical application, and
additional resources in the accompanying tutorial paper

<br>
Expand All @@ -89,10 +90,9 @@ Core features of *devMSMs* include:

The package contains 7 core functions for implementing the two phases of
the MSM process: longitudinal confounder adjustment and outcome modeling
of longitudinal data with time-varying exposures. <br>
of longitudinal data with time-varying exposures. <br>
<img src="https://raw.githubusercontent.com/istallworthy/devMSMs/main/man/figures/devMSMs_overview.png" alt="devMSMs overview" width="900"/>
<br>
<br>
<br> <br>

Below is a summary of the terms used in the *devMSMs* vignettes and
functions. More details and examples can be found in the accompanying
Expand All @@ -102,7 +102,7 @@ manuscript. <br>
|-------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Exposure** | Exposure or experience that constitutes the causal event of interest and is measured at at least two time points, with at least one time point occurring prior to the outcome. |
| **Outcome** | Any developmental construct measured at least once at a final outcome time point upon which the exposure is theorized to have causal effects. |
| **Exposure Time Points** | Time points in development when the exposure was measured, at which balancing formulas will be created. |
| **Exposure Time Points** | Time points in development when the exposure was measured, at which weights formulas will be created. |
| **Exposure Epochs** | *(optional)* Further delineation of exposure time points into meaningful units of developmental time, each of which could encompass multiple exposure time points, that together constitute exposure main effects in the outcome model and exposure histories. |
| **Exposure Histories** | Sequences of relatively high (`'h'`) or low (`'l'`) levels of exposure at each exposure time point or exposure epoch. |
| **Exposure Dosage** | Total cumulative exposure epochs/time points during which an individual experienced high (or low) levels of exposure, across an entire exposure history. |
Expand Down Expand Up @@ -160,8 +160,8 @@ exposures) for implementing the steps below.

## Citation & Bug Reports

Please cite your use *devMSMs* using the following citation: <br>
Stallworthy I, Greifer N, DeJoseph M, Padrutt E, Butts K, Berry D
Please cite your use *devMSMs* using the following citation:
<br> Stallworthy I, Greifer N, DeJoseph M, Padrutt E, Butts K, Berry D
(2024). <br> *devMSMs*: Implementing Marginal Structural Models with
Longitudinal Data. R package version 0.0.0.9000,
<https://istallworthy.github.io/devMSMs/>.
Expand Down
40 changes: 20 additions & 20 deletions articles/Data_Requirements.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f216515

Please sign in to comment.