From d87f883797dd5fa4f49902f2911982e1c4c2bc14 Mon Sep 17 00:00:00 2001 From: istallworthy <31548151+istallworthy@users.noreply.github.com> Date: Tue, 8 Oct 2024 15:24:30 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Deploying=20to=20debugging=20from=20@=20ist?= =?UTF-8?q?allworthy/devMSMs@7dd38a673d827ce2a2bf0b0ae4428284fd149e43=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/Assessing_Balance_Tv.html | 20 +- articles/Customize_Balancing_Formulas.html | 354 ++++++++++++++++++ .../libs/quarto-html/light-border.css | 1 + .../libs/quarto-html/popper.min.js | 6 + .../libs/quarto-html/tippy.css | 1 + .../libs/quarto-html/tippy.umd.min.js | 2 + articles/index.html | 2 + pkgdown.yml | 3 +- search.json | 2 +- sitemap.xml | 1 + 10 files changed, 372 insertions(+), 20 deletions(-) create mode 100644 articles/Customize_Balancing_Formulas.html create mode 100644 articles/Customize_Balancing_Formulas_files/libs/quarto-html/light-border.css create mode 100644 articles/Customize_Balancing_Formulas_files/libs/quarto-html/popper.min.js create mode 100644 articles/Customize_Balancing_Formulas_files/libs/quarto-html/tippy.css create mode 100644 articles/Customize_Balancing_Formulas_files/libs/quarto-html/tippy.umd.min.js diff --git a/articles/Assessing_Balance_Tv.html b/articles/Assessing_Balance_Tv.html index f2813253..e62b12d5 100644 --- a/articles/Assessing_Balance_Tv.html +++ b/articles/Assessing_Balance_Tv.html @@ -67,23 +67,7 @@

Assessing Balance for Time-Varying Exposures

-

testing

-
-
-1+1 
-
-
[1] 2
-
-
-plot(1:5, 1:5)
-
-
-

-
-
-
-
-

Assessing balance for time-varying exposures is a topic that has not been extensively examined in the MSM literature. However, Jackson (2016) has established guidance that we draw on for this package, implemented in the calcBalStats() function (drawn on by the assessBalance() function) in devMSMs.

+

Assessing balance for time-varying exposures is a topic that has not been extensively examined in the MSM literature. However, Jackson (2016) has established guidance that we draw on for this package, implemented in the calcBalStats() function (drawn on by the assessBalance() function) in devMSMs.

Calculating Raw Balance Statistics

calcBalStats() assesses balance using correlations between confounder and exposure for continuous exposures and standardized mean differences of the confounder between exposure groups for binary exposures. These balancing statistics are created based on the diagnostics for confounding of time-varying exposures outlined by Jackson (2016). More specifically, at each user-specified exposure time point, raw balance statistics are calculated to quantify the association between exposure at that time point and each confounder, for each exposure history up until that time point. This is accomplished using the col_w_cov() function to calculate covariance for continuous exposures and the col_w_smd() function to calculate mean difference for binary exposures from the cobalt package (Greifer, 2023). Factor covariates are split into separate dummy variables using the splitfactor() function from cobalt. Any covariate interactions present in the formulas are created in the data by multiplying the constituent variables, with interactions including factor covariates implemented by constituent dummy variables.

@@ -99,7 +83,7 @@

Assessing Balance for Time-Varying Exposures

If imputed data are supplied, the above process is conducted on each imputed dataset separately. The function then takes the average of the absolute values of the balance statistics across imputed datasets to account for sampling error (Pishgar et al., 2021 preprint). These averaged average balance statistics are then compared to the balance threshold(s) to summarize which covariates are balanced. Recommended specification of separate balance thresholds for relatively more and less important confounders can be found in the Workflows vignettes. The specification of balance threshold(s) should be kept consistent throughout the use of the devMSMs package.

References

-

Greifer, N. (2022). cobalt: Covariate Balance Tables and Plots (4.4.1) [Computer software]. https://CRAN.R-project.org/package=cobalt

+

Greifer, N. (2024). cobalt: Covariate Balance Tables and Plots (4.4.1) [Computer software]. https://CRAN.R-project.org/package=cobalt

Jackson, J. W. (2016). Diagnostics for Confounding of Time-varying and Other Joint Exposures. Epidemiology, 27(6), 859. https://doi.org/10.1097/EDE.0000000000000547

Pishgar, F., Greifer, N., Leyrat, C., & Stuart, E. (2021). MatchThem: Matching andWeighting after Multiple Imputation. R Journal, 13(2), 292–305. https://doi.org/10.32614/RJ-2021-073

Stuart, E. A. (2008). Developing practical recommendations for the use of propensity scores: Discussion of ‘A critical appraisal of propensity score matching in the medical literature between 1996 and 2003’ by Peter Austin, Statistics in Medicine. Statistics in Medicine, 27(12), 2062–2065. https://doi.org/10.1002/sim.3207

diff --git a/articles/Customize_Balancing_Formulas.html b/articles/Customize_Balancing_Formulas.html new file mode 100644 index 00000000..9056f321 --- /dev/null +++ b/articles/Customize_Balancing_Formulas.html @@ -0,0 +1,354 @@ + + + + + + + +Customize Weights Formulas • devMSMs + + + + + + + + + + Skip to contents + + +
+
+
+ + + + + + +

This vignette provides guidance on how to customize weights formulas for use in devMSMs. Please first review the Specify Core Inputs and any of the Workflows vignettes.

+

The code contained in this vignette is also available, integrated code from the other vignettes, in the ExampleWorkflow.rmd.

+


+

Core Inputs +

+

We specify core inputs to the devMSMs functions.

+
+
+exposure <- c("ESETA1.6", "ESETA1.15", "ESETA1.24", "ESETA1.35", "ESETA1.58")
+
+tv_conf <- c(
+  "SAAmylase.6", "SAAmylase.15", "SAAmylase.24",
+  "MDI.6", "MDI.15",
+  "RHasSO.6", "RHasSO.15", "RHasSO.24", "RHasSO.35",
+  "WndNbrhood.6", "WndNbrhood.24", "WndNbrhood.35",
+  "IBRAttn.6", "IBRAttn.15", "IBRAttn.24",
+  "B18Raw.6", "B18Raw.15", "B18Raw.24",
+  "HOMEETA1.6", "HOMEETA1.15", "HOMEETA1.24", "HOMEETA1.35", 
+  "InRatioCor.6", "InRatioCor.15", "InRatioCor.24", "InRatioCor.35",
+  "CORTB.6", "CORTB.15", "CORTB.24",
+  "EARS_TJo.24", "EARS_TJo.35",
+  "LESMnPos.24", "LESMnPos.35",
+  "LESMnNeg.24", "LESMnNeg.35",
+  "StrDif_Tot.35", 
+  "fscore.35"
+)
+
+ti_conf <- c(
+  "state", "BioDadInHH2", "PmAge2", "PmBlac2", "TcBlac2", "PmMrSt2", "PmEd2", "KFASTScr",
+  "RMomAgeU", "RHealth", "HomeOwnd", "SWghtLB", "SurpPreg", "SmokTotl", "DrnkFreq",
+  "peri_health", "caregiv_health", "gov_assist"
+)
+
+data(sim_data_wide, package = "devMSMs")
+
+obj <- devMSMs::initMSM(
+  data = sim_data_wide, 
+  exposure = exposure, 
+  tv_conf = tv_conf, 
+  ti_conf = ti_conf
+)
+
+


+

The createFormulas() function has 3 different modes: “full” (Steps 1 & 4), “short” (Step 2), and “update” (Step 3), corresponding to different steps in the Workflows vignettes, and can be customized in each mode. We suggest staying consistent with any customization throughout use of package workflow. We recommend being sure to include all measured confounders (and no mediators or colliders) for each exposure time point in the weights formulas. Please refer to the accompanying manuscript for more details.

+

Below, we illustrate the customization options for each of the three modes of the createFormuls() function using information from the package dataset as an example. These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). We take the example exposure of economic strain (ESETA1) measured at 6, 15, 24, 35, and 58 months in relation to the outcome of behavior problems (StrDif_Tot) measured at 58 months.

+


+

Customize Full Weights Formulas (Steps 1 & 4) +

+

The default use of createFormulas() with type = “full” creates weights formulas at each exposure time point. Each formula contains all time invariant confounders as well as all time-varying confounders measured at time points prior to that exposure time point. For example, for the 24-month weights formula, we would have time-varying confounders only at 6 and 15 months.

+

Time-Varying Confounders Measured Contemporaneously With Exposure Time Point +

+

However, if users wish to also include any time-varying confounders measured contemporaneously with the exposure time point (e.g., also include 24-month time-varying confounders in the 24-month weights formula), they can specify those time-varying confounders in the optional argument to initMSM(), concur_conf.

+

For example, to include 24-month maternal depression in the 24-month weights formula, we do the following:

+

We first specify confounders to retain contemporaneously when creating our MSM object.

+
+
+
+obj <- devMSMs::initMSM(
+  data = sim_data_wide, 
+  exposure = exposure, 
+  tv_conf = tv_conf, 
+  ti_conf = ti_conf,
+  concur_conf = "B18Raw.24"
+)
+
+
+
+full_formulas <- createFormulas(obj  = obj, 
+                                type = "full")
+
+print(full_formulas)
+#> USER ALERT: Please manually inspect the full balancing formula below:
+#> At time point 6, the full formula for ESETA1.6 is: 
+#> ESETA1.6 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist
+#> USER ALERT: Please manually inspect the full balancing formula below:
+#> At time point 15, the full formula for ESETA1.15 is: 
+#> ESETA1.15 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + MDI.6 + RHasSO.6 + WndNbrhood.6 + IBRAttn.6 + B18Raw.6 + HOMEETA1.6 + InRatioCor.6 + CORTB.6 + ESETA1.6
+#> USER ALERT: Please manually inspect the full balancing formula below:
+#> At time point 24, the full formula for ESETA1.24 is: 
+#> ESETA1.24 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + SAAmylase.15 + MDI.6 + MDI.15 + RHasSO.6 + RHasSO.15 + WndNbrhood.6 + IBRAttn.6 + IBRAttn.15 + B18Raw.6 + B18Raw.15 + B18Raw.24 + HOMEETA1.6 + HOMEETA1.15 + InRatioCor.6 + InRatioCor.15 + CORTB.6 + CORTB.15 + ESETA1.6 + ESETA1.15
+#> USER ALERT: Please manually inspect the full balancing formula below:
+#> At time point 35, the full formula for ESETA1.35 is: 
+#> ESETA1.35 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + SAAmylase.15 + SAAmylase.24 + MDI.6 + MDI.15 + RHasSO.6 + RHasSO.15 + RHasSO.24 + WndNbrhood.6 + WndNbrhood.24 + IBRAttn.6 + IBRAttn.15 + IBRAttn.24 + B18Raw.6 + B18Raw.15 + B18Raw.24 + HOMEETA1.6 + HOMEETA1.15 + HOMEETA1.24 + InRatioCor.6 + InRatioCor.15 + InRatioCor.24 + CORTB.6 +      CORTB.15 + CORTB.24 + EARS_TJo.24 + LESMnPos.24 + LESMnNeg.24 + ESETA1.6 + ESETA1.15 + ESETA1.24
+#> USER ALERT: Please manually inspect the full balancing formula below:
+#> At time point 58, the full formula for ESETA1.58 is: 
+#> ESETA1.58 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + SAAmylase.15 + SAAmylase.24 + MDI.6 + MDI.15 + RHasSO.6 + RHasSO.15 + RHasSO.24 + RHasSO.35 + WndNbrhood.6 + WndNbrhood.24 + WndNbrhood.35 + IBRAttn.6 + IBRAttn.15 + IBRAttn.24 + B18Raw.6 + B18Raw.15 + B18Raw.24 + HOMEETA1.6 + HOMEETA1.15 + HOMEETA1.24 + HOMEETA1.35 + InRatioCor.6 +      InRatioCor.15 + InRatioCor.24 + InRatioCor.35 + CORTB.6 + CORTB.15 + CORTB.24 + EARS_TJo.24 + EARS_TJo.35 + LESMnPos.24 + LESMnPos.35 + LESMnNeg.24 + LESMnNeg.35 + StrDif_Tot.35 + fscore.35 + ESETA1.6 + ESETA1.15 + ESETA1.24 + ESETA1.35
+
+

Now B18Raw.24 is included in the 24-month weights formula in addition to the 35-and 58-month formulas.

+

Fully Custom Formulas +

+

Alternatively, a user could completely customize the full formulas by manually creating formulas for each exposure time point using the optional custom argument.

+

To create custom formulas, the user creates a list with an entry for each exposure time point, each of which contains the weights formula for exposure at that time point. createFormulas() will conduct checks to ensure there is a formula for each time point and provides cautionary warnings for unusual variables (e.g., those measured after the exposure time point). However, the user is responsible for ensuring the validity of these formulas.

+

Of note, if the user creates a custom “full” formula, they will also have to create custom formulas when using createFormulas() to make “short” and “updated” formulas.

+

Below, we illustrate an abridged example for specifying the custom arguments for the exposure, ESETA1, at 6-, 15-, 24-, 35-, and 58-month time points.

+
+
+custom <- list(
+  ESETA1.6 ~ BioDadInHH2 + DrnkFreq + gov_assist,
+  ESETA1.15 ~ BioDadInHH2 + DrnkFreq + gov_assist,
+  ESETA1.24 ~ BioDadInHH2 + DrnkFreq + gov_assist,
+  ESETA1.35 ~ BioDadInHH2 + DrnkFreq + gov_assist,
+  ESETA1.58 ~ BioDadInHH2 + DrnkFreq + gov_assist
+)
+
+

customFormulas() then checks and retains these formulas for further use with the package.

+
+
+full_formulas <- createFormulas(obj = obj, 
+                                custom = custom)
+
+print(full_formulas)
+#> USER ALERT: Please manually inspect the slightly cleaned custom formula below:
+#> At time point 6, the custom formula for ESETA1.6 is: 
+#> ESETA1.6 ~ BioDadInHH2 + DrnkFreq + gov_assist
+#> USER ALERT: Please manually inspect the slightly cleaned custom formula below:
+#> At time point 15, the custom formula for ESETA1.15 is: 
+#> ESETA1.15 ~ BioDadInHH2 + DrnkFreq + gov_assist
+#> USER ALERT: Please manually inspect the slightly cleaned custom formula below:
+#> At time point 24, the custom formula for ESETA1.24 is: 
+#> ESETA1.24 ~ BioDadInHH2 + DrnkFreq + gov_assist
+#> USER ALERT: Please manually inspect the slightly cleaned custom formula below:
+#> At time point 35, the custom formula for ESETA1.35 is: 
+#> ESETA1.35 ~ BioDadInHH2 + DrnkFreq + gov_assist
+#> USER ALERT: Please manually inspect the slightly cleaned custom formula below:
+#> At time point 58, the custom formula for ESETA1.58 is: 
+#> ESETA1.58 ~ BioDadInHH2 + DrnkFreq + gov_assist
+
+


+

Customize Short Weights Formulas (Step 2) +

+

The default use of createFormulas() with type = “short” creates shortened weights formulas at each exposure time point. Each formula contains all time invariant confounders as well as only those time-varying confounders measured at the time point directly prior (t-1 lag) to that exposure time point. For example, for the 24-month weights formula, we would only include time-varying confounders at 15 months. Please see the Workflows vignettes and accompanying manuscript for more detail.

+

When creating short formulas, the user can specify the optional concur_conf and custom arguments detailed above. Of note, createFormulas() does not check that formulas in the custom field meet criteria for the shortened formula, and thus the user is responsible for ensuring the validity of these formulas.

+

When creating short formulas, the user can also specify an optional keep_conf argument. Users would specify this second argument with any time-varying confounders to always retain in the formulas, in lagged form, overriding the t-1 lag default. Users may wish to use this argument if they have time-varying confounders that are not highly consistent over time and have strong reasons to include them in the initial phase of selecting the optimal weighting method (see Workflows vignettes for more details). Note that unless these variables are also specified in concuf_conf, they will only be retained in lagged form.

+

For example, to always retain income in all formulas in lagged form, overriding the t-1 lag default via keep_conf.

+

As shown below, the createFormulas function now retains income at 6 months in all 15-, 24-, 35-, and 58-month formulas, overriding the t-1 lag rule for that variable. Without this specification, income at 6 months would have been omitted in formulas for exposure at 24, 35, and 58 months.

+
+
+short_formulas <- createFormulas(obj = obj, 
+                                 type = "short", 
+                                 keep_conf = c("InRatioCor.6"))
+print(short_formulas)
+#> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only:
+#> At time point 6, the short formula for ESETA1.6 is: 
+#> ESETA1.6 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist
+#> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only:
+#> At time point 15, the short formula for ESETA1.15 is: 
+#> ESETA1.15 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + MDI.6 + RHasSO.6 + WndNbrhood.6 + IBRAttn.6 + B18Raw.6 + HOMEETA1.6 + InRatioCor.6 + CORTB.6 + ESETA1.6
+#> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only:
+#> At time point 24, the short formula for ESETA1.24 is: 
+#> ESETA1.24 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.15 + MDI.15 + RHasSO.15 + IBRAttn.15 + B18Raw.15 + B18Raw.24 + HOMEETA1.15 + InRatioCor.15 + CORTB.15 + ESETA1.15 + InRatioCor.6
+#> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only:
+#> At time point 35, the short formula for ESETA1.35 is: 
+#> ESETA1.35 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.24 + RHasSO.24 + WndNbrhood.24 + IBRAttn.24 + HOMEETA1.24 + InRatioCor.24 + CORTB.24 + EARS_TJo.24 + LESMnPos.24 + LESMnNeg.24 + ESETA1.24 + InRatioCor.6
+#> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only:
+#> At time point 58, the short formula for ESETA1.58 is: 
+#> ESETA1.58 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + RHasSO.35 + WndNbrhood.35 + HOMEETA1.35 + InRatioCor.35 + EARS_TJo.35 + LESMnPos.35 + LESMnNeg.35 + StrDif_Tot.35 + fscore.35 + ESETA1.35 + InRatioCor.6
+
+


+

Customize Updated Weights Formulas (Step 3) +

+

The default use of createFormulas() with type = “update” creates updated weights formulas at each exposure time point. Each formula contains all time invariant confounders; time-varying confounders measured at the time point directly prior (t-1 lag) to that exposure time point; as well as any time-varying confounders at greater lags that were not successfully balanced using the short weights formulas.

+

When creating updated formulas, the user can specify the optional concur_conf, keep_conf, and custom arguments detailed above. Of note, createFormulas() does not check that formulas in the custom field meet criteria for the updated formula or identify any imbalanced confounders, and the user is responsible for ensuring the validity of these formulas.

+
+
+ + +
+ + + +
+
+ + + + + + + diff --git a/articles/Customize_Balancing_Formulas_files/libs/quarto-html/light-border.css b/articles/Customize_Balancing_Formulas_files/libs/quarto-html/light-border.css new file mode 100644 index 00000000..2b25c61a --- /dev/null +++ b/articles/Customize_Balancing_Formulas_files/libs/quarto-html/light-border.css @@ -0,0 +1 @@ +.tippy-box[data-theme~=light-border]{background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,8,16,.15);color:#333;box-shadow:0 4px 14px -2px rgba(0,8,16,.08)}.tippy-box[data-theme~=light-border]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light-border]>.tippy-arrow:after,.tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after{content:"";position:absolute;z-index:-1}.tippy-box[data-theme~=light-border]>.tippy-arrow:after{border-color:transparent;border-style:solid}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:after{border-top-color:rgba(0,8,16,.2);border-width:7px 7px 0;top:17px;left:1px}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow>svg{top:16px}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow:after{top:17px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff;bottom:16px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:rgba(0,8,16,.2);border-width:0 7px 7px;bottom:17px;left:1px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow>svg{bottom:16px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow:after{bottom:17px}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:after{border-left-color:rgba(0,8,16,.2);border-width:7px 0 7px 7px;left:17px;top:1px}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow>svg{left:11px}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow:after{left:12px}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff;right:16px}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:after{border-width:7px 7px 7px 0;right:17px;top:1px;border-right-color:rgba(0,8,16,.2)}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow>svg{right:11px}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow:after{right:12px}.tippy-box[data-theme~=light-border]>.tippy-svg-arrow{fill:#fff}.tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);background-size:16px 6px;width:16px;height:6px} \ No newline at end of file diff --git a/articles/Customize_Balancing_Formulas_files/libs/quarto-html/popper.min.js b/articles/Customize_Balancing_Formulas_files/libs/quarto-html/popper.min.js new file mode 100644 index 00000000..e3726d72 --- /dev/null +++ b/articles/Customize_Balancing_Formulas_files/libs/quarto-html/popper.min.js @@ -0,0 +1,6 @@ +/** + * @popperjs/core v2.11.7 - MIT License + */ + +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(f())}function p(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),f=1,p=1;o&&r(e)&&(f=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,p=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,l=!c()&&i,d=(a.left+(l&&u?u.offsetLeft:0))/f,h=(a.top+(l&&u?u.offsetTop:0))/p,m=a.width/f,v=a.height/p;return{width:m,height:v,top:h,right:d+m,bottom:h+v,left:d,x:d,y:h}}function u(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return p(d(e)).left+u(e).scrollLeft}function m(e){return t(e).getComputedStyle(e)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function y(e,n,o){void 0===o&&(o=!1);var i,a,f=r(n),c=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),m=d(n),y=p(e,c,o),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!o)&&(("body"!==l(n)||v(m))&&(g=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:u(i)),r(n)?((b=p(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):m&&(b.x=h(m))),{x:y.left+g.scrollLeft-b.x,y:y.top+g.scrollTop-b.y,width:y.width,height:y.height}}function g(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||d(e)}function x(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:x(b(e))}function w(e,n){var r;void 0===n&&(n=[]);var o=x(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(w(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function j(e){return r(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(e){for(var n=t(e),i=j(e);i&&O(i)&&"static"===m(i).position;)i=j(i);return i&&("html"===l(i)||"body"===l(i)&&"static"===m(i).position)?n:i||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===m(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var i=m(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var D="top",A="bottom",L="right",P="left",M="auto",k=[D,A,L,P],W="start",B="end",H="viewport",T="popper",R=k.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+B])}),[]),S=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+B])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function q(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e){return e.split("-")[0]}function N(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _(e,r,o){return r===H?I(function(e,n){var r=t(e),o=d(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,f=0,p=0;if(i){a=i.width,s=i.height;var u=c();(u||!u&&"fixed"===n)&&(f=i.offsetLeft,p=i.offsetTop)}return{width:a,height:s,x:f+h(e),y:p}}(e,o)):n(r)?function(e,t){var n=p(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(r,o):I(function(e){var t,n=d(e),r=u(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+h(e),c=-r.scrollTop;return"rtl"===m(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:c}}(d(e)))}function F(e,t,o,s){var f="clippingParents"===t?function(e){var t=w(b(e)),o=["absolute","fixed"].indexOf(m(e).position)>=0&&r(e)?E(e):e;return n(o)?t.filter((function(e){return n(e)&&N(e,o)&&"body"!==l(e)})):[]}(e):[].concat(t),c=[].concat(f,[o]),p=c[0],u=c.reduce((function(t,n){var r=_(e,n,s);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),_(e,p,s));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function U(e){return e.split("-")[1]}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?C(o):null,a=o?U(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case D:t={x:s,y:n.y-r.height};break;case A:t={x:s,y:n.y+n.height};break;case L:t={x:n.x+n.width,y:f};break;case P:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?z(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case W:t[c]=t[c]-(n[p]/2-r[p]/2);break;case B:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.strategy,s=void 0===a?e.strategy:a,f=r.boundary,c=void 0===f?"clippingParents":f,u=r.rootBoundary,l=void 0===u?H:u,h=r.elementContext,m=void 0===h?T:h,v=r.altBoundary,y=void 0!==v&&v,g=r.padding,b=void 0===g?0:g,x=Y("number"!=typeof b?b:G(b,k)),w=m===T?"reference":T,O=e.rects.popper,j=e.elements[y?w:m],E=F(n(j)?j:j.contextElement||d(e.elements.popper),c,l,s),P=p(e.elements.reference),M=X({reference:P,element:O,strategy:"absolute",placement:i}),W=I(Object.assign({},O,M)),B=m===T?W:P,R={top:E.top-B.top+x.top,bottom:B.bottom-E.bottom+x.bottom,left:E.left-B.left+x.left,right:B.right-E.right+x.right},S=e.modifiersData.offset;if(m===T&&S){var V=S[i];Object.keys(R).forEach((function(e){var t=[L,A].indexOf(e)>=0?1:-1,n=[D,A].indexOf(e)>=0?"y":"x";R[e]+=V[n]*t}))}return R}var K={placement:"bottom",modifiers:[],strategy:"absolute"};function Q(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[P,L].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},se={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return se[e]}))}var ce={start:"end",end:"start"};function pe(e){return e.replace(/start|end/g,(function(e){return ce[e]}))}function ue(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?S:f,p=U(r),u=p?s?R:R.filter((function(e){return U(e)===p})):k,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=J(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[C(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,y=C(v),g=f||(y===v||!h?[fe(v)]:function(e){if(C(e)===M)return[];var t=fe(e);return[pe(e),t,pe(t)]}(v)),b=[v].concat(g).reduce((function(e,n){return e.concat(C(n)===M?ue(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,j=!0,E=b[0],k=0;k=0,S=R?"width":"height",V=J(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),q=R?T?L:P:T?A:D;x[S]>w[S]&&(q=fe(q));var N=fe(q),I=[];if(i&&I.push(V[H]<=0),s&&I.push(V[q]<=0,V[N]<=0),I.every((function(e){return e}))){E=B,j=!1;break}O.set(B,I)}if(j)for(var _=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},F=h?3:1;F>0;F--){if("break"===_(F))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function de(e,t,n){return i(e,a(t,n))}var he={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,y=void 0===v?0:v,b=J(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=C(t.placement),w=U(t.placement),O=!w,j=z(x),M="x"===j?"y":"x",k=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(k){if(s){var q,N="y"===j?D:P,I="y"===j?A:L,_="y"===j?"height":"width",F=k[j],X=F+b[N],Y=F-b[I],G=m?-H[_]/2:0,K=w===W?B[_]:H[_],Q=w===W?-H[_]:-B[_],Z=t.elements.arrow,$=m&&Z?g(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[N],ne=ee[I],re=de(0,B[_],$[_]),oe=O?B[_]/2-G-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=O?-B[_]/2+G+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&E(t.elements.arrow),se=ae?"y"===j?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(q=null==S?void 0:S[j])?q:0,ce=F+ie-fe,pe=de(m?a(X,F+oe-fe-se):X,F,m?i(Y,ce):Y);k[j]=pe,V[j]=pe-F}if(c){var ue,le="x"===j?D:P,he="x"===j?A:L,me=k[M],ve="y"===M?"height":"width",ye=me+b[le],ge=me-b[he],be=-1!==[D,P].indexOf(x),xe=null!=(ue=null==S?void 0:S[M])?ue:0,we=be?ye:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ge,je=m&&be?function(e,t,n){var r=de(e,t,n);return r>n?n:r}(we,me,Oe):de(m?we:ye,me,m?Oe:ge);k[M]=je,V[M]=je-me}t.modifiersData[r]=V}},requiresIfExists:["offset"]};var me={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=C(n.placement),f=z(s),c=[P,L].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,k))}(o.padding,n),u=g(i),l="y"===f?D:P,d="y"===f?A:L,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],v=E(i),y=v?"y"===f?v.clientHeight||0:v.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],O=y/2-u[c]/2+b,j=de(x,O,w),M=f;n.modifiersData[r]=((t={})[M]=j,t.centerOffset=j-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&N(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ve(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ye(e){return[D,L,A,P].some((function(t){return e[t]>=0}))}var ge={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=J(t,{elementContext:"reference"}),s=J(t,{altBoundary:!0}),f=ve(a,r),c=ve(s,o,i),p=ye(f),u=ye(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},be=Z({defaultModifiers:[ee,te,oe,ie]}),xe=[ee,te,oe,ie,ae,le,he,me,ge],we=Z({defaultModifiers:xe});e.applyStyles=ie,e.arrow=me,e.computeStyles=oe,e.createPopper=we,e.createPopperLite=be,e.defaultModifiers=xe,e.detectOverflow=J,e.eventListeners=ee,e.flip=le,e.hide=ge,e.offset=ae,e.popperGenerator=Z,e.popperOffsets=te,e.preventOverflow=he,Object.defineProperty(e,"__esModule",{value:!0})})); + diff --git a/articles/Customize_Balancing_Formulas_files/libs/quarto-html/tippy.css b/articles/Customize_Balancing_Formulas_files/libs/quarto-html/tippy.css new file mode 100644 index 00000000..e6ae635c --- /dev/null +++ b/articles/Customize_Balancing_Formulas_files/libs/quarto-html/tippy.css @@ -0,0 +1 @@ +.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} \ No newline at end of file diff --git a/articles/Customize_Balancing_Formulas_files/libs/quarto-html/tippy.umd.min.js b/articles/Customize_Balancing_Formulas_files/libs/quarto-html/tippy.umd.min.js new file mode 100644 index 00000000..ca292be3 --- /dev/null +++ b/articles/Customize_Balancing_Formulas_files/libs/quarto-html/tippy.umd.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e=e||self).tippy=t(e.Popper)}(this,(function(e){"use strict";var t={passive:!0,capture:!0},n=function(){return document.body};function r(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function o(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function i(e,t){return"function"==typeof e?e.apply(void 0,t):e}function a(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function s(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function u(e){return[].concat(e)}function c(e,t){-1===e.indexOf(t)&&e.push(t)}function p(e){return e.split("-")[0]}function f(e){return[].slice.call(e)}function l(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function d(){return document.createElement("div")}function v(e){return["Element","Fragment"].some((function(t){return o(e,t)}))}function m(e){return o(e,"MouseEvent")}function g(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function h(e){return v(e)?[e]:function(e){return o(e,"NodeList")}(e)?f(e):Array.isArray(e)?e:f(document.querySelectorAll(e))}function b(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function y(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function w(e){var t,n=u(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function E(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function O(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var x={isTouch:!1},C=0;function T(){x.isTouch||(x.isTouch=!0,window.performance&&document.addEventListener("mousemove",A))}function A(){var e=performance.now();e-C<20&&(x.isTouch=!1,document.removeEventListener("mousemove",A)),C=e}function L(){var e=document.activeElement;if(g(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var D=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,R=Object.assign({appendTo:n,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(R);function P(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=R[o])?r:i);return t}),{});return Object.assign({},e,t)}function j(e,t){var n=Object.assign({},t,{content:i(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(P(Object.assign({},R,{plugins:t}))):k).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function M(e,t){e.innerHTML=t}function V(e){var t=d();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",v(e)?t.appendChild(e):M(t,e)),t}function I(e,t){v(t.content)?(M(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?M(e,t.content):e.textContent=t.content)}function S(e){var t=e.firstElementChild,n=f(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function N(e){var t=d(),n=d();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=d();function o(n,r){var o=S(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||I(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(V(r.arrow))):i.appendChild(V(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),I(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}N.$$tippy=!0;var B=1,H=[],U=[];function _(o,s){var v,g,h,C,T,A,L,k,M=j(o,Object.assign({},R,P(l(s)))),V=!1,I=!1,N=!1,_=!1,F=[],W=a(we,M.interactiveDebounce),X=B++,Y=(k=M.plugins).filter((function(e,t){return k.indexOf(e)===t})),$={id:X,reference:o,popper:d(),popperInstance:null,props:M,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:Y,clearDelayTimeouts:function(){clearTimeout(v),clearTimeout(g),cancelAnimationFrame(h)},setProps:function(e){if($.state.isDestroyed)return;ae("onBeforeUpdate",[$,e]),be();var t=$.props,n=j(o,Object.assign({},t,l(e),{ignoreAttributes:!0}));$.props=n,he(),t.interactiveDebounce!==n.interactiveDebounce&&(ce(),W=a(we,n.interactiveDebounce));t.triggerTarget&&!n.triggerTarget?u(t.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):n.triggerTarget&&o.removeAttribute("aria-expanded");ue(),ie(),J&&J(t,n);$.popperInstance&&(Ce(),Ae().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ae("onAfterUpdate",[$,e])},setContent:function(e){$.setProps({content:e})},show:function(){var e=$.state.isVisible,t=$.state.isDestroyed,o=!$.state.isEnabled,a=x.isTouch&&!$.props.touch,s=r($.props.duration,0,R.duration);if(e||t||o||a)return;if(te().hasAttribute("disabled"))return;if(ae("onShow",[$],!1),!1===$.props.onShow($))return;$.state.isVisible=!0,ee()&&(z.style.visibility="visible");ie(),de(),$.state.isMounted||(z.style.transition="none");if(ee()){var u=re(),p=u.box,f=u.content;b([p,f],0)}A=function(){var e;if($.state.isVisible&&!_){if(_=!0,z.offsetHeight,z.style.transition=$.props.moveTransition,ee()&&$.props.animation){var t=re(),n=t.box,r=t.content;b([n,r],s),y([n,r],"visible")}se(),ue(),c(U,$),null==(e=$.popperInstance)||e.forceUpdate(),ae("onMount",[$]),$.props.animation&&ee()&&function(e,t){me(e,t)}(s,(function(){$.state.isShown=!0,ae("onShown",[$])}))}},function(){var e,t=$.props.appendTo,r=te();e=$.props.interactive&&t===n||"parent"===t?r.parentNode:i(t,[r]);e.contains(z)||e.appendChild(z);$.state.isMounted=!0,Ce()}()},hide:function(){var e=!$.state.isVisible,t=$.state.isDestroyed,n=!$.state.isEnabled,o=r($.props.duration,1,R.duration);if(e||t||n)return;if(ae("onHide",[$],!1),!1===$.props.onHide($))return;$.state.isVisible=!1,$.state.isShown=!1,_=!1,V=!1,ee()&&(z.style.visibility="hidden");if(ce(),ve(),ie(!0),ee()){var i=re(),a=i.box,s=i.content;$.props.animation&&(b([a,s],o),y([a,s],"hidden"))}se(),ue(),$.props.animation?ee()&&function(e,t){me(e,(function(){!$.state.isVisible&&z.parentNode&&z.parentNode.contains(z)&&t()}))}(o,$.unmount):$.unmount()},hideWithInteractivity:function(e){ne().addEventListener("mousemove",W),c(H,W),W(e)},enable:function(){$.state.isEnabled=!0},disable:function(){$.hide(),$.state.isEnabled=!1},unmount:function(){$.state.isVisible&&$.hide();if(!$.state.isMounted)return;Te(),Ae().forEach((function(e){e._tippy.unmount()})),z.parentNode&&z.parentNode.removeChild(z);U=U.filter((function(e){return e!==$})),$.state.isMounted=!1,ae("onHidden",[$])},destroy:function(){if($.state.isDestroyed)return;$.clearDelayTimeouts(),$.unmount(),be(),delete o._tippy,$.state.isDestroyed=!0,ae("onDestroy",[$])}};if(!M.render)return $;var q=M.render($),z=q.popper,J=q.onUpdate;z.setAttribute("data-tippy-root",""),z.id="tippy-"+$.id,$.popper=z,o._tippy=$,z._tippy=$;var G=Y.map((function(e){return e.fn($)})),K=o.hasAttribute("aria-expanded");return he(),ue(),ie(),ae("onCreate",[$]),M.showOnCreate&&Le(),z.addEventListener("mouseenter",(function(){$.props.interactive&&$.state.isVisible&&$.clearDelayTimeouts()})),z.addEventListener("mouseleave",(function(){$.props.interactive&&$.props.trigger.indexOf("mouseenter")>=0&&ne().addEventListener("mousemove",W)})),$;function Q(){var e=$.props.touch;return Array.isArray(e)?e:[e,0]}function Z(){return"hold"===Q()[0]}function ee(){var e;return!(null==(e=$.props.render)||!e.$$tippy)}function te(){return L||o}function ne(){var e=te().parentNode;return e?w(e):document}function re(){return S(z)}function oe(e){return $.state.isMounted&&!$.state.isVisible||x.isTouch||C&&"focus"===C.type?0:r($.props.delay,e?0:1,R.delay)}function ie(e){void 0===e&&(e=!1),z.style.pointerEvents=$.props.interactive&&!e?"":"none",z.style.zIndex=""+$.props.zIndex}function ae(e,t,n){var r;(void 0===n&&(n=!0),G.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=$.props)[e].apply(r,t)}function se(){var e=$.props.aria;if(e.content){var t="aria-"+e.content,n=z.id;u($.props.triggerTarget||o).forEach((function(e){var r=e.getAttribute(t);if($.state.isVisible)e.setAttribute(t,r?r+" "+n:n);else{var o=r&&r.replace(n,"").trim();o?e.setAttribute(t,o):e.removeAttribute(t)}}))}}function ue(){!K&&$.props.aria.expanded&&u($.props.triggerTarget||o).forEach((function(e){$.props.interactive?e.setAttribute("aria-expanded",$.state.isVisible&&e===te()?"true":"false"):e.removeAttribute("aria-expanded")}))}function ce(){ne().removeEventListener("mousemove",W),H=H.filter((function(e){return e!==W}))}function pe(e){if(!x.isTouch||!N&&"mousedown"!==e.type){var t=e.composedPath&&e.composedPath()[0]||e.target;if(!$.props.interactive||!O(z,t)){if(u($.props.triggerTarget||o).some((function(e){return O(e,t)}))){if(x.isTouch)return;if($.state.isVisible&&$.props.trigger.indexOf("click")>=0)return}else ae("onClickOutside",[$,e]);!0===$.props.hideOnClick&&($.clearDelayTimeouts(),$.hide(),I=!0,setTimeout((function(){I=!1})),$.state.isMounted||ve())}}}function fe(){N=!0}function le(){N=!1}function de(){var e=ne();e.addEventListener("mousedown",pe,!0),e.addEventListener("touchend",pe,t),e.addEventListener("touchstart",le,t),e.addEventListener("touchmove",fe,t)}function ve(){var e=ne();e.removeEventListener("mousedown",pe,!0),e.removeEventListener("touchend",pe,t),e.removeEventListener("touchstart",le,t),e.removeEventListener("touchmove",fe,t)}function me(e,t){var n=re().box;function r(e){e.target===n&&(E(n,"remove",r),t())}if(0===e)return t();E(n,"remove",T),E(n,"add",r),T=r}function ge(e,t,n){void 0===n&&(n=!1),u($.props.triggerTarget||o).forEach((function(r){r.addEventListener(e,t,n),F.push({node:r,eventType:e,handler:t,options:n})}))}function he(){var e;Z()&&(ge("touchstart",ye,{passive:!0}),ge("touchend",Ee,{passive:!0})),(e=$.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(ge(e,ye),e){case"mouseenter":ge("mouseleave",Ee);break;case"focus":ge(D?"focusout":"blur",Oe);break;case"focusin":ge("focusout",Oe)}}))}function be(){F.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),F=[]}function ye(e){var t,n=!1;if($.state.isEnabled&&!xe(e)&&!I){var r="focus"===(null==(t=C)?void 0:t.type);C=e,L=e.currentTarget,ue(),!$.state.isVisible&&m(e)&&H.forEach((function(t){return t(e)})),"click"===e.type&&($.props.trigger.indexOf("mouseenter")<0||V)&&!1!==$.props.hideOnClick&&$.state.isVisible?n=!0:Le(e),"click"===e.type&&(V=!n),n&&!r&&De(e)}}function we(e){var t=e.target,n=te().contains(t)||z.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=p(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,f="right"===a?s.left.x:0,l="left"===a?s.right.x:0,d=t.top-r+u>i,v=r-t.bottom-c>i,m=t.left-n+f>i,g=n-t.right-l>i;return d||v||m||g}))}(Ae().concat(z).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:M}:null})).filter(Boolean),e)&&(ce(),De(e))}function Ee(e){xe(e)||$.props.trigger.indexOf("click")>=0&&V||($.props.interactive?$.hideWithInteractivity(e):De(e))}function Oe(e){$.props.trigger.indexOf("focusin")<0&&e.target!==te()||$.props.interactive&&e.relatedTarget&&z.contains(e.relatedTarget)||De(e)}function xe(e){return!!x.isTouch&&Z()!==e.type.indexOf("touch")>=0}function Ce(){Te();var t=$.props,n=t.popperOptions,r=t.placement,i=t.offset,a=t.getReferenceClientRect,s=t.moveTransition,u=ee()?S(z).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||te()}:o,p=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(ee()){var n=re().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];ee()&&u&&p.push({name:"arrow",options:{element:u,padding:3}}),p.push.apply(p,(null==n?void 0:n.modifiers)||[]),$.popperInstance=e.createPopper(c,z,Object.assign({},n,{placement:r,onFirstUpdate:A,modifiers:p}))}function Te(){$.popperInstance&&($.popperInstance.destroy(),$.popperInstance=null)}function Ae(){return f(z.querySelectorAll("[data-tippy-root]"))}function Le(e){$.clearDelayTimeouts(),e&&ae("onTrigger",[$,e]),de();var t=oe(!0),n=Q(),r=n[0],o=n[1];x.isTouch&&"hold"===r&&o&&(t=o),t?v=setTimeout((function(){$.show()}),t):$.show()}function De(e){if($.clearDelayTimeouts(),ae("onUntrigger",[$,e]),$.state.isVisible){if(!($.props.trigger.indexOf("mouseenter")>=0&&$.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&V)){var t=oe(!1);t?g=setTimeout((function(){$.state.isVisible&&$.hide()}),t):h=requestAnimationFrame((function(){$.hide()}))}}else ve()}}function F(e,n){void 0===n&&(n={});var r=R.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",T,t),window.addEventListener("blur",L);var o=Object.assign({},n,{plugins:r}),i=h(e).reduce((function(e,t){var n=t&&_(t,o);return n&&e.push(n),e}),[]);return v(e)?i[0]:i}F.defaultProps=R,F.setDefaultProps=function(e){Object.keys(e).forEach((function(t){R[t]=e[t]}))},F.currentInput=x;var W=Object.assign({},e.applyStyles,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),X={mouseover:"mouseenter",focusin:"focus",click:"click"};var Y={name:"animateFill",defaultValue:!1,fn:function(e){var t;if(null==(t=e.props.render)||!t.$$tippy)return{};var n=S(e.popper),r=n.box,o=n.content,i=e.props.animateFill?function(){var e=d();return e.className="tippy-backdrop",y([e],"hidden"),e}():null;return{onCreate:function(){i&&(r.insertBefore(i,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(i){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));o.style.transitionDelay=Math.round(t/10)+"ms",i.style.transitionDuration=e,y([i],"visible")}},onShow:function(){i&&(i.style.transitionDuration="0ms")},onHide:function(){i&&y([i],"hidden")}}}};var $={clientX:0,clientY:0},q=[];function z(e){var t=e.clientX,n=e.clientY;$={clientX:t,clientY:n}}var J={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=w(e.props.triggerTarget||t),r=!1,o=!1,i=!0,a=e.props;function s(){return"initial"===e.props.followCursor&&e.state.isVisible}function u(){n.addEventListener("mousemove",f)}function c(){n.removeEventListener("mousemove",f)}function p(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function f(n){var r=!n.target||t.contains(n.target),o=e.props.followCursor,i=n.clientX,a=n.clientY,s=t.getBoundingClientRect(),u=i-s.left,c=a-s.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=i,r=a;"initial"===o&&(n=e.left+u,r=e.top+c);var s="horizontal"===o?e.top:r,p="vertical"===o?e.right:n,f="horizontal"===o?e.bottom:r,l="vertical"===o?e.left:n;return{width:p-l,height:f-s,top:s,right:p,bottom:f,left:l}}})}function l(){e.props.followCursor&&(q.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",z)}(n))}function d(){0===(q=q.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",z)}(n)}return{onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(t,n){var i=n.followCursor;r||void 0!==i&&a.followCursor!==i&&(d(),i?(l(),!e.state.isMounted||o||s()||u()):(c(),p()))},onMount:function(){e.props.followCursor&&!o&&(i&&(f($),i=!1),s()||u())},onTrigger:function(e,t){m(t)&&($={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(p(),c(),i=!0)}}}};var G={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,n=e.reference;var r=-1,o=!1,i=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(o){var a=o.state;e.props.inlinePositioning&&(-1!==i.indexOf(a.placement)&&(i=[]),t!==a.placement&&-1===i.indexOf(a.placement)&&(i.push(a.placement),e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,n,r){if(n.length<2||null===e)return t;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||t;switch(e){case"top":case"bottom":var o=n[0],i=n[n.length-1],a="top"===e,s=o.top,u=i.bottom,c=a?o.left:i.left,p=a?o.right:i.right;return{top:s,bottom:u,left:c,right:p,width:p-c,height:u-s};case"left":case"right":var f=Math.min.apply(Math,n.map((function(e){return e.left}))),l=Math.max.apply(Math,n.map((function(e){return e.right}))),d=n.filter((function(t){return"left"===e?t.left===f:t.right===l})),v=d[0].top,m=d[d.length-1].bottom;return{top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return t}}(p(e),n.getBoundingClientRect(),f(n.getClientRects()),r)}(a.placement)}})),t=a.placement)}};function s(){var t;o||(t=function(e,t){var n;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(n=e.popperOptions)?void 0:n.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,a),o=!0,e.setProps(t),o=!1)}return{onCreate:s,onAfterUpdate:s,onTrigger:function(t,n){if(m(n)){var o=f(e.reference.getClientRects()),i=o.find((function(e){return e.left-2<=n.clientX&&e.right+2>=n.clientX&&e.top-2<=n.clientY&&e.bottom+2>=n.clientY})),a=o.indexOf(i);r=a>-1?a:r}},onHidden:function(){r=-1}}}};var K={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,n=e.popper;function r(t){return!0===e.props.sticky||e.props.sticky===t}var o=null,i=null;function a(){var s=r("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,u=r("popper")?n.getBoundingClientRect():null;(s&&Q(o,s)||u&&Q(i,u))&&e.popperInstance&&e.popperInstance.update(),o=s,i=u,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function Q(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}return F.setDefaultProps({plugins:[Y,J,G,K],render:N}),F.createSingleton=function(e,t){var n;void 0===t&&(t={});var r,o=e,i=[],a=[],c=t.overrides,p=[],f=!1;function l(){a=o.map((function(e){return u(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function v(){i=o.map((function(e){return e.reference}))}function m(e){o.forEach((function(t){e?t.enable():t.disable()}))}function g(e){return o.map((function(t){var n=t.setProps;return t.setProps=function(o){n(o),t.reference===r&&e.setProps(o)},function(){t.setProps=n}}))}function h(e,t){var n=a.indexOf(t);if(t!==r){r=t;var s=(c||[]).concat("content").reduce((function(e,t){return e[t]=o[n].props[t],e}),{});e.setProps(Object.assign({},s,{getReferenceClientRect:"function"==typeof s.getReferenceClientRect?s.getReferenceClientRect:function(){var e;return null==(e=i[n])?void 0:e.getBoundingClientRect()}}))}}m(!1),v(),l();var b={fn:function(){return{onDestroy:function(){m(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!f&&(f=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!f&&(f=!0,h(e,i[0]))},onTrigger:function(e,t){h(e,t.currentTarget)}}}},y=F(d(),Object.assign({},s(t,["overrides"]),{plugins:[b].concat(t.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(n=t.popperOptions)?void 0:n.modifiers)||[],[W])})})),w=y.show;y.show=function(e){if(w(),!r&&null==e)return h(y,i[0]);if(!r||null!=e){if("number"==typeof e)return i[e]&&h(y,i[e]);if(o.indexOf(e)>=0){var t=e.reference;return h(y,t)}return i.indexOf(e)>=0?h(y,e):void 0}},y.showNext=function(){var e=i[0];if(!r)return y.show(0);var t=i.indexOf(r);y.show(i[t+1]||e)},y.showPrevious=function(){var e=i[i.length-1];if(!r)return y.show(e);var t=i.indexOf(r),n=i[t-1]||e;y.show(n)};var E=y.setProps;return y.setProps=function(e){c=e.overrides||c,E(e)},y.setInstances=function(e){m(!0),p.forEach((function(e){return e()})),o=e,m(!1),v(),l(),p=g(y),y.setProps({triggerTarget:a})},p=g(y),y},F.delegate=function(e,n){var r=[],o=[],i=!1,a=n.target,c=s(n,["target"]),p=Object.assign({},c,{trigger:"manual",touch:!1}),f=Object.assign({touch:R.touch},c,{showOnCreate:!0}),l=F(e,p);function d(e){if(e.target&&!i){var t=e.target.closest(a);if(t){var r=t.getAttribute("data-tippy-trigger")||n.trigger||R.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof f.touch||"touchstart"!==e.type&&r.indexOf(X[e.type])<0)){var s=F(t,f);s&&(o=o.concat(s))}}}}function v(e,t,n,o){void 0===o&&(o=!1),e.addEventListener(t,n,o),r.push({node:e,eventType:t,handler:n,options:o})}return u(l).forEach((function(e){var n=e.destroy,a=e.enable,s=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&o.forEach((function(e){e.destroy()})),o=[],r.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),r=[],n()},e.enable=function(){a(),o.forEach((function(e){return e.enable()})),i=!1},e.disable=function(){s(),o.forEach((function(e){return e.disable()})),i=!0},function(e){var n=e.reference;v(n,"touchstart",d,t),v(n,"mouseover",d),v(n,"focusin",d),v(n,"click",d)}(e)})),l},F.hideAll=function(e){var t=void 0===e?{}:e,n=t.exclude,r=t.duration;U.forEach((function(e){var t=!1;if(n&&(t=g(n)?e.reference===n:e.popper===n.popper),!t){var o=e.props.duration;e.setProps({duration:r}),e.hide(),e.state.isDestroyed||e.setProps({duration:o})}}))},F.roundArrow='',F})); + diff --git a/articles/index.html b/articles/index.html index 7533807c..57cc7de5 100644 --- a/articles/index.html +++ b/articles/index.html @@ -40,6 +40,8 @@

All vignettes

Assessing Balance for Time-Varying Exposures
+
Customize Weights Formulas
+
diff --git a/pkgdown.yml b/pkgdown.yml index 874be142..503ad3dc 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,7 +3,8 @@ pkgdown: 2.1.1 pkgdown_sha: ~ articles: Assessing_Balance_Tv: Assessing_Balance_Tv.html -last_built: 2024-10-08T15:07Z + Customize_Balancing_Formulas: Customize_Balancing_Formulas.html +last_built: 2024-10-08T15:23Z urls: reference: https://istallworthy.github.io/devMSMs/reference article: https://istallworthy.github.io/devMSMs/articles diff --git a/search.json b/search.json index 13ba842f..d9f75f55 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"calculating-raw-balance-statistics","dir":"Articles","previous_headings":"","what":"Calculating Raw Balance Statistics","title":"Assessing Balance for Time-Varying Exposures","text":"calcBalStats() assesses balance using correlations confounder exposure continuous exposures standardized mean differences confounder exposure groups binary exposures. balancing statistics created based diagnostics confounding time-varying exposures outlined Jackson (2016). specifically, user-specified exposure time point, raw balance statistics calculated quantify association exposure time point confounder, exposure history time point. accomplished using col_w_cov() function calculate covariance continuous exposures col_w_smd() function calculate mean difference binary exposures cobalt package (Greifer, 2023). Factor covariates split separate dummy variables using splitfactor() function cobalt. covariate interactions present formulas created data multiplying constituent variables, interactions including factor covariates implemented constituent dummy variables.","code":""},{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"weighting-balance-statistics-by-exposure-history","dir":"Articles","previous_headings":"","what":"Weighting Balance Statistics By Exposure History","title":"Assessing Balance for Time-Varying Exposures","text":"calcBalStats() function, exposure histories comprise combinations presence absence exposure (delineated using median split continuous exposures) prior time points (note may different user-specified, substantive exposure histories used compare dose timing final model; Step 5). Subsequently, weighted mean balance statistics, weighted proportion individuals exposure history, provides raw estimate balance exposure time point confounder. occasion balancing statistics one person people given exposure history, user alerted balance statistic dropped inclusion. raw (unstandardized) balance statistics calculated without IPTW weights pre-balance checking using IPTW balancing weights (multiplied across time points) weighted analyses.","code":""},{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"standardizing-balance-statistics","dir":"Articles","previous_headings":"","what":"Standardizing Balance Statistics","title":"Assessing Balance for Time-Varying Exposures","text":"purpose comparison common balance threshold, balancing statistics similarly standardized following manner. continuous exposures, raw balance statistic (covariance) divided product standard deviation unweighted confounder standard deviation exposure time point calculate correlation. Given , possible correlation may greater 1. binary exposures, raw balance statistic (mean difference) divided pooled standard deviation estimate, square root average standard deviations unweighted confounder levels exposed unexposed groups first exposure time point. standard deviations computed using unadjusted sample (recommended Stuart, 2008; 2010; Greifer, 2022) given possibility balancing changes variation confounder leads misleading standardized values. first exposure time point (histories), standardized balance statistics computed directly using cobalt functions mentioned .","code":""},{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"imputed-data","dir":"Articles","previous_headings":"","what":"Imputed Data","title":"Assessing Balance for Time-Varying Exposures","text":"imputed data supplied, process conducted imputed dataset separately. function takes average absolute values balance statistics across imputed datasets account sampling error (Pishgar et al., 2021 preprint). averaged average balance statistics compared balance threshold(s) summarize covariates balanced. Recommended specification separate balance thresholds relatively less important confounders can found Workflows vignettes. specification balance threshold(s) kept consistent throughout use devMSMs package.","code":""},{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Assessing Balance for Time-Varying Exposures","text":"Greifer, N. (2022). cobalt: Covariate Balance Tables Plots (4.4.1) [Computer software]. https://CRAN.R-project.org/package=cobalt Jackson, J. W. (2016). Diagnostics Confounding Time-varying Joint Exposures. Epidemiology, 27(6), 859. https://doi.org/10.1097/EDE.0000000000000547 Pishgar, F., Greifer, N., Leyrat, C., & Stuart, E. (2021). MatchThem: Matching andWeighting Multiple Imputation. R Journal, 13(2), 292–305. https://doi.org/10.32614/RJ-2021-073 Stuart, E. . (2008). Developing practical recommendations use propensity scores: Discussion ‘critical appraisal propensity score matching medical literature 1996 2003’ Peter Austin, Statistics Medicine. Statistics Medicine, 27(12), 2062–2065. https://doi.org/10.1002/sim.3207 Stuart, E. . (2010). Matching methods causal inference: review look forward. Statistical Science : Review Journal Institute Mathematical Statistics, 25(1), 1–21. https://doi.org/10.1214/09-STS313","code":""},{"path":"https://istallworthy.github.io/devMSMs/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Isabella Stallworthy. Author, maintainer. Noah Greifer. Author, contributor. Kyle Butts. Contributor. Meriah DeJoseph. Author. Emily Padrutt. Author. Daniel Berry. Author.","code":""},{"path":"https://istallworthy.github.io/devMSMs/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Stallworthy , Greifer N, DeJoseph M, Padrutt E, Berry D (2024). devMSMs: Implementing Marginal Structural Models Longitudinal Data. R package version 0.0.0.9001, https://github.com/istallworthy/devMSMs, https://istallworthy.github.io/devMSMs/.","code":"@Manual{, title = {devMSMs: Implementing Marginal Structural Models with Longitudinal Data}, author = {Isabella Stallworthy and Noah Greifer and Meriah DeJoseph and Emily Padrutt and Daniel Berry}, year = {2024}, note = {R package version 0.0.0.9001, https://github.com/istallworthy/devMSMs}, url = {https://istallworthy.github.io/devMSMs/}, }"},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"devmsms-implementing-marginal--with-longitudinal-data","dir":"","previous_headings":"","what":"Implementing Marginal Structural Models with Longitudinal Data","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"study work humans fundamentally interested questions causation. specifically, scientists, clinicians, educators, policymakers alike often interested causal processes involving questions (timing) levels (dose) different factors influence human functioning development, order inform scientific understanding improve people’s lives. However, many, conceptual, methodological, practical barriers prevented use methods causal inference developed fields. goal devMSMs package accompanying tutorial paper, Investigating Causal Questions Human Development Using Marginal Structural Models: Tutorial Introduction devMSMs Package R (insert preprint link ), provide set tools implementing marginal structural models (MSMs; Robins et al., 2000). MSMs orginated epidemiology public health represent one -utilized tool improving causal inference longitudinal observational data, given certain assumptions. brief, MSMs leverage inverse-probability--treatment-weights (IPTW) potential outcomes framework. MSMs first focus problem confounding, using IPTW attenuate associations measured confounders exposure (e.g., experience, characteristic, event –biology broader environment) time. weighted model can fitted relating time-varying exposure future outcome. Finally, model-predicted effects different exposure histories vary dose timing can evaluated compared counterfactuals, reveal putative causal effects. employ term exposure (sometimes referred “treatment” literatures) encompass variety environmental factors, individual characteristics, experiences constitute putative causal events within causal model. Exposures may distal proximal, reflecting developing child’s experience within different environments many levels (Bronfenbrenner & Ceci, 1994), ranging family (e.g., parenting), home (e.g., economic strain), school (e.g., teacher quality), neighborhood (e.g., diversity), greater politico-cultural-economic context (e.g., inequality). Exposures also reflect factors internal child, including neurodevelopmental (e.g., risk markers), physiological (e.g., stress), behavioral (e.g., anxiety) patterns child’s development exposed.","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"core-features","dir":"","previous_headings":"","what":"Core Features","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"Core features devMSMs include: flexible functions built-user guidance, drawing established expertise best practices implementing longitudinal IPTW weighting outcome modeling, answer substantive causal questions dose timing functions accept complete imputed data accommodate missingness often found human studies novel recommended workflow, based expertise several disciplines, using devMSMs functions longitudinal data (see Workflows vignettes) accompanying simulated longitudinal dataset, based real-world, Family Life Project (FLP) study human development, getting know package functions accompanying suite helper functions assist users preparing inspecting data prior implementation devMSMs executable, step--step user guidance implementing devMSMs workflow preliminary steps form vignettes geared toward users levels R programming experience, along R markdown template file brief conceptual introduction, example empirical application, additional resources accompanying tutorial paper","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"package contains 7 core functions implementing two phases MSM process: longitudinal confounder adjustment outcome modeling longitudinal data time-varying exposures. summary terms used devMSMs vignettes functions. details examples can found accompanying manuscript.","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"devMSMs can installed R Studio Github using devtools package: helper functions can installed accompanying devMSMsHelpers repo:","code":"require(devtools, quietly = TRUE) devtools::install_github(\"istallworthy/devMSMs\") library(devMSMs) devtools::install_github(\"istallworthy/devMSMsHelpers\") library(devMSMsHelpers)"},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"recommended-workflow","dir":"","previous_headings":"","what":"Recommended Workflow","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"propose recommended workflow using devMSMs answer causal questions longituinal data. suggest using vignettes order appear Articles tab. reading accompanying manuscript, recommend first reviewing Terminology Data Requirements vignettes begin preparing data. recommend downloading R markdown template file contains code described Specify Core Inputs Workflows vignettes (binary (TBA) continuous exposures) implementing steps .","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"citation--bug-reports","dir":"","previous_headings":"","what":"Citation & Bug Reports","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"Please cite use devMSMs using following citation: Stallworthy , Greifer N, DeJoseph M, Padrutt E, Berry D (2024). devMSMs: Implementing Marginal Structural Models Longitudinal Data. R package version 0.0.0.9000, https://istallworthy.github.io/devMSMs/. Please report bugs following link: https://github.com/istallworthy/devMSMs/issues","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"additional-resources","dir":"","previous_headings":"","what":"Additional Resources","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"Arel-Bundock, Diniz, M. ., Greifer, N., & Bacher, E. (2023). marginaleffects: Predictions, Comparisons, Slopes, Marginal Means, Hypothesis Tests (0.12.0) [Computer software]. https://cran.r-project.org/web/packages/marginaleffects/index.html. Austin, P. C. (2011). Introduction Propensity Score Methods Reducing Effects Confounding Observational Studies. Multivariate Behavioral Research, 46(3), 399–424. https://doi.org/10.1080/00273171.2011.568786 Blackwell, M. (2013). Framework Dynamic Causal Inference Political Science. American Journal Political Science, 57(2), 504–520. https://doi.org/10.1111/j.1540-5907.2012.00626.x Cole, S. R., & Hernán, M. . (2008). Constructing Inverse Probability Weights Marginal Structural Models. American Journal Epidemiology, 168(6), 656–664. https://doi.org/10.1093/aje/kwn164 Eronen, M. . (2020). Causal discovery problem psychological interventions. New Ideas Psychology, 59, 100785. https://doi.org/10.1016/j.newideapsych.2020.100785 Fong, C., Hazlett, C., & Imai, K. (2018). Covariate balancing propensity score continuous treatment: Application efficacy political advertisements. Annals Applied Statistics, 12(1), 156–177. https://doi.org/10.1214/17-AOAS1101 Greifer N (2023). cobalt: Covariate Balance Tables Plots. R package version 4.5.2, https://github.com/ngreifer/cobalt, https://ngreifer.github.io/cobalt/ Greifer N (2023). WeightIt: Weighting Covariate Balance Observational Studies. https://ngreifer.github.io/WeightIt/, https://github.com/ngreifer/WeightIt Jackson, John W. (2016).Diagnostics Confounding Time-varying Joint Exposures. Epidemiology, 2016 Nov, 27(6), 859-69. https://doi.org/10.1097/EDE.0000000000000547. Haber, N. ., Wood, M. E., Wieten, S., & Breskin, . (2022). DAG Omitted Objects Displayed (DAGWOOD): framework revealing causal assumptions DAGs. Annals Epidemiology, 68, 64–71. https://doi.org/10.1016/j.annepidem.2022.01.001 Hirano, K., & Imbens, G. W. (2004). Propensity Score Continuous Treatments. Applied Bayesian Modeling Causal Inference Incomplete-Data Perspectives (pp. 73–84). John Wiley & Sons, Ltd. https://doi.org/10.1002/0470090456.ch7 Kainz, K., Greifer, N., Givens, ., Swietek, K., Lombardi, B. M., Zietz, S., & Kohn, J. L. (2017). Improving Causal Inference: Recommendations Covariate Selection Balance Propensity Score Methods. Journal Society Social Work Research, 8(2), 279–303. https://doi.org/10.1086/691464 Robins, J. M., Hernán, M. Á., & Brumback, B. (2000). Marginal Structural Models Causal Inference Epidemiology. Epidemiology, 11(5), 550–560. Thoemmes, F., & Ong, . D. (2016). Primer Inverse Probability Treatment Weighting Marginal Structural Models. https://doi.org/10.1177/2167696815621645","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":null,"dir":"Reference","previous_headings":"","what":"Assesses confounder balancing — assessBalance","title":"Assesses confounder balancing — assessBalance","text":"Draws functions cobalt package quantify relations exposure confounders exposure time point according guidelines Jackson, 2016 assess balance time-varying exposures.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assesses confounder balancing — assessBalance","text":"","code":"assessBalance( data, obj, weights = NULL, balance_thresh = NULL, imp_conf = NULL, verbose = FALSE, save.out = FALSE ) # S3 method for class 'devMSM_bal_stats' print(x, i = NA, t = TRUE, save.out = FALSE, ...) # S3 method for class 'devMSM_bal_stats' summary(object, i = NA, save.out = FALSE, ...) # S3 method for class 'devMSM_bal_stats' plot(x, i = NA, t = TRUE, save.out = FALSE, ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assesses confounder balancing — assessBalance","text":"data data wide format : data frame, list imputed data frames, mids object mice package obj initialized MSM object initMSM() weights (optional) list IPTW weights output createWeights() balance_thresh (optional) one two numbers 0 1 indicating single balancing threshold thresholds less important confounders, respectively (default = 0.1) imp_conf (optional) list variable names reflecting important confounders, required two balance thresholds supplied verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. x devMSM_bal_stats object assessBalance multiply imputed datasets, selects imputation print results . Default = 1. = TRUE, imputed datasets looped . = NULL, average imputed datasets summarize . Ignored non-imputed data. t exposure variable use. Can either index 1 number exposures string containing exposure variable name (e.g. \".3\"). t = TRUE, exposure variables looped . ... ignored object devMSM_bal_stats object assessBalance()","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assesses confounder balancing — assessBalance","text":"list containing balance statistics dataframe. length number datasets (1 data.frame number imputed datasets)","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assesses confounder balancing — assessBalance","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) # Prebalance b <- assessBalance(data = data, obj = obj) print(b) #> #> +----------+-----------+---------------+------------+----------+ #> | exposure | covariate | std_bal_stats | bal_thresh | balanced | #> +==========+===========+===============+============+==========+ #> | A.1 | C | 0.0928 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | C | 0.2457 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | B.1 | -0.0223 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | A.1 | 0.3289 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | C | 0.0321 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | B.1 | -0.0852 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | B.2 | 0.2001 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | A.1 | 0.0468 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | A.2 | -0.106 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> #> Table: Balance Stats for All Exposure Time Points # returns ggplot of balance stats for all exposure variables plots <- plot(b, t = TRUE) # can plot only specific exposure time periods plot(b, t = \"A.3\") plot(b, t = 3) # Weighted f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) bw <- assessBalance(data = data, weights = w) print(bw) #> #> +----------+-----------+---------------+------------+----------+ #> | exposure | covariate | std_bal_stats | bal_thresh | balanced | #> +==========+===========+===============+============+==========+ #> | A.1 | C | -0.1136 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | C | -0.0279 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | B.1 | -0.0216 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | A.1 | 0.1254 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | C | -0.0584 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | B.1 | -0.0606 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | B.2 | -0.0311 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | A.1 | -0.0195 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | A.2 | -0.1877 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> #> Table: Balance Stats for All Exposure Time Points plot(bw)"},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate, compare, and visualize exposure histories — compareHistories","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"Takes fitted model output created predicted values user-specified histories (pooling imputed data), conducting contrast comparisons (pooling imputed data), correcting multiple comparisons, plotting results.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"","code":"compareHistories( fit, hi_lo_cut, dose_level = \"h\", reference = NULL, comparison = NULL, mc_comp_method = \"BH\", verbose = FALSE, save.out = FALSE ) # S3 method for class 'devMSM_comparisons' print(x, save.out = FALSE, ...) # S3 method for class 'devMSM_comparisons' plot( x, colors = \"Dark2\", exp_lab = NULL, out_lab = NULL, save.out = FALSE, ... ) # S3 method for class 'devMSM_comparisons' summary(object, type = \"comps\", ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"fit list model outputs fitModel() hi_lo_cut list two numbers indicating quantile values reflect high low values, respectively, continuous exposure dose_level (optional) \"l\" \"h\" indicating whether low high doses tallied tables plots (default high \"h\") reference lists one strings \"-\"-separated \"l\" \"h\" values indicative reference exposure history compare comparison, required comparison supplied comparison (optional) list one strings \"-\"-separated \"l\" \"h\" values indicative comparison history/histories compare reference, required reference supplied mc_comp_method (optional) character abbreviation multiple comparison correction method stats::p.adjust, default Benjamini-Hochburg (\"BH\") verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. x devMSM_histories object compareHistories() ... ignored colors (optional) character specifying Brewer palette list colors (n(epochs)+1) plotting (default \"Dark2\" palette) exp_lab (optional) character label exposure variable plots (default variable name) out_lab (optional) character label outcome variable plots (default variable name) object devMSM_histories object compareHistories() type Either \"preds\" \"comps\" corresponding results marginaleffects::avg_predictions() low high dosages marginaleffects::avg_comparisons() respectively","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"list containing two dataframes: preds predictions marginaleffects::avg_predictions() containing average expected outcome different exposure histories comps contrasts marginaleffects::comparisons() comparing different exposure history","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"","code":"library(devMSMs) set.seed(123) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) fit <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m0\" ) comp <- compareHistories( fit = fit, hi_lo_cut = c(0.3, 0.6) ) print(comp) #> Summary of Exposure Main Effects: #> USER ALERT: Out of the total of 50 individuals in the sample, below is the distribution of the 50 (100%) individuals that fall into 24 user-selected exposure histories (out of the 24 total) created from 30th and 60th percentile values for low and high levels of exposure-epoch A.1, A.2, A.3. #> USER ALERT: Please inspect the distribution of the sample across the following exposure histories and ensure there is sufficient spread to avoid extrapolation and low precision: #> #> +---------------+---+ #> | epoch_history | n | #> +===============+===+ #> | NA-NA-h | 2 | #> +---------------+---+ #> | NA-NA-l | 1 | #> +---------------+---+ #> | NA-h-NA | 2 | #> +---------------+---+ #> | NA-h-h | 3 | #> +---------------+---+ #> | NA-h-l | 2 | #> +---------------+---+ #> | NA-l-NA | 1 | #> +---------------+---+ #> | NA-l-h | 2 | #> +---------------+---+ #> | NA-l-l | 2 | #> +---------------+---+ #> | h-NA-NA | 2 | #> +---------------+---+ #> | h-NA-h | 4 | #> +---------------+---+ #> | h-NA-l | 1 | #> +---------------+---+ #> | h-h-NA | 2 | #> +---------------+---+ #> | h-h-h | 3 | #> +---------------+---+ #> | h-h-l | 3 | #> +---------------+---+ #> | h-l-NA | 1 | #> +---------------+---+ #> | h-l-h | 2 | #> +---------------+---+ #> | h-l-l | 2 | #> +---------------+---+ #> | l-NA-NA | 3 | #> +---------------+---+ #> | l-NA-l | 2 | #> +---------------+---+ #> | l-h-NA | 2 | #> +---------------+---+ #> | l-h-h | 1 | #> +---------------+---+ #> | l-h-l | 2 | #> +---------------+---+ #> | l-l-NA | 2 | #> +---------------+---+ #> | l-l-h | 3 | #> +---------------+---+ #> #> Table: Summary of user-selected exposure histories based on exposure main effects A.1, A.2, A.3: #> #> Below are the pooled average predictions by user-specified history: #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | term | A.1 | A.2 | A.3 | estimate | std.error | conf.low | conf.high | #> +=======+=======+=======+========+==========+===========+==========+===========+ #> | l-l-l | -0.47 | -0.3 | -0.804 | -0.15 | 0.2 | -0.54 | 0.239 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | l-l-h | -0.47 | -0.3 | -0.051 | -0.064 | 0.2 | -0.47 | 0.338 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | l-h-l | -0.47 | 0.31 | -0.804 | -0.093 | 0.18 | -0.44 | 0.25 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | l-h-h | -0.47 | 0.31 | -0.051 | -0.007 | 0.19 | -0.37 | 0.357 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-l-l | 0.24 | -0.3 | -0.804 | -0.235 | 0.15 | -0.53 | 0.059 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-l-h | 0.24 | -0.3 | -0.051 | -0.149 | 0.15 | -0.45 | 0.154 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-h-l | 0.24 | 0.31 | -0.804 | -0.179 | 0.13 | -0.43 | 0.07 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-h-h | 0.24 | 0.31 | -0.051 | -0.093 | 0.14 | -0.36 | 0.176 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> #> Conducting multiple comparison correction for all pairings between comparison histories and each refernece history using the BH method. #> #> #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | term | estimate | std.error | p.value | conf.low | conf.high | p.value_corr | #> +===================+===============+============+===========+=============+============+==============+ #> | (l-l-l) - (l-l-h) | -0.0860245895 | 0.09323351 | 0.3561746 | -0.26875891 | 0.09670973 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (l-h-l) | -0.0567671468 | 0.06804542 | 0.4041380 | -0.19013372 | 0.07659943 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (l-h-h) | -0.1427917364 | 0.12113186 | 0.2384729 | -0.38020583 | 0.09462235 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (h-l-l) | 0.0855518211 | 0.09515347 | 0.3686031 | -0.10094556 | 0.27204920 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (h-l-h) | -0.0004727684 | 0.12853504 | 0.9970653 | -0.25239681 | 0.25145127 | 0.9970653 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (h-h-l) | 0.0287846743 | 0.12605827 | 0.8193787 | -0.21828499 | 0.27585434 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (h-h-h) | -0.0572399153 | 0.15718786 | 0.7157462 | -0.36532245 | 0.25084262 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (l-h-l) | 0.0292574427 | 0.10941845 | 0.7891686 | -0.18519878 | 0.24371366 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (l-h-h) | -0.0567671468 | 0.06804540 | 0.4041379 | -0.19013369 | 0.07659939 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (h-l-l) | 0.1715764106 | 0.13773921 | 0.2128887 | -0.09838748 | 0.44154030 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (h-l-h) | 0.0855518211 | 0.09515351 | 0.3686033 | -0.10094562 | 0.27204927 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (h-h-l) | 0.1148092638 | 0.15639156 | 0.4628791 | -0.19171256 | 0.42133108 | 0.6480308 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (h-h-h) | 0.0287846743 | 0.12605825 | 0.8193786 | -0.21828496 | 0.27585431 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (l-h-h) | -0.0860245895 | 0.09323348 | 0.3561744 | -0.26875886 | 0.09670968 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (h-l-l) | 0.1423189679 | 0.10713569 | 0.1840462 | -0.06766312 | 0.35230106 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (h-l-h) | 0.0562943784 | 0.13264560 | 0.6712764 | -0.20368622 | 0.31627498 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (h-h-l) | 0.0855518211 | 0.09515354 | 0.3686034 | -0.10094568 | 0.27204932 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (h-h-h) | -0.0004727684 | 0.12853506 | 0.9970653 | -0.25239686 | 0.25145133 | 0.9970653 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-h) - (h-l-l) | 0.2283435575 | 0.15081852 | 0.1300186 | -0.06725530 | 0.52394242 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-h) - (h-l-h) | 0.1423189679 | 0.10713569 | 0.1840463 | -0.06766313 | 0.35230107 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-h) - (h-h-l) | 0.1715764106 | 0.13773922 | 0.2128888 | -0.09838750 | 0.44154032 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-h) - (h-h-h) | 0.0855518211 | 0.09515352 | 0.3686034 | -0.10094565 | 0.27204929 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-l) - (h-l-h) | -0.0860245895 | 0.09323350 | 0.3561745 | -0.26875889 | 0.09670971 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-l) - (h-h-l) | -0.0567671468 | 0.06804546 | 0.4041383 | -0.19013380 | 0.07659951 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-l) - (h-h-h) | -0.1427917364 | 0.12113192 | 0.2384731 | -0.38020594 | 0.09462247 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-h) - (h-h-l) | 0.0292574427 | 0.10941843 | 0.7891686 | -0.18519874 | 0.24371362 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-h) - (h-h-h) | -0.0567671468 | 0.06804543 | 0.4041381 | -0.19013374 | 0.07659945 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-h-l) - (h-h-h) | -0.0860245895 | 0.09323350 | 0.3561745 | -0.26875888 | 0.09670970 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ plot(comp) summary(comp, \"preds\") #> term A.1 A.2 A.3 estimate std.error statistic #> 1 l-l-l -0.4684962 -0.2971206 -0.80434443 -0.149799589 0.1983536 -0.75521501 #> 2 l-l-h -0.4684962 -0.2971206 -0.05134827 -0.063774999 0.2048054 -0.31139320 #> 3 l-h-l -0.4684962 0.3148300 -0.80434443 -0.093032442 0.1750306 -0.53152099 #> 4 l-h-h -0.4684962 0.3148300 -0.05134827 -0.007007852 0.1859760 -0.03768148 #> 5 h-l-l 0.2359494 -0.2971206 -0.80434443 -0.235351410 0.1502513 -1.56638563 #> 6 h-l-h 0.2359494 -0.2971206 -0.05134827 -0.149326820 0.1547615 -0.96488363 #> 7 h-h-l 0.2359494 0.3148300 -0.80434443 -0.178584263 0.1267806 -1.40860879 #> 8 h-h-h 0.2359494 0.3148300 -0.05134827 -0.092559673 0.1371105 -0.67507375 #> p.value s.value conf.low conf.high dose #> 1 0.4501200 1.15161848 -0.5385654 0.23896625 0 #> 2 0.7555017 0.40449305 -0.4651861 0.33763614 1 #> 3 0.5950578 0.74889829 -0.4360861 0.25002124 1 #> 4 0.9699416 0.04403015 -0.3715142 0.35749845 2 #> 5 0.1172584 3.09223725 -0.5298385 0.05913564 1 #> 6 0.3346031 1.57947727 -0.4526538 0.15400011 2 #> 7 0.1589509 2.65334711 -0.4270697 0.06990114 2 #> 8 0.4996289 1.00107114 -0.3612912 0.17617189 3 summary(comp, \"comps\") #> term estimate std.error statistic p.value #> 1 (l-l-l) - (l-l-h) -0.0860245895 0.09323351 -0.922678895 0.3561746 #> 2 (l-l-l) - (l-h-l) -0.0567671468 0.06804542 -0.834253748 0.4041380 #> 3 (l-l-l) - (l-h-h) -0.1427917364 0.12113186 -1.178812343 0.2384729 #> 4 (l-l-l) - (h-l-l) 0.0855518211 0.09515347 0.899092985 0.3686031 #> 5 (l-l-l) - (h-l-h) -0.0004727684 0.12853504 -0.003678129 0.9970653 #> 6 (l-l-l) - (h-h-l) 0.0287846743 0.12605827 0.228344197 0.8193787 #> 7 (l-l-l) - (h-h-h) -0.0572399153 0.15718786 -0.364149728 0.7157462 #> 8 (l-l-h) - (l-h-l) 0.0292574427 0.10941845 0.267390396 0.7891686 #> 9 (l-l-h) - (l-h-h) -0.0567671468 0.06804540 -0.834253950 0.4041379 #> 10 (l-l-h) - (h-l-l) 0.1715764106 0.13773921 1.245661352 0.2128887 #> 11 (l-l-h) - (h-l-h) 0.0855518211 0.09515351 0.899092683 0.3686033 #> 12 (l-l-h) - (h-h-l) 0.1148092638 0.15639156 0.734114205 0.4628791 #> 13 (l-l-h) - (h-h-h) 0.0287846743 0.12605825 0.228344230 0.8193786 #> 14 (l-h-l) - (l-h-h) -0.0860245895 0.09323348 -0.922679121 0.3561744 #> 15 (l-h-l) - (h-l-l) 0.1423189679 0.10713569 1.328399262 0.1840462 #> 16 (l-h-l) - (h-l-h) 0.0562943784 0.13264560 0.424396874 0.6712764 #> 17 (l-h-l) - (h-h-l) 0.0855518211 0.09515354 0.899092410 0.3686034 #> 18 (l-h-l) - (h-h-h) -0.0004727684 0.12853506 -0.003678128 0.9970653 #> 19 (l-h-h) - (h-l-l) 0.2283435575 0.15081852 1.514028672 0.1300186 #> 20 (l-h-h) - (h-l-h) 0.1423189679 0.10713569 1.328399184 0.1840463 #> 21 (l-h-h) - (h-h-l) 0.1715764106 0.13773922 1.245661276 0.2128888 #> 22 (l-h-h) - (h-h-h) 0.0855518211 0.09515352 0.899092564 0.3686034 #> 23 (h-l-l) - (h-l-h) -0.0860245895 0.09323350 -0.922678981 0.3561745 #> 24 (h-l-l) - (h-h-l) -0.0567671468 0.06804546 -0.834253253 0.4041383 #> 25 (h-l-l) - (h-h-h) -0.1427917364 0.12113192 -1.178811770 0.2384731 #> 26 (h-l-h) - (h-h-l) 0.0292574427 0.10941843 0.267390449 0.7891686 #> 27 (h-l-h) - (h-h-h) -0.0567671468 0.06804543 -0.834253622 0.4041381 #> 28 (h-h-l) - (h-h-h) -0.0860245895 0.09323350 -0.922679011 0.3561745 #> s.value conf.low conf.high dose p.value_corr #> 1 1.489343589 -0.26875891 0.09670973 0 - 1 0.5955722 #> 2 1.307080051 -0.19013372 0.07659943 0 - 1 0.5955722 #> 3 2.068102717 -0.38020583 0.09462235 0 - 2 0.5955722 #> 4 1.439859757 -0.10094556 0.27204920 0 - 1 0.5955722 #> 5 0.004240125 -0.25239681 0.25145127 0 - 2 0.9970653 #> 6 0.287397761 -0.21828499 0.27585434 0 - 2 0.8824078 #> 7 0.482479980 -0.36532245 0.25084262 0 - 3 0.8824078 #> 8 0.341594553 -0.18519878 0.24371366 1 - 1 0.8824078 #> 9 1.307080457 -0.19013369 0.07659939 1 - 2 0.5955722 #> 10 2.231828396 -0.09838748 0.44154030 1 - 1 0.5955722 #> 11 1.439859126 -0.10094562 0.27204927 1 - 2 0.5955722 #> 12 1.111292558 -0.19171256 0.42133108 1 - 2 0.6480308 #> 13 0.287397807 -0.21828496 0.27585431 1 - 3 0.8824078 #> 14 1.489344066 -0.26875886 0.09670968 1 - 2 0.5955722 #> 15 2.441859794 -0.06766312 0.35230106 1 - 1 0.5955722 #> 16 0.575021172 -0.20368622 0.31627498 1 - 2 0.8824078 #> 17 1.439858557 -0.10094568 0.27204932 1 - 2 0.5955722 #> 18 0.004240124 -0.25239686 0.25145133 1 - 3 0.9970653 #> 19 2.943210429 -0.06725530 0.52394242 2 - 1 0.5955722 #> 20 2.441859592 -0.06766313 0.35230107 2 - 2 0.5955722 #> 21 2.231828206 -0.09838750 0.44154032 2 - 2 0.5955722 #> 22 1.439858879 -0.10094565 0.27204929 2 - 3 0.5955722 #> 23 1.489343772 -0.26875889 0.09670971 1 - 2 0.5955722 #> 24 1.307079055 -0.19013380 0.07659951 1 - 2 0.5955722 #> 25 2.068101336 -0.38020594 0.09462247 1 - 3 0.5955722 #> 26 0.341594628 -0.18519874 0.24371362 2 - 2 0.8824078 #> 27 1.307079797 -0.19013374 0.07659945 2 - 3 0.5955722 #> 28 1.489343836 -0.26875888 0.09670970 2 - 3 0.5955722 comp2 <- compareHistories( fit = fit, hi_lo_cut = c(0.3, 0.6), reference = \"l-l-l\", comparison = c(\"h-h-h\", \"h-h-l\") ) print(comp2) #> Summary of Exposure Main Effects: #> Warning: There are no participants in your sample in the following histories: l-l-l. #> Please revise your reference/comparison histories and/or the high/low cutoffs, if applicable. #> USER ALERT: Out of the total of 50 individuals in the sample, below is the distribution of the 6 (12%) individuals that fall into 2 user-selected exposure histories (out of the 24 total) created from 30th and 60th percentile values for low and high levels of exposure-epoch A.1, A.2, A.3. #> USER ALERT: Please inspect the distribution of the sample across the following exposure histories and ensure there is sufficient spread to avoid extrapolation and low precision: #> #> +---------------+---+ #> | epoch_history | n | #> +===============+===+ #> | h-h-h | 3 | #> +---------------+---+ #> | h-h-l | 3 | #> +---------------+---+ #> #> Table: Summary of user-selected exposure histories based on exposure main effects A.1, A.2, A.3: #> #> Below are the pooled average predictions by user-specified history: #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | term | A.1 | A.2 | A.3 | estimate | std.error | conf.low | conf.high | #> +=======+=======+=======+========+==========+===========+==========+===========+ #> | l-l-l | -0.47 | -0.3 | -0.804 | -0.15 | 0.2 | -0.54 | 0.24 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-h-l | 0.24 | 0.31 | -0.804 | -0.179 | 0.13 | -0.43 | 0.07 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-h-h | 0.24 | 0.31 | -0.051 | -0.093 | 0.14 | -0.36 | 0.18 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> #> Conducting multiple comparison correction for all pairings between comparison histories and each refernece history using the BH method. #> #> #> +-------------------+-------------+-----------+-----------+------------+-----------+--------------+ #> | term | estimate | std.error | p.value | conf.low | conf.high | p.value_corr | #> +===================+=============+===========+===========+============+===========+==============+ #> | (h-h-h) - (l-l-l) | 0.05723992 | 0.1571879 | 0.7157462 | -0.2508426 | 0.3653225 | 0.8193787 | #> +-------------------+-------------+-----------+-----------+------------+-----------+--------------+ #> | (h-h-l) - (l-l-l) | -0.02878467 | 0.1260583 | 0.8193787 | -0.2758543 | 0.2182850 | 0.8193787 | #> +-------------------+-------------+-----------+-----------+------------+-----------+--------------+ plot(comp2) summary(comp2, \"preds\") #> term A.1 A.2 A.3 estimate std.error statistic #> 1 l-l-l -0.4684962 -0.2971206 -0.80434443 -0.14979959 0.1983536 -0.7552150 #> 7 h-h-l 0.2359494 0.3148300 -0.80434443 -0.17858426 0.1267806 -1.4086088 #> 8 h-h-h 0.2359494 0.3148300 -0.05134827 -0.09255967 0.1371105 -0.6750738 #> p.value s.value conf.low conf.high dose #> 1 0.4501200 1.151618 -0.5385654 0.23896625 0 #> 7 0.1589509 2.653347 -0.4270697 0.06990114 2 #> 8 0.4996289 1.001071 -0.3612912 0.17617189 3 summary(comp2, \"comps\") #> term estimate std.error statistic p.value s.value #> 1 (h-h-h) - (l-l-l) 0.05723992 0.1571879 0.3641497 0.7157462 0.4824800 #> 2 (h-h-l) - (l-l-l) -0.02878467 0.1260583 -0.2283442 0.8193787 0.2873978 #> conf.low conf.high dose p.value_corr #> 1 -0.2508426 0.3653225 3 - 0 0.8193787 #> 2 -0.2758543 0.2182850 2 - 0 0.8193787"},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":null,"dir":"Reference","previous_headings":"","what":"Create balancing formulas — createFormulas","title":"Create balancing formulas — createFormulas","text":"Creates balancing formulas relating exposure relevant time-varying time invariant confounders exposure time point used create IPTW weights.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create balancing formulas — createFormulas","text":"","code":"createFormulas( obj, type = c(\"full\", \"short\", \"update\"), custom = NULL, keep_conf = NULL, bal_stats = NULL, verbose = FALSE, save.out = FALSE ) # S3 method for class 'devMSM_formulas' print(x, ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create balancing formulas — createFormulas","text":"obj initialized MSM object initMSM() type type formula create 'full' (includes lagged time-varying confounders), 'short' (includes time-varying confounders t-1 lag ), 'update' (adds 'short' formulas imbalanced time-varying confounders lags great t-1) custom (optional) custom list formulas exposure time point (default create automatically according type) keep_conf (optional) 'short' formulas , list variable names reflecting confounders included always. bal_stats list balance statistics assessBalance() verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. x devMSM_formulas object createFormulas() ... ignored","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create balancing formulas — createFormulas","text":"list containing balancing formulas. length number exposure variables.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create balancing formulas — createFormulas","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) # Full Formulas f <- createFormulas(obj, type = \"full\") print(f) #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 1, the full formula for A.1 is: #> A.1 ~ C #> #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 2, the full formula for A.2 is: #> A.2 ~ C + B.1 + A.1 #> #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 3, the full formula for A.3 is: #> A.3 ~ C + B.1 + B.2 + A.1 + A.2 # Short Formulas f <- createFormulas(obj, type = \"short\") print(f) #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 1, the short formula for A.1 is: #> A.1 ~ C #> #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 2, the short formula for A.2 is: #> A.2 ~ C + B.1 + A.1 #> #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 3, the short formula for A.3 is: #> A.3 ~ C + B.2 + A.2 # Update Formulas w <- createWeights(data = data, formulas = f) b <- assessBalance(data = data, weights = w) f <- createFormulas(obj, type = \"update\", bal_stats = b) print(f) #> USER ALERT: Please manually inspect the updated balancing formula below that includes time-varying confounders at t-1 and those greater at further lags that remained imbalanced: #> At time point 1, the update formula for A.1 is: #> A.1 ~ C #> #> USER ALERT: Please manually inspect the updated balancing formula below that includes time-varying confounders at t-1 and those greater at further lags that remained imbalanced: #> At time point 2, the update formula for A.2 is: #> A.2 ~ C + B.1 + A.1 #> #> USER ALERT: Please manually inspect the updated balancing formula below that includes time-varying confounders at t-1 and those greater at further lags that remained imbalanced: #> At time point 3, the update formula for A.3 is: #> A.3 ~ C + B.2 + A.2 + A.1"},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates IPTW balancing weights — createWeights","title":"Creates IPTW balancing weights — createWeights","text":"Creates IPTW balancing weights user-specified exposure time point using balancing formulas relate exposure time point relevant confounders.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates IPTW balancing weights — createWeights","text":"","code":"createWeights( data, formulas, method = \"glm\", verbose = FALSE, save.out = FALSE, ... ) # S3 method for class 'devMSM_weights' print(x, i = 1, ...) # S3 method for class 'devMSM_weights' plot(x, i = 1, save.out = FALSE, ...) # S3 method for class 'devMSM_weights' summary(object, i = 1, ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates IPTW balancing weights — createWeights","text":"data data wide format : data frame, list imputed data frames, mids object mice package formulas list balancing formulas time point output createFormulas() method character string weightitMSM() balancing method abbreviation (default generalized linear models propensity score weighting \"glm\") verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. ... arguments passed WeightIt::weightitMSM() summary.weightitMSM() x, object devMSM_weights object createWeights() multiply imputed datasets, selects imputation print results . Default = 1. = TRUE, imputed datasets looped . = NULL, average imputed datasets summarize . Ignored non-imputed data.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Creates IPTW balancing weights — createWeights","text":"list containing WeightIt::weightitMSM() output. length number datasets (1 data.frame number imputed datasets).","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates IPTW balancing weights — createWeights","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) print(w) #> #> For the `glm` weighting method, the median weight value is 1.04 (SD = 0.41; range = 0.3-3). plot(w) # Methods from `WeightIt::weightitMSM` w <- createWeights(data = data, formulas = f, method = \"glm\") w <- createWeights(data = data, formulas = f, method = \"cbps\") w <- createWeights(data = data, formulas = f, method = \"gbm\") w <- createWeights(data = data, formulas = f, method = \"bart\") w <- createWeights(data = data, formulas = f, method = \"super\") #> Loading required package: nnls #> Warning: All algorithms have zero weight #> Warning: All metalearner coefficients are zero, predictions will all be equal to 0"},{"path":"https://istallworthy.github.io/devMSMs/reference/devMSMs-package.html","id":null,"dir":"Reference","previous_headings":"","what":"devMSMs: Implementing Marginal Structural Models with Longitudinal Data — devMSMs-package","title":"devMSMs: Implementing Marginal Structural Models with Longitudinal Data — devMSMs-package","text":"Functions implementing MSMS longitudinal data.","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/devMSMs-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"devMSMs: Implementing Marginal Structural Models with Longitudinal Data — devMSMs-package","text":"Maintainer: Isabella Stallworthy istall@seas.upenn.edu Authors: Noah Greifer noah.greifer@gmail.com (ORCID) [contributor] Meriah DeJoseph meriahd@stanford.edu Emily Padrutt padru004@umn.edu Daniel Berry dberry@umn.edu contributors: Kyle Butts buttskyle96@gmail.com [contributor]","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit outcome model — fitModel","title":"Fit outcome model — fitModel","text":"Fits weighted marginal outcome model generalized linear model user's choosing, relating exposure main effects outcome using IPTW weights.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit outcome model — fitModel","text":"","code":"fitModel( data, obj, weights = NULL, outcome, model = \"m0\", int_order = NA, covariates = NULL, family = gaussian(), link = \"identity\", verbose = FALSE, save.out = FALSE ) # S3 method for class 'devMSM_models' print(x, i = NA, save.out = FALSE, ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit outcome model — fitModel","text":"data data wide format : data frame, list imputed data frames, mids object mice package obj initialized MSM object initMSM() weights list IPTW weights output createWeights() outcome name outcome variable \".timepoint\" suffix. See initMSM() details suffix model character indicating one following outcome models: \"m0\" (exposure main effects) \"m1\" (exposure main effects & covariates) \"m2\" (exposure main effects & interactions) \"m3\" (exposure main effects, interactions, & covariates) int_order integer specification highest order exposure main effects interaction, required interaction models (\"m2\", \"m3\") covariates list characters reflecting variable names covariates, required covariate models (\"m1\", \"m3\") family (optional) family function specification WeightIt::glm_weightit() model. link (optional) link function specification WeightIt::glm_weightit() model. verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. x devMSM_models object fitModel multiply imputed datasets, selects imputation print results . Default = 1. = TRUE, imputed datasets looped . = NULL, average imputed datasets summarize . Ignored non-imputed data. ... ignored","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit outcome model — fitModel","text":"list containing WeightIt::glm_weightit() model output. length number datasets (1 data.frame number imputed datasets)","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit outcome model — fitModel","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) fit_m0 <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m0\" ) print(fit_m0) #> Please inspect the Wald test to determine if the exposures collectively predict significant variation in the outcome compared to a model without exposure terms. #> We strongly suggest only conducting history comparisons if the test is significant. #> #> Wald test #> Variance: HC0 robust (adjusted for estimation of weights) #> #> Model 1: D.3 ~ A.1 + A.2 + A.3 #> Model 2: D.3 ~ 1 #> #> Res.Df Df Chisq Pr(>Chisq) #> 1 46 #> 2 49 3 17.511 0.0005548 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> #> The marginal model, m0, is summarized below: #> +-------------+--------+-----------------+-------+ #> | | (1) | #> +-------------+--------+-----------------+-------+ #> | | Est. | CI | p | #> +=============+========+=================+=======+ #> | (Intercept) | 0.224 | [-0.011, 0.460] | 0.062 | #> +-------------+--------+-----------------+-------+ #> | A.1 | 0.350 | [0.141, 0.560] | 0.001 | #> +-------------+--------+-----------------+-------+ #> | A.2 | -0.186 | [-0.432, 0.060] | 0.139 | #> +-------------+--------+-----------------+-------+ #> | A.3 | -0.284 | [-0.682, 0.114] | 0.163 | #> +-------------+--------+-----------------+-------+ #> | Num.Obs. | 50 | | | #> +-------------+--------+-----------------+-------+ fit_m1 <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m1\", covariates = c(\"C\") ) print(fit_m1) #> Please inspect the Wald test to determine if the exposures collectively predict significant variation in the outcome compared to a model without exposure terms. #> We strongly suggest only conducting history comparisons if the test is significant. #> #> Wald test #> Variance: HC0 robust (adjusted for estimation of weights) #> #> Model 1: D.3 ~ A.1 + A.2 + A.3 + C #> Model 2: D.3 ~ C #> #> Res.Df Df Chisq Pr(>Chisq) #> 1 45 #> 2 48 3 17.633 0.0005236 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> #> The marginal model, m1, is summarized below: #> +-------------+--------+-----------------+--------+ #> | | (1) | #> +-------------+--------+-----------------+--------+ #> | | Est. | CI | p | #> +=============+========+=================+========+ #> | (Intercept) | 0.222 | [-0.013, 0.458] | 0.064 | #> +-------------+--------+-----------------+--------+ #> | A.1 | 0.352 | [0.143, 0.561] | <0.001 | #> +-------------+--------+-----------------+--------+ #> | A.2 | -0.185 | [-0.432, 0.062] | 0.142 | #> +-------------+--------+-----------------+--------+ #> | A.3 | -0.287 | [-0.689, 0.116] | 0.163 | #> +-------------+--------+-----------------+--------+ #> | C | -0.044 | [-0.277, 0.188] | 0.708 | #> +-------------+--------+-----------------+--------+ #> | Num.Obs. | 50 | | | #> +-------------+--------+-----------------+--------+ fit_m2 <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m2\", int_order = 2 ) print(fit_m2) #> Please inspect the Wald test to determine if the exposures collectively predict significant variation in the outcome compared to a model without exposure terms. #> We strongly suggest only conducting history comparisons if the test is significant. #> #> Wald test #> Variance: HC0 robust (adjusted for estimation of weights) #> #> Model 1: D.3 ~ A.1 + A.2 + A.3 + A.1 + A.2 + A.3 + A.1:A.2 + A.1:A.3 + A.2:A.3 #> Model 2: D.3 ~ 1 #> #> Res.Df Df Chisq Pr(>Chisq) #> 1 43 #> 2 49 6 19.785 0.003024 ** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> #> The marginal model, m2, is summarized below: #> +-------------+--------+-----------------+-------+ #> | | (1) | #> +-------------+--------+-----------------+-------+ #> | | Est. | CI | p | #> +=============+========+=================+=======+ #> | (Intercept) | 0.207 | [-0.031, 0.446] | 0.089 | #> +-------------+--------+-----------------+-------+ #> | A.1 | 0.404 | [0.161, 0.647] | 0.001 | #> +-------------+--------+-----------------+-------+ #> | A.2 | -0.145 | [-0.420, 0.131] | 0.303 | #> +-------------+--------+-----------------+-------+ #> | A.3 | -0.318 | [-0.650, 0.013] | 0.060 | #> +-------------+--------+-----------------+-------+ #> | A.1 × A.2 | 0.234 | [-0.036, 0.505] | 0.089 | #> +-------------+--------+-----------------+-------+ #> | A.1 × A.3 | -0.018 | [-0.364, 0.328] | 0.918 | #> +-------------+--------+-----------------+-------+ #> | A.2 × A.3 | 0.247 | [-0.090, 0.584] | 0.152 | #> +-------------+--------+-----------------+-------+ #> | Num.Obs. | 50 | | | #> +-------------+--------+-----------------+-------+ fit_m3 <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m3\", int_order = 2, covariates = c(\"C\") ) print(fit_m3) #> Please inspect the Wald test to determine if the exposures collectively predict significant variation in the outcome compared to a model without exposure terms. #> We strongly suggest only conducting history comparisons if the test is significant. #> #> Wald test #> Variance: HC0 robust (adjusted for estimation of weights) #> #> Model 1: D.3 ~ A.1 + A.2 + A.3 + A.1 + A.2 + A.3 + C + A.1:A.2 + A.1:A.3 + A.1:C + A.2:A.3 + A.2:C + A.3:C #> Model 2: D.3 ~ C #> #> Res.Df Df Chisq Pr(>Chisq) #> 1 39 #> 2 48 9 23.536 0.005098 ** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> #> The marginal model, m3, is summarized below: #> +-------------+--------+------------------+--------+ #> | | (1) | #> +-------------+--------+------------------+--------+ #> | | Est. | CI | p | #> +=============+========+==================+========+ #> | (Intercept) | 0.187 | [-0.058, 0.432] | 0.134 | #> +-------------+--------+------------------+--------+ #> | A.1 | 0.422 | [0.182, 0.662] | <0.001 | #> +-------------+--------+------------------+--------+ #> | A.2 | -0.126 | [-0.411, 0.159] | 0.387 | #> +-------------+--------+------------------+--------+ #> | A.3 | -0.353 | [-0.654, -0.053] | 0.021 | #> +-------------+--------+------------------+--------+ #> | C | -0.137 | [-0.360, 0.087] | 0.231 | #> +-------------+--------+------------------+--------+ #> | A.1 × A.2 | 0.238 | [-0.067, 0.542] | 0.126 | #> +-------------+--------+------------------+--------+ #> | A.1 × A.3 | 0.013 | [-0.352, 0.377] | 0.946 | #> +-------------+--------+------------------+--------+ #> | A.1 × C | 0.156 | [-0.102, 0.414] | 0.236 | #> +-------------+--------+------------------+--------+ #> | A.2 × A.3 | 0.281 | [-0.051, 0.614] | 0.097 | #> +-------------+--------+------------------+--------+ #> | A.2 × C | 0.199 | [-0.055, 0.454] | 0.124 | #> +-------------+--------+------------------+--------+ #> | A.3 × C | -0.080 | [-0.432, 0.271] | 0.655 | #> +-------------+--------+------------------+--------+ #> | Num.Obs. | 50 | | | #> +-------------+--------+------------------+--------+"},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":null,"dir":"Reference","previous_headings":"","what":"Initial step in devMSMs workflow — initMSM","title":"Initial step in devMSMs workflow — initMSM","text":"Initial step devMSMs workflow","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initial step in devMSMs workflow — initMSM","text":"","code":"initMSM( data, exposure, epoch = NULL, tv_conf, ti_conf = NULL, concur_conf = NULL, home_dir = NULL, sep = \"[\\\\._]\" )"},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initial step in devMSMs workflow — initMSM","text":"data data wide format : data frame, list imputed data frames, mids object mice package exposure names exposure variables \".timepoint\" suffix epoch (optional) group set exposure variables categories. Provide character vector corresponding category exposure tv_conf list time-varying confounders \".timepoint\" suffix, include exposure outcome variables (least time-varying exposure variables required ) ti_conf list time invariant confounders. Can left NULL none. concur_conf (optional) list variable names reflecting time-varying confounders retain formulas contemporaneously (default none) home_dir (optional) directory saving output. Either absolute path relative path respect getwd() sep (optional) seperator variable time period. variable names split last occurance sep second string containing time. uses regex notation, . must \\\\.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initial step in devMSMs workflow — initMSM","text":"object class devMSM contains initialized information.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Initial step in devMSMs workflow — initMSM","text":".timepoint suffix, mean time-varying exposure variable names must end either .# _#. allows us extract time-period variable measured allow us properly create formulae (omitting future mediators)","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Initial step in devMSMs workflow — initMSM","text":"","code":"data <- data.frame( A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), D.3 = rnorm(n = 50), L.1 = sample(c(0, 1), size = 50, replace = TRUE), C = rnorm(n = 50) ) obj <- initMSM( data = data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\"), ti_conf = \"C\" ) obj #> Exposure (continuous): A.1, A.2, A.3 #> Variable and their encodings: #> var type time #> A.1 exposure 1 #> A.2 exposure 2 #> A.3 exposure 3 #> B.1 tv_conf 1 #> B.2 tv_conf 2 #> B.3 tv_conf 3 #> D.3 tv_conf 3 #> C ti_conf -1"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_imp_list.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","title":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package imputing mice package reading imputed dataset. data contain economic strain (ESEATA1) continuously distributed variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_imp_list.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","text":"","code":"sim_data_imp_list"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_imp_list.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_imp_list.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","title":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package. data contain economic strain (ESEATA1) continuously distributed variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","text":"","code":"sim_data_long_miss"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","text":"long data frame 6, 458 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"WAVE\" age (months) data collected \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss_bin.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Long data with missingness (binary exposure) — sim_data_long_miss_bin.rda","title":"Long data with missingness (binary exposure) — sim_data_long_miss_bin.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package. data contain economic strain (ESEATA1) binary variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss_bin.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Long data with missingness (binary exposure) — sim_data_long_miss_bin.rda","text":"","code":"sim_data_long_miss_bin"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss_bin.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Long data with missingness (binary exposure) — sim_data_long_miss_bin.rda","text":"long data frame 6,458 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"WAVE\" age (months) data collected \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety #' @references DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_mice.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","title":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package prior imputation using mice via random forest. data contain economic strain (ESEATA1) continuously distributed variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_mice.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","text":"","code":"sim_data_mice"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_mice.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_mice.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","title":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","text":"Wide complete data (continuous exposure) data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). data contain economic strain (ESEATA1) continuously distributed variable missing data.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","text":"","code":"sim_data_wide"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_bin.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","title":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","text":"Wide complete data (binary exposure) data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). data contain economic strain (ESEATA1) binary variable, missing data.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_bin.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","text":"","code":"sim_data_wide_bin"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_bin.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_bin.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","title":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package. data contain economic strain (ESEATA1) continuously distributed variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","text":"","code":"sim_data_wide_miss"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss_bin.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","title":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package. data contain economic strain (ESEATA1) binary variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss_bin.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","text":"","code":"sim_data_wide_miss_bin"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss_bin.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss_bin.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim IPTW balancing weights, if needed — trimWeights","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"Trims IPTW balancing weights heavy right tails populating weight values given quantile weight value quantile.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"","code":"trimWeights(weights, at = 0, lower = FALSE, verbose = FALSE, save.out = FALSE)"},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"weights list IPTW weights output createWeights() numeric; either quantile weights weights trimmed. single number .5 1, number weights trimmed (e.g., = 3 top 3 weights set 4th largest weight). lower logical; whether also trim lower quantile (e.g., = .9, trimming .1 .9, = 3, trimming top bottom 3 weights). Default FALSE trim higher weights. verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"list containing WeightIt::weightitMSM() output. length number datasets (1 data.frame number imputed datasets).","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) tw <- trimWeights(w, at = 0.975) print(tw) #> #> For the `glm` weighting method, after trimming at 97.5th quantile, the median weight value is 0.97 (SD = 0.32; range = 0.43-2). plot(tw) trimWeights(w, at = 0.975, lower = TRUE) #> #> For the `glm` weighting method, after trimming between 2.5th and 97.5th quantiles, the median weight value is 0.97 (SD = 0.32; range = 0.43-2)."}] +[{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"calculating-raw-balance-statistics","dir":"Articles","previous_headings":"","what":"Calculating Raw Balance Statistics","title":"Assessing Balance for Time-Varying Exposures","text":"calcBalStats() assesses balance using correlations confounder exposure continuous exposures standardized mean differences confounder exposure groups binary exposures. balancing statistics created based diagnostics confounding time-varying exposures outlined Jackson (2016). specifically, user-specified exposure time point, raw balance statistics calculated quantify association exposure time point confounder, exposure history time point. accomplished using col_w_cov() function calculate covariance continuous exposures col_w_smd() function calculate mean difference binary exposures cobalt package (Greifer, 2023). Factor covariates split separate dummy variables using splitfactor() function cobalt. covariate interactions present formulas created data multiplying constituent variables, interactions including factor covariates implemented constituent dummy variables.","code":""},{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"weighting-balance-statistics-by-exposure-history","dir":"Articles","previous_headings":"","what":"Weighting Balance Statistics By Exposure History","title":"Assessing Balance for Time-Varying Exposures","text":"calcBalStats() function, exposure histories comprise combinations presence absence exposure (delineated using median split continuous exposures) prior time points (note may different user-specified, substantive exposure histories used compare dose timing final model; Step 5). Subsequently, weighted mean balance statistics, weighted proportion individuals exposure history, provides raw estimate balance exposure time point confounder. occasion balancing statistics one person people given exposure history, user alerted balance statistic dropped inclusion. raw (unstandardized) balance statistics calculated without IPTW weights pre-balance checking using IPTW balancing weights (multiplied across time points) weighted analyses.","code":""},{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"standardizing-balance-statistics","dir":"Articles","previous_headings":"","what":"Standardizing Balance Statistics","title":"Assessing Balance for Time-Varying Exposures","text":"purpose comparison common balance threshold, balancing statistics similarly standardized following manner. continuous exposures, raw balance statistic (covariance) divided product standard deviation unweighted confounder standard deviation exposure time point calculate correlation. Given , possible correlation may greater 1. binary exposures, raw balance statistic (mean difference) divided pooled standard deviation estimate, square root average standard deviations unweighted confounder levels exposed unexposed groups first exposure time point. standard deviations computed using unadjusted sample (recommended Stuart, 2008; 2010; Greifer, 2022) given possibility balancing changes variation confounder leads misleading standardized values. first exposure time point (histories), standardized balance statistics computed directly using cobalt functions mentioned .","code":""},{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"imputed-data","dir":"Articles","previous_headings":"","what":"Imputed Data","title":"Assessing Balance for Time-Varying Exposures","text":"imputed data supplied, process conducted imputed dataset separately. function takes average absolute values balance statistics across imputed datasets account sampling error (Pishgar et al., 2021 preprint). averaged average balance statistics compared balance threshold(s) summarize covariates balanced. Recommended specification separate balance thresholds relatively less important confounders can found Workflows vignettes. specification balance threshold(s) kept consistent throughout use devMSMs package.","code":""},{"path":"https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Assessing Balance for Time-Varying Exposures","text":"Greifer, N. (2024). cobalt: Covariate Balance Tables Plots (4.4.1) [Computer software]. https://CRAN.R-project.org/package=cobalt Jackson, J. W. (2016). Diagnostics Confounding Time-varying Joint Exposures. Epidemiology, 27(6), 859. https://doi.org/10.1097/EDE.0000000000000547 Pishgar, F., Greifer, N., Leyrat, C., & Stuart, E. (2021). MatchThem: Matching andWeighting Multiple Imputation. R Journal, 13(2), 292–305. https://doi.org/10.32614/RJ-2021-073 Stuart, E. . (2008). Developing practical recommendations use propensity scores: Discussion ‘critical appraisal propensity score matching medical literature 1996 2003’ Peter Austin, Statistics Medicine. Statistics Medicine, 27(12), 2062–2065. https://doi.org/10.1002/sim.3207 Stuart, E. . (2010). Matching methods causal inference: review look forward. Statistical Science : Review Journal Institute Mathematical Statistics, 25(1), 1–21. https://doi.org/10.1214/09-STS313","code":""},{"path":"https://istallworthy.github.io/devMSMs/articles/Customize_Balancing_Formulas.html","id":"core-inputs","dir":"Articles","previous_headings":"","what":"Core Inputs","title":"Customize Weights Formulas","text":"specify core inputs devMSMs functions. createFormulas() function 3 different modes: “full” (Steps 1 & 4), “short” (Step 2), “update” (Step 3), corresponding different steps Workflows vignettes, can customized mode. suggest staying consistent customization throughout use package workflow. recommend sure include measured confounders (mediators colliders) exposure time point weights formulas. Please refer accompanying manuscript details. , illustrate customization options three modes createFormuls() function using information package dataset example. data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). take example exposure economic strain (ESETA1) measured 6, 15, 24, 35, 58 months relation outcome behavior problems (StrDif_Tot) measured 58 months.","code":"exposure <- c(\"ESETA1.6\", \"ESETA1.15\", \"ESETA1.24\", \"ESETA1.35\", \"ESETA1.58\") tv_conf <- c( \"SAAmylase.6\", \"SAAmylase.15\", \"SAAmylase.24\", \"MDI.6\", \"MDI.15\", \"RHasSO.6\", \"RHasSO.15\", \"RHasSO.24\", \"RHasSO.35\", \"WndNbrhood.6\", \"WndNbrhood.24\", \"WndNbrhood.35\", \"IBRAttn.6\", \"IBRAttn.15\", \"IBRAttn.24\", \"B18Raw.6\", \"B18Raw.15\", \"B18Raw.24\", \"HOMEETA1.6\", \"HOMEETA1.15\", \"HOMEETA1.24\", \"HOMEETA1.35\", \"InRatioCor.6\", \"InRatioCor.15\", \"InRatioCor.24\", \"InRatioCor.35\", \"CORTB.6\", \"CORTB.15\", \"CORTB.24\", \"EARS_TJo.24\", \"EARS_TJo.35\", \"LESMnPos.24\", \"LESMnPos.35\", \"LESMnNeg.24\", \"LESMnNeg.35\", \"StrDif_Tot.35\", \"fscore.35\" ) ti_conf <- c( \"state\", \"BioDadInHH2\", \"PmAge2\", \"PmBlac2\", \"TcBlac2\", \"PmMrSt2\", \"PmEd2\", \"KFASTScr\", \"RMomAgeU\", \"RHealth\", \"HomeOwnd\", \"SWghtLB\", \"SurpPreg\", \"SmokTotl\", \"DrnkFreq\", \"peri_health\", \"caregiv_health\", \"gov_assist\" ) data(sim_data_wide, package = \"devMSMs\") obj <- devMSMs::initMSM( data = sim_data_wide, exposure = exposure, tv_conf = tv_conf, ti_conf = ti_conf )"},{"path":"https://istallworthy.github.io/devMSMs/articles/Customize_Balancing_Formulas.html","id":"customize-full-weights-formulas-steps-1-4","dir":"Articles","previous_headings":"","what":"Customize Full Weights Formulas (Steps 1 & 4)","title":"Customize Weights Formulas","text":"default use createFormulas() type = “full” creates weights formulas exposure time point. formula contains time invariant confounders well time-varying confounders measured time points prior exposure time point. example, 24-month weights formula, time-varying confounders 6 15 months. However, users wish also include time-varying confounders measured contemporaneously exposure time point (e.g., also include 24-month time-varying confounders 24-month weights formula), can specify time-varying confounders optional argument initMSM(), concur_conf. example, include 24-month maternal depression 24-month weights formula, following: first specify confounders retain contemporaneously creating MSM object. Now B18Raw.24 included 24-month weights formula addition 35-58-month formulas. Alternatively, user completely customize full formulas manually creating formulas exposure time point using optional custom argument. create custom formulas, user creates list entry exposure time point, contains weights formula exposure time point. createFormulas() conduct checks ensure formula time point provides cautionary warnings unusual variables (e.g., measured exposure time point). However, user responsible ensuring validity formulas. note, user creates custom “full” formula, also create custom formulas using createFormulas() make “short” “updated” formulas. , illustrate abridged example specifying custom arguments exposure, ESETA1, 6-, 15-, 24-, 35-, 58-month time points. customFormulas() checks retains formulas use package.","code":"obj <- devMSMs::initMSM( data = sim_data_wide, exposure = exposure, tv_conf = tv_conf, ti_conf = ti_conf, concur_conf = \"B18Raw.24\" ) full_formulas <- createFormulas(obj = obj, type = \"full\") print(full_formulas) #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 6, the full formula for ESETA1.6 is: #> ESETA1.6 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 15, the full formula for ESETA1.15 is: #> ESETA1.15 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + MDI.6 + RHasSO.6 + WndNbrhood.6 + IBRAttn.6 + B18Raw.6 + HOMEETA1.6 + InRatioCor.6 + CORTB.6 + ESETA1.6 #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 24, the full formula for ESETA1.24 is: #> ESETA1.24 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + SAAmylase.15 + MDI.6 + MDI.15 + RHasSO.6 + RHasSO.15 + WndNbrhood.6 + IBRAttn.6 + IBRAttn.15 + B18Raw.6 + B18Raw.15 + B18Raw.24 + HOMEETA1.6 + HOMEETA1.15 + InRatioCor.6 + InRatioCor.15 + CORTB.6 + CORTB.15 + ESETA1.6 + ESETA1.15 #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 35, the full formula for ESETA1.35 is: #> ESETA1.35 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + SAAmylase.15 + SAAmylase.24 + MDI.6 + MDI.15 + RHasSO.6 + RHasSO.15 + RHasSO.24 + WndNbrhood.6 + WndNbrhood.24 + IBRAttn.6 + IBRAttn.15 + IBRAttn.24 + B18Raw.6 + B18Raw.15 + B18Raw.24 + HOMEETA1.6 + HOMEETA1.15 + HOMEETA1.24 + InRatioCor.6 + InRatioCor.15 + InRatioCor.24 + CORTB.6 + CORTB.15 + CORTB.24 + EARS_TJo.24 + LESMnPos.24 + LESMnNeg.24 + ESETA1.6 + ESETA1.15 + ESETA1.24 #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 58, the full formula for ESETA1.58 is: #> ESETA1.58 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + SAAmylase.15 + SAAmylase.24 + MDI.6 + MDI.15 + RHasSO.6 + RHasSO.15 + RHasSO.24 + RHasSO.35 + WndNbrhood.6 + WndNbrhood.24 + WndNbrhood.35 + IBRAttn.6 + IBRAttn.15 + IBRAttn.24 + B18Raw.6 + B18Raw.15 + B18Raw.24 + HOMEETA1.6 + HOMEETA1.15 + HOMEETA1.24 + HOMEETA1.35 + InRatioCor.6 + InRatioCor.15 + InRatioCor.24 + InRatioCor.35 + CORTB.6 + CORTB.15 + CORTB.24 + EARS_TJo.24 + EARS_TJo.35 + LESMnPos.24 + LESMnPos.35 + LESMnNeg.24 + LESMnNeg.35 + StrDif_Tot.35 + fscore.35 + ESETA1.6 + ESETA1.15 + ESETA1.24 + ESETA1.35 custom <- list( ESETA1.6 ~ BioDadInHH2 + DrnkFreq + gov_assist, ESETA1.15 ~ BioDadInHH2 + DrnkFreq + gov_assist, ESETA1.24 ~ BioDadInHH2 + DrnkFreq + gov_assist, ESETA1.35 ~ BioDadInHH2 + DrnkFreq + gov_assist, ESETA1.58 ~ BioDadInHH2 + DrnkFreq + gov_assist ) full_formulas <- createFormulas(obj = obj, custom = custom) print(full_formulas) #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 6, the custom formula for ESETA1.6 is: #> ESETA1.6 ~ BioDadInHH2 + DrnkFreq + gov_assist #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 15, the custom formula for ESETA1.15 is: #> ESETA1.15 ~ BioDadInHH2 + DrnkFreq + gov_assist #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 24, the custom formula for ESETA1.24 is: #> ESETA1.24 ~ BioDadInHH2 + DrnkFreq + gov_assist #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 35, the custom formula for ESETA1.35 is: #> ESETA1.35 ~ BioDadInHH2 + DrnkFreq + gov_assist #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 58, the custom formula for ESETA1.58 is: #> ESETA1.58 ~ BioDadInHH2 + DrnkFreq + gov_assist"},{"path":"https://istallworthy.github.io/devMSMs/articles/Customize_Balancing_Formulas.html","id":"time-varying-confounders-measured-contemporaneously-with-exposure-time-point","dir":"Articles","previous_headings":"","what":"Time-Varying Confounders Measured Contemporaneously With Exposure Time Point","title":"Customize Weights Formulas","text":"However, users wish also include time-varying confounders measured contemporaneously exposure time point (e.g., also include 24-month time-varying confounders 24-month weights formula), can specify time-varying confounders optional argument initMSM(), concur_conf. example, include 24-month maternal depression 24-month weights formula, following: first specify confounders retain contemporaneously creating MSM object. Now B18Raw.24 included 24-month weights formula addition 35-58-month formulas.","code":"obj <- devMSMs::initMSM( data = sim_data_wide, exposure = exposure, tv_conf = tv_conf, ti_conf = ti_conf, concur_conf = \"B18Raw.24\" ) full_formulas <- createFormulas(obj = obj, type = \"full\") print(full_formulas) #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 6, the full formula for ESETA1.6 is: #> ESETA1.6 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 15, the full formula for ESETA1.15 is: #> ESETA1.15 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + MDI.6 + RHasSO.6 + WndNbrhood.6 + IBRAttn.6 + B18Raw.6 + HOMEETA1.6 + InRatioCor.6 + CORTB.6 + ESETA1.6 #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 24, the full formula for ESETA1.24 is: #> ESETA1.24 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + SAAmylase.15 + MDI.6 + MDI.15 + RHasSO.6 + RHasSO.15 + WndNbrhood.6 + IBRAttn.6 + IBRAttn.15 + B18Raw.6 + B18Raw.15 + B18Raw.24 + HOMEETA1.6 + HOMEETA1.15 + InRatioCor.6 + InRatioCor.15 + CORTB.6 + CORTB.15 + ESETA1.6 + ESETA1.15 #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 35, the full formula for ESETA1.35 is: #> ESETA1.35 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + SAAmylase.15 + SAAmylase.24 + MDI.6 + MDI.15 + RHasSO.6 + RHasSO.15 + RHasSO.24 + WndNbrhood.6 + WndNbrhood.24 + IBRAttn.6 + IBRAttn.15 + IBRAttn.24 + B18Raw.6 + B18Raw.15 + B18Raw.24 + HOMEETA1.6 + HOMEETA1.15 + HOMEETA1.24 + InRatioCor.6 + InRatioCor.15 + InRatioCor.24 + CORTB.6 + CORTB.15 + CORTB.24 + EARS_TJo.24 + LESMnPos.24 + LESMnNeg.24 + ESETA1.6 + ESETA1.15 + ESETA1.24 #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 58, the full formula for ESETA1.58 is: #> ESETA1.58 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + SAAmylase.15 + SAAmylase.24 + MDI.6 + MDI.15 + RHasSO.6 + RHasSO.15 + RHasSO.24 + RHasSO.35 + WndNbrhood.6 + WndNbrhood.24 + WndNbrhood.35 + IBRAttn.6 + IBRAttn.15 + IBRAttn.24 + B18Raw.6 + B18Raw.15 + B18Raw.24 + HOMEETA1.6 + HOMEETA1.15 + HOMEETA1.24 + HOMEETA1.35 + InRatioCor.6 + InRatioCor.15 + InRatioCor.24 + InRatioCor.35 + CORTB.6 + CORTB.15 + CORTB.24 + EARS_TJo.24 + EARS_TJo.35 + LESMnPos.24 + LESMnPos.35 + LESMnNeg.24 + LESMnNeg.35 + StrDif_Tot.35 + fscore.35 + ESETA1.6 + ESETA1.15 + ESETA1.24 + ESETA1.35"},{"path":"https://istallworthy.github.io/devMSMs/articles/Customize_Balancing_Formulas.html","id":"fully-custom-formulas","dir":"Articles","previous_headings":"","what":"Fully Custom Formulas","title":"Customize Weights Formulas","text":"Alternatively, user completely customize full formulas manually creating formulas exposure time point using optional custom argument. create custom formulas, user creates list entry exposure time point, contains weights formula exposure time point. createFormulas() conduct checks ensure formula time point provides cautionary warnings unusual variables (e.g., measured exposure time point). However, user responsible ensuring validity formulas. note, user creates custom “full” formula, also create custom formulas using createFormulas() make “short” “updated” formulas. , illustrate abridged example specifying custom arguments exposure, ESETA1, 6-, 15-, 24-, 35-, 58-month time points. customFormulas() checks retains formulas use package.","code":"custom <- list( ESETA1.6 ~ BioDadInHH2 + DrnkFreq + gov_assist, ESETA1.15 ~ BioDadInHH2 + DrnkFreq + gov_assist, ESETA1.24 ~ BioDadInHH2 + DrnkFreq + gov_assist, ESETA1.35 ~ BioDadInHH2 + DrnkFreq + gov_assist, ESETA1.58 ~ BioDadInHH2 + DrnkFreq + gov_assist ) full_formulas <- createFormulas(obj = obj, custom = custom) print(full_formulas) #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 6, the custom formula for ESETA1.6 is: #> ESETA1.6 ~ BioDadInHH2 + DrnkFreq + gov_assist #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 15, the custom formula for ESETA1.15 is: #> ESETA1.15 ~ BioDadInHH2 + DrnkFreq + gov_assist #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 24, the custom formula for ESETA1.24 is: #> ESETA1.24 ~ BioDadInHH2 + DrnkFreq + gov_assist #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 35, the custom formula for ESETA1.35 is: #> ESETA1.35 ~ BioDadInHH2 + DrnkFreq + gov_assist #> USER ALERT: Please manually inspect the slightly cleaned custom formula below: #> At time point 58, the custom formula for ESETA1.58 is: #> ESETA1.58 ~ BioDadInHH2 + DrnkFreq + gov_assist"},{"path":"https://istallworthy.github.io/devMSMs/articles/Customize_Balancing_Formulas.html","id":"customize-short-weights-formulas-step-2","dir":"Articles","previous_headings":"","what":"Customize Short Weights Formulas (Step 2)","title":"Customize Weights Formulas","text":"default use createFormulas() type = “short” creates shortened weights formulas exposure time point. formula contains time invariant confounders well time-varying confounders measured time point directly prior (t-1 lag) exposure time point. example, 24-month weights formula, include time-varying confounders 15 months. Please see Workflows vignettes accompanying manuscript detail. creating short formulas, user can specify optional concur_conf custom arguments detailed . note, createFormulas() check formulas custom field meet criteria shortened formula, thus user responsible ensuring validity formulas. creating short formulas, user can also specify optional keep_conf argument. Users specify second argument time-varying confounders always retain formulas, lagged form, overriding t-1 lag default. Users may wish use argument time-varying confounders highly consistent time strong reasons include initial phase selecting optimal weighting method (see Workflows vignettes details). Note unless variables also specified concuf_conf, retained lagged form. example, always retain income formulas lagged form, overriding t-1 lag default via keep_conf. shown , createFormulas function now retains income 6 months 15-, 24-, 35-, 58-month formulas, overriding t-1 lag rule variable. Without specification, income 6 months omitted formulas exposure 24, 35, 58 months. default use createFormulas() type = “update” creates updated weights formulas exposure time point. formula contains time invariant confounders; time-varying confounders measured time point directly prior (t-1 lag) exposure time point; well time-varying confounders greater lags successfully balanced using short weights formulas. creating updated formulas, user can specify optional concur_conf, keep_conf, custom arguments detailed . note, createFormulas() check formulas custom field meet criteria updated formula identify imbalanced confounders, user responsible ensuring validity formulas.","code":"short_formulas <- createFormulas(obj = obj, type = \"short\", keep_conf = c(\"InRatioCor.6\")) print(short_formulas) #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 6, the short formula for ESETA1.6 is: #> ESETA1.6 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 15, the short formula for ESETA1.15 is: #> ESETA1.15 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.6 + MDI.6 + RHasSO.6 + WndNbrhood.6 + IBRAttn.6 + B18Raw.6 + HOMEETA1.6 + InRatioCor.6 + CORTB.6 + ESETA1.6 #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 24, the short formula for ESETA1.24 is: #> ESETA1.24 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.15 + MDI.15 + RHasSO.15 + IBRAttn.15 + B18Raw.15 + B18Raw.24 + HOMEETA1.15 + InRatioCor.15 + CORTB.15 + ESETA1.15 + InRatioCor.6 #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 35, the short formula for ESETA1.35 is: #> ESETA1.35 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + SAAmylase.24 + RHasSO.24 + WndNbrhood.24 + IBRAttn.24 + HOMEETA1.24 + InRatioCor.24 + CORTB.24 + EARS_TJo.24 + LESMnPos.24 + LESMnNeg.24 + ESETA1.24 + InRatioCor.6 #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 58, the short formula for ESETA1.58 is: #> ESETA1.58 ~ state + BioDadInHH2 + PmAge2 + PmBlac2 + TcBlac2 + PmMrSt2 + PmEd2 + KFASTScr + RMomAgeU + RHealth + HomeOwnd + SWghtLB + SurpPreg + SmokTotl + DrnkFreq + peri_health + caregiv_health + gov_assist + RHasSO.35 + WndNbrhood.35 + HOMEETA1.35 + InRatioCor.35 + EARS_TJo.35 + LESMnPos.35 + LESMnNeg.35 + StrDif_Tot.35 + fscore.35 + ESETA1.35 + InRatioCor.6"},{"path":"https://istallworthy.github.io/devMSMs/articles/Customize_Balancing_Formulas.html","id":"customize-updated-weights-formulas-step-3","dir":"Articles","previous_headings":"","what":"Customize Updated Weights Formulas (Step 3)","title":"Customize Weights Formulas","text":"default use createFormulas() type = “update” creates updated weights formulas exposure time point. formula contains time invariant confounders; time-varying confounders measured time point directly prior (t-1 lag) exposure time point; well time-varying confounders greater lags successfully balanced using short weights formulas. creating updated formulas, user can specify optional concur_conf, keep_conf, custom arguments detailed . note, createFormulas() check formulas custom field meet criteria updated formula identify imbalanced confounders, user responsible ensuring validity formulas.","code":""},{"path":"https://istallworthy.github.io/devMSMs/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Isabella Stallworthy. Author, maintainer. Noah Greifer. Author, contributor. Kyle Butts. Contributor. Meriah DeJoseph. Author. Emily Padrutt. Author. Daniel Berry. Author.","code":""},{"path":"https://istallworthy.github.io/devMSMs/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Stallworthy , Greifer N, DeJoseph M, Padrutt E, Berry D (2024). devMSMs: Implementing Marginal Structural Models Longitudinal Data. R package version 0.0.0.9001, https://github.com/istallworthy/devMSMs, https://istallworthy.github.io/devMSMs/.","code":"@Manual{, title = {devMSMs: Implementing Marginal Structural Models with Longitudinal Data}, author = {Isabella Stallworthy and Noah Greifer and Meriah DeJoseph and Emily Padrutt and Daniel Berry}, year = {2024}, note = {R package version 0.0.0.9001, https://github.com/istallworthy/devMSMs}, url = {https://istallworthy.github.io/devMSMs/}, }"},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"devmsms-implementing-marginal--with-longitudinal-data","dir":"","previous_headings":"","what":"Implementing Marginal Structural Models with Longitudinal Data","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"study work humans fundamentally interested questions causation. specifically, scientists, clinicians, educators, policymakers alike often interested causal processes involving questions (timing) levels (dose) different factors influence human functioning development, order inform scientific understanding improve people’s lives. However, many, conceptual, methodological, practical barriers prevented use methods causal inference developed fields. goal devMSMs package accompanying tutorial paper, Investigating Causal Questions Human Development Using Marginal Structural Models: Tutorial Introduction devMSMs Package R (insert preprint link ), provide set tools implementing marginal structural models (MSMs; Robins et al., 2000). MSMs orginated epidemiology public health represent one -utilized tool improving causal inference longitudinal observational data, given certain assumptions. brief, MSMs leverage inverse-probability--treatment-weights (IPTW) potential outcomes framework. MSMs first focus problem confounding, using IPTW attenuate associations measured confounders exposure (e.g., experience, characteristic, event –biology broader environment) time. weighted model can fitted relating time-varying exposure future outcome. Finally, model-predicted effects different exposure histories vary dose timing can evaluated compared counterfactuals, reveal putative causal effects. employ term exposure (sometimes referred “treatment” literatures) encompass variety environmental factors, individual characteristics, experiences constitute putative causal events within causal model. Exposures may distal proximal, reflecting developing child’s experience within different environments many levels (Bronfenbrenner & Ceci, 1994), ranging family (e.g., parenting), home (e.g., economic strain), school (e.g., teacher quality), neighborhood (e.g., diversity), greater politico-cultural-economic context (e.g., inequality). Exposures also reflect factors internal child, including neurodevelopmental (e.g., risk markers), physiological (e.g., stress), behavioral (e.g., anxiety) patterns child’s development exposed.","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"core-features","dir":"","previous_headings":"","what":"Core Features","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"Core features devMSMs include: flexible functions built-user guidance, drawing established expertise best practices implementing longitudinal IPTW weighting outcome modeling, answer substantive causal questions dose timing functions accept complete imputed data accommodate missingness often found human studies novel recommended workflow, based expertise several disciplines, using devMSMs functions longitudinal data (see Workflows vignettes) accompanying simulated longitudinal dataset, based real-world, Family Life Project (FLP) study human development, getting know package functions accompanying suite helper functions assist users preparing inspecting data prior implementation devMSMs executable, step--step user guidance implementing devMSMs workflow preliminary steps form vignettes geared toward users levels R programming experience, along R markdown template file brief conceptual introduction, example empirical application, additional resources accompanying tutorial paper","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"package contains 7 core functions implementing two phases MSM process: longitudinal confounder adjustment outcome modeling longitudinal data time-varying exposures. summary terms used devMSMs vignettes functions. details examples can found accompanying manuscript.","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"devMSMs can installed R Studio Github using devtools package: helper functions can installed accompanying devMSMsHelpers repo:","code":"require(devtools, quietly = TRUE) devtools::install_github(\"istallworthy/devMSMs\") library(devMSMs) devtools::install_github(\"istallworthy/devMSMsHelpers\") library(devMSMsHelpers)"},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"recommended-workflow","dir":"","previous_headings":"","what":"Recommended Workflow","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"propose recommended workflow using devMSMs answer causal questions longituinal data. suggest using vignettes order appear Articles tab. reading accompanying manuscript, recommend first reviewing Terminology Data Requirements vignettes begin preparing data. recommend downloading R markdown template file contains code described Specify Core Inputs Workflows vignettes (binary (TBA) continuous exposures) implementing steps .","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"citation--bug-reports","dir":"","previous_headings":"","what":"Citation & Bug Reports","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"Please cite use devMSMs using following citation: Stallworthy , Greifer N, DeJoseph M, Padrutt E, Berry D (2024). devMSMs: Implementing Marginal Structural Models Longitudinal Data. R package version 0.0.0.9000, https://istallworthy.github.io/devMSMs/. Please report bugs following link: https://github.com/istallworthy/devMSMs/issues","code":""},{"path":"https://istallworthy.github.io/devMSMs/index.html","id":"additional-resources","dir":"","previous_headings":"","what":"Additional Resources","title":"Implementing Marginal Structural Models with Longitudinal Data","text":"Arel-Bundock, Diniz, M. ., Greifer, N., & Bacher, E. (2023). marginaleffects: Predictions, Comparisons, Slopes, Marginal Means, Hypothesis Tests (0.12.0) [Computer software]. https://cran.r-project.org/web/packages/marginaleffects/index.html. Austin, P. C. (2011). Introduction Propensity Score Methods Reducing Effects Confounding Observational Studies. Multivariate Behavioral Research, 46(3), 399–424. https://doi.org/10.1080/00273171.2011.568786 Blackwell, M. (2013). Framework Dynamic Causal Inference Political Science. American Journal Political Science, 57(2), 504–520. https://doi.org/10.1111/j.1540-5907.2012.00626.x Cole, S. R., & Hernán, M. . (2008). Constructing Inverse Probability Weights Marginal Structural Models. American Journal Epidemiology, 168(6), 656–664. https://doi.org/10.1093/aje/kwn164 Eronen, M. . (2020). Causal discovery problem psychological interventions. New Ideas Psychology, 59, 100785. https://doi.org/10.1016/j.newideapsych.2020.100785 Fong, C., Hazlett, C., & Imai, K. (2018). Covariate balancing propensity score continuous treatment: Application efficacy political advertisements. Annals Applied Statistics, 12(1), 156–177. https://doi.org/10.1214/17-AOAS1101 Greifer N (2023). cobalt: Covariate Balance Tables Plots. R package version 4.5.2, https://github.com/ngreifer/cobalt, https://ngreifer.github.io/cobalt/ Greifer N (2023). WeightIt: Weighting Covariate Balance Observational Studies. https://ngreifer.github.io/WeightIt/, https://github.com/ngreifer/WeightIt Jackson, John W. (2016).Diagnostics Confounding Time-varying Joint Exposures. Epidemiology, 2016 Nov, 27(6), 859-69. https://doi.org/10.1097/EDE.0000000000000547. Haber, N. ., Wood, M. E., Wieten, S., & Breskin, . (2022). DAG Omitted Objects Displayed (DAGWOOD): framework revealing causal assumptions DAGs. Annals Epidemiology, 68, 64–71. https://doi.org/10.1016/j.annepidem.2022.01.001 Hirano, K., & Imbens, G. W. (2004). Propensity Score Continuous Treatments. Applied Bayesian Modeling Causal Inference Incomplete-Data Perspectives (pp. 73–84). John Wiley & Sons, Ltd. https://doi.org/10.1002/0470090456.ch7 Kainz, K., Greifer, N., Givens, ., Swietek, K., Lombardi, B. M., Zietz, S., & Kohn, J. L. (2017). Improving Causal Inference: Recommendations Covariate Selection Balance Propensity Score Methods. Journal Society Social Work Research, 8(2), 279–303. https://doi.org/10.1086/691464 Robins, J. M., Hernán, M. Á., & Brumback, B. (2000). Marginal Structural Models Causal Inference Epidemiology. Epidemiology, 11(5), 550–560. Thoemmes, F., & Ong, . D. (2016). Primer Inverse Probability Treatment Weighting Marginal Structural Models. https://doi.org/10.1177/2167696815621645","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":null,"dir":"Reference","previous_headings":"","what":"Assesses confounder balancing — assessBalance","title":"Assesses confounder balancing — assessBalance","text":"Draws functions cobalt package quantify relations exposure confounders exposure time point according guidelines Jackson, 2016 assess balance time-varying exposures.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assesses confounder balancing — assessBalance","text":"","code":"assessBalance( data, obj, weights = NULL, balance_thresh = NULL, imp_conf = NULL, verbose = FALSE, save.out = FALSE ) # S3 method for class 'devMSM_bal_stats' print(x, i = NA, t = TRUE, save.out = FALSE, ...) # S3 method for class 'devMSM_bal_stats' summary(object, i = NA, save.out = FALSE, ...) # S3 method for class 'devMSM_bal_stats' plot(x, i = NA, t = TRUE, save.out = FALSE, ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assesses confounder balancing — assessBalance","text":"data data wide format : data frame, list imputed data frames, mids object mice package obj initialized MSM object initMSM() weights (optional) list IPTW weights output createWeights() balance_thresh (optional) one two numbers 0 1 indicating single balancing threshold thresholds less important confounders, respectively (default = 0.1) imp_conf (optional) list variable names reflecting important confounders, required two balance thresholds supplied verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. x devMSM_bal_stats object assessBalance multiply imputed datasets, selects imputation print results . Default = 1. = TRUE, imputed datasets looped . = NULL, average imputed datasets summarize . Ignored non-imputed data. t exposure variable use. Can either index 1 number exposures string containing exposure variable name (e.g. \".3\"). t = TRUE, exposure variables looped . ... ignored object devMSM_bal_stats object assessBalance()","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assesses confounder balancing — assessBalance","text":"list containing balance statistics dataframe. length number datasets (1 data.frame number imputed datasets)","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/assessBalance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assesses confounder balancing — assessBalance","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) # Prebalance b <- assessBalance(data = data, obj = obj) print(b) #> #> +----------+-----------+---------------+------------+----------+ #> | exposure | covariate | std_bal_stats | bal_thresh | balanced | #> +==========+===========+===============+============+==========+ #> | A.1 | C | 0.0928 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | C | 0.2457 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | B.1 | -0.0223 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | A.1 | 0.3289 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | C | 0.0321 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | B.1 | -0.0852 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | B.2 | 0.2001 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | A.1 | 0.0468 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | A.2 | -0.106 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> #> Table: Balance Stats for All Exposure Time Points # returns ggplot of balance stats for all exposure variables plots <- plot(b, t = TRUE) # can plot only specific exposure time periods plot(b, t = \"A.3\") plot(b, t = 3) # Weighted f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) bw <- assessBalance(data = data, weights = w) print(bw) #> #> +----------+-----------+---------------+------------+----------+ #> | exposure | covariate | std_bal_stats | bal_thresh | balanced | #> +==========+===========+===============+============+==========+ #> | A.1 | C | -0.1136 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | C | -0.0279 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | B.1 | -0.0216 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.2 | A.1 | 0.1254 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | C | -0.0584 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | B.1 | -0.0606 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | B.2 | -0.0311 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | A.1 | -0.0195 | 0.1 | 1 | #> +----------+-----------+---------------+------------+----------+ #> | A.3 | A.2 | -0.1877 | 0.1 | 0 | #> +----------+-----------+---------------+------------+----------+ #> #> Table: Balance Stats for All Exposure Time Points plot(bw)"},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate, compare, and visualize exposure histories — compareHistories","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"Takes fitted model output created predicted values user-specified histories (pooling imputed data), conducting contrast comparisons (pooling imputed data), correcting multiple comparisons, plotting results.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"","code":"compareHistories( fit, hi_lo_cut, dose_level = \"h\", reference = NULL, comparison = NULL, mc_comp_method = \"BH\", verbose = FALSE, save.out = FALSE ) # S3 method for class 'devMSM_comparisons' print(x, save.out = FALSE, ...) # S3 method for class 'devMSM_comparisons' plot( x, colors = \"Dark2\", exp_lab = NULL, out_lab = NULL, save.out = FALSE, ... ) # S3 method for class 'devMSM_comparisons' summary(object, type = \"comps\", ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"fit list model outputs fitModel() hi_lo_cut list two numbers indicating quantile values reflect high low values, respectively, continuous exposure dose_level (optional) \"l\" \"h\" indicating whether low high doses tallied tables plots (default high \"h\") reference lists one strings \"-\"-separated \"l\" \"h\" values indicative reference exposure history compare comparison, required comparison supplied comparison (optional) list one strings \"-\"-separated \"l\" \"h\" values indicative comparison history/histories compare reference, required reference supplied mc_comp_method (optional) character abbreviation multiple comparison correction method stats::p.adjust, default Benjamini-Hochburg (\"BH\") verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. x devMSM_histories object compareHistories() ... ignored colors (optional) character specifying Brewer palette list colors (n(epochs)+1) plotting (default \"Dark2\" palette) exp_lab (optional) character label exposure variable plots (default variable name) out_lab (optional) character label outcome variable plots (default variable name) object devMSM_histories object compareHistories() type Either \"preds\" \"comps\" corresponding results marginaleffects::avg_predictions() low high dosages marginaleffects::avg_comparisons() respectively","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"list containing two dataframes: preds predictions marginaleffects::avg_predictions() containing average expected outcome different exposure histories comps contrasts marginaleffects::comparisons() comparing different exposure history","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/compareHistories.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate, compare, and visualize exposure histories — compareHistories","text":"","code":"library(devMSMs) set.seed(123) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) fit <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m0\" ) comp <- compareHistories( fit = fit, hi_lo_cut = c(0.3, 0.6) ) print(comp) #> Summary of Exposure Main Effects: #> USER ALERT: Out of the total of 50 individuals in the sample, below is the distribution of the 50 (100%) individuals that fall into 24 user-selected exposure histories (out of the 24 total) created from 30th and 60th percentile values for low and high levels of exposure-epoch A.1, A.2, A.3. #> USER ALERT: Please inspect the distribution of the sample across the following exposure histories and ensure there is sufficient spread to avoid extrapolation and low precision: #> #> +---------------+---+ #> | epoch_history | n | #> +===============+===+ #> | NA-NA-h | 2 | #> +---------------+---+ #> | NA-NA-l | 1 | #> +---------------+---+ #> | NA-h-NA | 2 | #> +---------------+---+ #> | NA-h-h | 3 | #> +---------------+---+ #> | NA-h-l | 2 | #> +---------------+---+ #> | NA-l-NA | 1 | #> +---------------+---+ #> | NA-l-h | 2 | #> +---------------+---+ #> | NA-l-l | 2 | #> +---------------+---+ #> | h-NA-NA | 2 | #> +---------------+---+ #> | h-NA-h | 4 | #> +---------------+---+ #> | h-NA-l | 1 | #> +---------------+---+ #> | h-h-NA | 2 | #> +---------------+---+ #> | h-h-h | 3 | #> +---------------+---+ #> | h-h-l | 3 | #> +---------------+---+ #> | h-l-NA | 1 | #> +---------------+---+ #> | h-l-h | 2 | #> +---------------+---+ #> | h-l-l | 2 | #> +---------------+---+ #> | l-NA-NA | 3 | #> +---------------+---+ #> | l-NA-l | 2 | #> +---------------+---+ #> | l-h-NA | 2 | #> +---------------+---+ #> | l-h-h | 1 | #> +---------------+---+ #> | l-h-l | 2 | #> +---------------+---+ #> | l-l-NA | 2 | #> +---------------+---+ #> | l-l-h | 3 | #> +---------------+---+ #> #> Table: Summary of user-selected exposure histories based on exposure main effects A.1, A.2, A.3: #> #> Below are the pooled average predictions by user-specified history: #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | term | A.1 | A.2 | A.3 | estimate | std.error | conf.low | conf.high | #> +=======+=======+=======+========+==========+===========+==========+===========+ #> | l-l-l | -0.47 | -0.3 | -0.804 | -0.15 | 0.2 | -0.54 | 0.239 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | l-l-h | -0.47 | -0.3 | -0.051 | -0.064 | 0.2 | -0.47 | 0.338 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | l-h-l | -0.47 | 0.31 | -0.804 | -0.093 | 0.18 | -0.44 | 0.25 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | l-h-h | -0.47 | 0.31 | -0.051 | -0.007 | 0.19 | -0.37 | 0.357 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-l-l | 0.24 | -0.3 | -0.804 | -0.235 | 0.15 | -0.53 | 0.059 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-l-h | 0.24 | -0.3 | -0.051 | -0.149 | 0.15 | -0.45 | 0.154 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-h-l | 0.24 | 0.31 | -0.804 | -0.179 | 0.13 | -0.43 | 0.07 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-h-h | 0.24 | 0.31 | -0.051 | -0.093 | 0.14 | -0.36 | 0.176 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> #> Conducting multiple comparison correction for all pairings between comparison histories and each refernece history using the BH method. #> #> #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | term | estimate | std.error | p.value | conf.low | conf.high | p.value_corr | #> +===================+===============+============+===========+=============+============+==============+ #> | (l-l-l) - (l-l-h) | -0.0860245895 | 0.09323351 | 0.3561746 | -0.26875891 | 0.09670973 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (l-h-l) | -0.0567671468 | 0.06804542 | 0.4041380 | -0.19013372 | 0.07659943 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (l-h-h) | -0.1427917364 | 0.12113186 | 0.2384729 | -0.38020583 | 0.09462235 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (h-l-l) | 0.0855518211 | 0.09515347 | 0.3686031 | -0.10094556 | 0.27204920 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (h-l-h) | -0.0004727684 | 0.12853504 | 0.9970653 | -0.25239681 | 0.25145127 | 0.9970653 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (h-h-l) | 0.0287846743 | 0.12605827 | 0.8193787 | -0.21828499 | 0.27585434 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-l) - (h-h-h) | -0.0572399153 | 0.15718786 | 0.7157462 | -0.36532245 | 0.25084262 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (l-h-l) | 0.0292574427 | 0.10941845 | 0.7891686 | -0.18519878 | 0.24371366 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (l-h-h) | -0.0567671468 | 0.06804540 | 0.4041379 | -0.19013369 | 0.07659939 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (h-l-l) | 0.1715764106 | 0.13773921 | 0.2128887 | -0.09838748 | 0.44154030 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (h-l-h) | 0.0855518211 | 0.09515351 | 0.3686033 | -0.10094562 | 0.27204927 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (h-h-l) | 0.1148092638 | 0.15639156 | 0.4628791 | -0.19171256 | 0.42133108 | 0.6480308 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-l-h) - (h-h-h) | 0.0287846743 | 0.12605825 | 0.8193786 | -0.21828496 | 0.27585431 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (l-h-h) | -0.0860245895 | 0.09323348 | 0.3561744 | -0.26875886 | 0.09670968 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (h-l-l) | 0.1423189679 | 0.10713569 | 0.1840462 | -0.06766312 | 0.35230106 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (h-l-h) | 0.0562943784 | 0.13264560 | 0.6712764 | -0.20368622 | 0.31627498 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (h-h-l) | 0.0855518211 | 0.09515354 | 0.3686034 | -0.10094568 | 0.27204932 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-l) - (h-h-h) | -0.0004727684 | 0.12853506 | 0.9970653 | -0.25239686 | 0.25145133 | 0.9970653 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-h) - (h-l-l) | 0.2283435575 | 0.15081852 | 0.1300186 | -0.06725530 | 0.52394242 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-h) - (h-l-h) | 0.1423189679 | 0.10713569 | 0.1840463 | -0.06766313 | 0.35230107 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-h) - (h-h-l) | 0.1715764106 | 0.13773922 | 0.2128888 | -0.09838750 | 0.44154032 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (l-h-h) - (h-h-h) | 0.0855518211 | 0.09515352 | 0.3686034 | -0.10094565 | 0.27204929 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-l) - (h-l-h) | -0.0860245895 | 0.09323350 | 0.3561745 | -0.26875889 | 0.09670971 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-l) - (h-h-l) | -0.0567671468 | 0.06804546 | 0.4041383 | -0.19013380 | 0.07659951 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-l) - (h-h-h) | -0.1427917364 | 0.12113192 | 0.2384731 | -0.38020594 | 0.09462247 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-h) - (h-h-l) | 0.0292574427 | 0.10941843 | 0.7891686 | -0.18519874 | 0.24371362 | 0.8824078 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-l-h) - (h-h-h) | -0.0567671468 | 0.06804543 | 0.4041381 | -0.19013374 | 0.07659945 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ #> | (h-h-l) - (h-h-h) | -0.0860245895 | 0.09323350 | 0.3561745 | -0.26875888 | 0.09670970 | 0.5955722 | #> +-------------------+---------------+------------+-----------+-------------+------------+--------------+ plot(comp) summary(comp, \"preds\") #> term A.1 A.2 A.3 estimate std.error statistic #> 1 l-l-l -0.4684962 -0.2971206 -0.80434443 -0.149799589 0.1983536 -0.75521501 #> 2 l-l-h -0.4684962 -0.2971206 -0.05134827 -0.063774999 0.2048054 -0.31139320 #> 3 l-h-l -0.4684962 0.3148300 -0.80434443 -0.093032442 0.1750306 -0.53152099 #> 4 l-h-h -0.4684962 0.3148300 -0.05134827 -0.007007852 0.1859760 -0.03768148 #> 5 h-l-l 0.2359494 -0.2971206 -0.80434443 -0.235351410 0.1502513 -1.56638563 #> 6 h-l-h 0.2359494 -0.2971206 -0.05134827 -0.149326820 0.1547615 -0.96488363 #> 7 h-h-l 0.2359494 0.3148300 -0.80434443 -0.178584263 0.1267806 -1.40860879 #> 8 h-h-h 0.2359494 0.3148300 -0.05134827 -0.092559673 0.1371105 -0.67507375 #> p.value s.value conf.low conf.high dose #> 1 0.4501200 1.15161848 -0.5385654 0.23896625 0 #> 2 0.7555017 0.40449305 -0.4651861 0.33763614 1 #> 3 0.5950578 0.74889829 -0.4360861 0.25002124 1 #> 4 0.9699416 0.04403015 -0.3715142 0.35749845 2 #> 5 0.1172584 3.09223725 -0.5298385 0.05913564 1 #> 6 0.3346031 1.57947727 -0.4526538 0.15400011 2 #> 7 0.1589509 2.65334711 -0.4270697 0.06990114 2 #> 8 0.4996289 1.00107114 -0.3612912 0.17617189 3 summary(comp, \"comps\") #> term estimate std.error statistic p.value #> 1 (l-l-l) - (l-l-h) -0.0860245895 0.09323351 -0.922678895 0.3561746 #> 2 (l-l-l) - (l-h-l) -0.0567671468 0.06804542 -0.834253748 0.4041380 #> 3 (l-l-l) - (l-h-h) -0.1427917364 0.12113186 -1.178812343 0.2384729 #> 4 (l-l-l) - (h-l-l) 0.0855518211 0.09515347 0.899092985 0.3686031 #> 5 (l-l-l) - (h-l-h) -0.0004727684 0.12853504 -0.003678129 0.9970653 #> 6 (l-l-l) - (h-h-l) 0.0287846743 0.12605827 0.228344197 0.8193787 #> 7 (l-l-l) - (h-h-h) -0.0572399153 0.15718786 -0.364149728 0.7157462 #> 8 (l-l-h) - (l-h-l) 0.0292574427 0.10941845 0.267390396 0.7891686 #> 9 (l-l-h) - (l-h-h) -0.0567671468 0.06804540 -0.834253950 0.4041379 #> 10 (l-l-h) - (h-l-l) 0.1715764106 0.13773921 1.245661352 0.2128887 #> 11 (l-l-h) - (h-l-h) 0.0855518211 0.09515351 0.899092683 0.3686033 #> 12 (l-l-h) - (h-h-l) 0.1148092638 0.15639156 0.734114205 0.4628791 #> 13 (l-l-h) - (h-h-h) 0.0287846743 0.12605825 0.228344230 0.8193786 #> 14 (l-h-l) - (l-h-h) -0.0860245895 0.09323348 -0.922679121 0.3561744 #> 15 (l-h-l) - (h-l-l) 0.1423189679 0.10713569 1.328399262 0.1840462 #> 16 (l-h-l) - (h-l-h) 0.0562943784 0.13264560 0.424396874 0.6712764 #> 17 (l-h-l) - (h-h-l) 0.0855518211 0.09515354 0.899092410 0.3686034 #> 18 (l-h-l) - (h-h-h) -0.0004727684 0.12853506 -0.003678128 0.9970653 #> 19 (l-h-h) - (h-l-l) 0.2283435575 0.15081852 1.514028672 0.1300186 #> 20 (l-h-h) - (h-l-h) 0.1423189679 0.10713569 1.328399184 0.1840463 #> 21 (l-h-h) - (h-h-l) 0.1715764106 0.13773922 1.245661276 0.2128888 #> 22 (l-h-h) - (h-h-h) 0.0855518211 0.09515352 0.899092564 0.3686034 #> 23 (h-l-l) - (h-l-h) -0.0860245895 0.09323350 -0.922678981 0.3561745 #> 24 (h-l-l) - (h-h-l) -0.0567671468 0.06804546 -0.834253253 0.4041383 #> 25 (h-l-l) - (h-h-h) -0.1427917364 0.12113192 -1.178811770 0.2384731 #> 26 (h-l-h) - (h-h-l) 0.0292574427 0.10941843 0.267390449 0.7891686 #> 27 (h-l-h) - (h-h-h) -0.0567671468 0.06804543 -0.834253622 0.4041381 #> 28 (h-h-l) - (h-h-h) -0.0860245895 0.09323350 -0.922679011 0.3561745 #> s.value conf.low conf.high dose p.value_corr #> 1 1.489343589 -0.26875891 0.09670973 0 - 1 0.5955722 #> 2 1.307080051 -0.19013372 0.07659943 0 - 1 0.5955722 #> 3 2.068102717 -0.38020583 0.09462235 0 - 2 0.5955722 #> 4 1.439859757 -0.10094556 0.27204920 0 - 1 0.5955722 #> 5 0.004240125 -0.25239681 0.25145127 0 - 2 0.9970653 #> 6 0.287397761 -0.21828499 0.27585434 0 - 2 0.8824078 #> 7 0.482479980 -0.36532245 0.25084262 0 - 3 0.8824078 #> 8 0.341594553 -0.18519878 0.24371366 1 - 1 0.8824078 #> 9 1.307080457 -0.19013369 0.07659939 1 - 2 0.5955722 #> 10 2.231828396 -0.09838748 0.44154030 1 - 1 0.5955722 #> 11 1.439859126 -0.10094562 0.27204927 1 - 2 0.5955722 #> 12 1.111292558 -0.19171256 0.42133108 1 - 2 0.6480308 #> 13 0.287397807 -0.21828496 0.27585431 1 - 3 0.8824078 #> 14 1.489344066 -0.26875886 0.09670968 1 - 2 0.5955722 #> 15 2.441859794 -0.06766312 0.35230106 1 - 1 0.5955722 #> 16 0.575021172 -0.20368622 0.31627498 1 - 2 0.8824078 #> 17 1.439858557 -0.10094568 0.27204932 1 - 2 0.5955722 #> 18 0.004240124 -0.25239686 0.25145133 1 - 3 0.9970653 #> 19 2.943210429 -0.06725530 0.52394242 2 - 1 0.5955722 #> 20 2.441859592 -0.06766313 0.35230107 2 - 2 0.5955722 #> 21 2.231828206 -0.09838750 0.44154032 2 - 2 0.5955722 #> 22 1.439858879 -0.10094565 0.27204929 2 - 3 0.5955722 #> 23 1.489343772 -0.26875889 0.09670971 1 - 2 0.5955722 #> 24 1.307079055 -0.19013380 0.07659951 1 - 2 0.5955722 #> 25 2.068101336 -0.38020594 0.09462247 1 - 3 0.5955722 #> 26 0.341594628 -0.18519874 0.24371362 2 - 2 0.8824078 #> 27 1.307079797 -0.19013374 0.07659945 2 - 3 0.5955722 #> 28 1.489343836 -0.26875888 0.09670970 2 - 3 0.5955722 comp2 <- compareHistories( fit = fit, hi_lo_cut = c(0.3, 0.6), reference = \"l-l-l\", comparison = c(\"h-h-h\", \"h-h-l\") ) print(comp2) #> Summary of Exposure Main Effects: #> Warning: There are no participants in your sample in the following histories: l-l-l. #> Please revise your reference/comparison histories and/or the high/low cutoffs, if applicable. #> USER ALERT: Out of the total of 50 individuals in the sample, below is the distribution of the 6 (12%) individuals that fall into 2 user-selected exposure histories (out of the 24 total) created from 30th and 60th percentile values for low and high levels of exposure-epoch A.1, A.2, A.3. #> USER ALERT: Please inspect the distribution of the sample across the following exposure histories and ensure there is sufficient spread to avoid extrapolation and low precision: #> #> +---------------+---+ #> | epoch_history | n | #> +===============+===+ #> | h-h-h | 3 | #> +---------------+---+ #> | h-h-l | 3 | #> +---------------+---+ #> #> Table: Summary of user-selected exposure histories based on exposure main effects A.1, A.2, A.3: #> #> Below are the pooled average predictions by user-specified history: #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | term | A.1 | A.2 | A.3 | estimate | std.error | conf.low | conf.high | #> +=======+=======+=======+========+==========+===========+==========+===========+ #> | l-l-l | -0.47 | -0.3 | -0.804 | -0.15 | 0.2 | -0.54 | 0.24 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-h-l | 0.24 | 0.31 | -0.804 | -0.179 | 0.13 | -0.43 | 0.07 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> | h-h-h | 0.24 | 0.31 | -0.051 | -0.093 | 0.14 | -0.36 | 0.18 | #> +-------+-------+-------+--------+----------+-----------+----------+-----------+ #> #> Conducting multiple comparison correction for all pairings between comparison histories and each refernece history using the BH method. #> #> #> +-------------------+-------------+-----------+-----------+------------+-----------+--------------+ #> | term | estimate | std.error | p.value | conf.low | conf.high | p.value_corr | #> +===================+=============+===========+===========+============+===========+==============+ #> | (h-h-h) - (l-l-l) | 0.05723992 | 0.1571879 | 0.7157462 | -0.2508426 | 0.3653225 | 0.8193787 | #> +-------------------+-------------+-----------+-----------+------------+-----------+--------------+ #> | (h-h-l) - (l-l-l) | -0.02878467 | 0.1260583 | 0.8193787 | -0.2758543 | 0.2182850 | 0.8193787 | #> +-------------------+-------------+-----------+-----------+------------+-----------+--------------+ plot(comp2) summary(comp2, \"preds\") #> term A.1 A.2 A.3 estimate std.error statistic #> 1 l-l-l -0.4684962 -0.2971206 -0.80434443 -0.14979959 0.1983536 -0.7552150 #> 7 h-h-l 0.2359494 0.3148300 -0.80434443 -0.17858426 0.1267806 -1.4086088 #> 8 h-h-h 0.2359494 0.3148300 -0.05134827 -0.09255967 0.1371105 -0.6750738 #> p.value s.value conf.low conf.high dose #> 1 0.4501200 1.151618 -0.5385654 0.23896625 0 #> 7 0.1589509 2.653347 -0.4270697 0.06990114 2 #> 8 0.4996289 1.001071 -0.3612912 0.17617189 3 summary(comp2, \"comps\") #> term estimate std.error statistic p.value s.value #> 1 (h-h-h) - (l-l-l) 0.05723992 0.1571879 0.3641497 0.7157462 0.4824800 #> 2 (h-h-l) - (l-l-l) -0.02878467 0.1260583 -0.2283442 0.8193787 0.2873978 #> conf.low conf.high dose p.value_corr #> 1 -0.2508426 0.3653225 3 - 0 0.8193787 #> 2 -0.2758543 0.2182850 2 - 0 0.8193787"},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":null,"dir":"Reference","previous_headings":"","what":"Create balancing formulas — createFormulas","title":"Create balancing formulas — createFormulas","text":"Creates balancing formulas relating exposure relevant time-varying time invariant confounders exposure time point used create IPTW weights.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create balancing formulas — createFormulas","text":"","code":"createFormulas( obj, type = c(\"full\", \"short\", \"update\"), custom = NULL, keep_conf = NULL, bal_stats = NULL, verbose = FALSE, save.out = FALSE ) # S3 method for class 'devMSM_formulas' print(x, ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create balancing formulas — createFormulas","text":"obj initialized MSM object initMSM() type type formula create 'full' (includes lagged time-varying confounders), 'short' (includes time-varying confounders t-1 lag ), 'update' (adds 'short' formulas imbalanced time-varying confounders lags great t-1) custom (optional) custom list formulas exposure time point (default create automatically according type) keep_conf (optional) 'short' formulas , list variable names reflecting confounders included always. bal_stats list balance statistics assessBalance() verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. x devMSM_formulas object createFormulas() ... ignored","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create balancing formulas — createFormulas","text":"list containing balancing formulas. length number exposure variables.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createFormulas.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create balancing formulas — createFormulas","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) # Full Formulas f <- createFormulas(obj, type = \"full\") print(f) #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 1, the full formula for A.1 is: #> A.1 ~ C #> #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 2, the full formula for A.2 is: #> A.2 ~ C + B.1 + A.1 #> #> USER ALERT: Please manually inspect the full balancing formula below: #> At time point 3, the full formula for A.3 is: #> A.3 ~ C + B.1 + B.2 + A.1 + A.2 # Short Formulas f <- createFormulas(obj, type = \"short\") print(f) #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 1, the short formula for A.1 is: #> A.1 ~ C #> #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 2, the short formula for A.2 is: #> A.2 ~ C + B.1 + A.1 #> #> USER ALERT: Please manually inspect the short balancing formula below that includes time-varying confounders at t-1 only: #> At time point 3, the short formula for A.3 is: #> A.3 ~ C + B.2 + A.2 # Update Formulas w <- createWeights(data = data, formulas = f) b <- assessBalance(data = data, weights = w) f <- createFormulas(obj, type = \"update\", bal_stats = b) print(f) #> USER ALERT: Please manually inspect the updated balancing formula below that includes time-varying confounders at t-1 and those greater at further lags that remained imbalanced: #> At time point 1, the update formula for A.1 is: #> A.1 ~ C #> #> USER ALERT: Please manually inspect the updated balancing formula below that includes time-varying confounders at t-1 and those greater at further lags that remained imbalanced: #> At time point 2, the update formula for A.2 is: #> A.2 ~ C + B.1 + A.1 #> #> USER ALERT: Please manually inspect the updated balancing formula below that includes time-varying confounders at t-1 and those greater at further lags that remained imbalanced: #> At time point 3, the update formula for A.3 is: #> A.3 ~ C + B.2 + A.2 + A.1"},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates IPTW balancing weights — createWeights","title":"Creates IPTW balancing weights — createWeights","text":"Creates IPTW balancing weights user-specified exposure time point using balancing formulas relate exposure time point relevant confounders.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates IPTW balancing weights — createWeights","text":"","code":"createWeights( data, formulas, method = \"glm\", verbose = FALSE, save.out = FALSE, ... ) # S3 method for class 'devMSM_weights' print(x, i = 1, ...) # S3 method for class 'devMSM_weights' plot(x, i = 1, save.out = FALSE, ...) # S3 method for class 'devMSM_weights' summary(object, i = 1, ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates IPTW balancing weights — createWeights","text":"data data wide format : data frame, list imputed data frames, mids object mice package formulas list balancing formulas time point output createFormulas() method character string weightitMSM() balancing method abbreviation (default generalized linear models propensity score weighting \"glm\") verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. ... arguments passed WeightIt::weightitMSM() summary.weightitMSM() x, object devMSM_weights object createWeights() multiply imputed datasets, selects imputation print results . Default = 1. = TRUE, imputed datasets looped . = NULL, average imputed datasets summarize . Ignored non-imputed data.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Creates IPTW balancing weights — createWeights","text":"list containing WeightIt::weightitMSM() output. length number datasets (1 data.frame number imputed datasets).","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/createWeights.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates IPTW balancing weights — createWeights","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) print(w) #> #> For the `glm` weighting method, the median weight value is 1.04 (SD = 0.41; range = 0.3-3). plot(w) # Methods from `WeightIt::weightitMSM` w <- createWeights(data = data, formulas = f, method = \"glm\") w <- createWeights(data = data, formulas = f, method = \"cbps\") w <- createWeights(data = data, formulas = f, method = \"gbm\") w <- createWeights(data = data, formulas = f, method = \"bart\") w <- createWeights(data = data, formulas = f, method = \"super\") #> Loading required package: nnls #> Warning: All algorithms have zero weight #> Warning: All metalearner coefficients are zero, predictions will all be equal to 0"},{"path":"https://istallworthy.github.io/devMSMs/reference/devMSMs-package.html","id":null,"dir":"Reference","previous_headings":"","what":"devMSMs: Implementing Marginal Structural Models with Longitudinal Data — devMSMs-package","title":"devMSMs: Implementing Marginal Structural Models with Longitudinal Data — devMSMs-package","text":"Functions implementing MSMS longitudinal data.","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/devMSMs-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"devMSMs: Implementing Marginal Structural Models with Longitudinal Data — devMSMs-package","text":"Maintainer: Isabella Stallworthy istall@seas.upenn.edu Authors: Noah Greifer noah.greifer@gmail.com (ORCID) [contributor] Meriah DeJoseph meriahd@stanford.edu Emily Padrutt padru004@umn.edu Daniel Berry dberry@umn.edu contributors: Kyle Butts buttskyle96@gmail.com [contributor]","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":null,"dir":"Reference","previous_headings":"","what":"Fit outcome model — fitModel","title":"Fit outcome model — fitModel","text":"Fits weighted marginal outcome model generalized linear model user's choosing, relating exposure main effects outcome using IPTW weights.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fit outcome model — fitModel","text":"","code":"fitModel( data, obj, weights = NULL, outcome, model = \"m0\", int_order = NA, covariates = NULL, family = gaussian(), link = \"identity\", verbose = FALSE, save.out = FALSE ) # S3 method for class 'devMSM_models' print(x, i = NA, save.out = FALSE, ...)"},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fit outcome model — fitModel","text":"data data wide format : data frame, list imputed data frames, mids object mice package obj initialized MSM object initMSM() weights list IPTW weights output createWeights() outcome name outcome variable \".timepoint\" suffix. See initMSM() details suffix model character indicating one following outcome models: \"m0\" (exposure main effects) \"m1\" (exposure main effects & covariates) \"m2\" (exposure main effects & interactions) \"m3\" (exposure main effects, interactions, & covariates) int_order integer specification highest order exposure main effects interaction, required interaction models (\"m2\", \"m3\") covariates list characters reflecting variable names covariates, required covariate models (\"m1\", \"m3\") family (optional) family function specification WeightIt::glm_weightit() model. link (optional) link function specification WeightIt::glm_weightit() model. verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE. x devMSM_models object fitModel multiply imputed datasets, selects imputation print results . Default = 1. = TRUE, imputed datasets looped . = NULL, average imputed datasets summarize . Ignored non-imputed data. ... ignored","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fit outcome model — fitModel","text":"list containing WeightIt::glm_weightit() model output. length number datasets (1 data.frame number imputed datasets)","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/fitModel.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fit outcome model — fitModel","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) fit_m0 <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m0\" ) print(fit_m0) #> Please inspect the Wald test to determine if the exposures collectively predict significant variation in the outcome compared to a model without exposure terms. #> We strongly suggest only conducting history comparisons if the test is significant. #> #> Wald test #> Variance: HC0 robust (adjusted for estimation of weights) #> #> Model 1: D.3 ~ A.1 + A.2 + A.3 #> Model 2: D.3 ~ 1 #> #> Res.Df Df Chisq Pr(>Chisq) #> 1 46 #> 2 49 3 17.511 0.0005548 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> #> The marginal model, m0, is summarized below: #> +-------------+--------+-----------------+-------+ #> | | (1) | #> +-------------+--------+-----------------+-------+ #> | | Est. | CI | p | #> +=============+========+=================+=======+ #> | (Intercept) | 0.224 | [-0.011, 0.460] | 0.062 | #> +-------------+--------+-----------------+-------+ #> | A.1 | 0.350 | [0.141, 0.560] | 0.001 | #> +-------------+--------+-----------------+-------+ #> | A.2 | -0.186 | [-0.432, 0.060] | 0.139 | #> +-------------+--------+-----------------+-------+ #> | A.3 | -0.284 | [-0.682, 0.114] | 0.163 | #> +-------------+--------+-----------------+-------+ #> | Num.Obs. | 50 | | | #> +-------------+--------+-----------------+-------+ fit_m1 <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m1\", covariates = c(\"C\") ) print(fit_m1) #> Please inspect the Wald test to determine if the exposures collectively predict significant variation in the outcome compared to a model without exposure terms. #> We strongly suggest only conducting history comparisons if the test is significant. #> #> Wald test #> Variance: HC0 robust (adjusted for estimation of weights) #> #> Model 1: D.3 ~ A.1 + A.2 + A.3 + C #> Model 2: D.3 ~ C #> #> Res.Df Df Chisq Pr(>Chisq) #> 1 45 #> 2 48 3 17.633 0.0005236 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> #> The marginal model, m1, is summarized below: #> +-------------+--------+-----------------+--------+ #> | | (1) | #> +-------------+--------+-----------------+--------+ #> | | Est. | CI | p | #> +=============+========+=================+========+ #> | (Intercept) | 0.222 | [-0.013, 0.458] | 0.064 | #> +-------------+--------+-----------------+--------+ #> | A.1 | 0.352 | [0.143, 0.561] | <0.001 | #> +-------------+--------+-----------------+--------+ #> | A.2 | -0.185 | [-0.432, 0.062] | 0.142 | #> +-------------+--------+-----------------+--------+ #> | A.3 | -0.287 | [-0.689, 0.116] | 0.163 | #> +-------------+--------+-----------------+--------+ #> | C | -0.044 | [-0.277, 0.188] | 0.708 | #> +-------------+--------+-----------------+--------+ #> | Num.Obs. | 50 | | | #> +-------------+--------+-----------------+--------+ fit_m2 <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m2\", int_order = 2 ) print(fit_m2) #> Please inspect the Wald test to determine if the exposures collectively predict significant variation in the outcome compared to a model without exposure terms. #> We strongly suggest only conducting history comparisons if the test is significant. #> #> Wald test #> Variance: HC0 robust (adjusted for estimation of weights) #> #> Model 1: D.3 ~ A.1 + A.2 + A.3 + A.1 + A.2 + A.3 + A.1:A.2 + A.1:A.3 + A.2:A.3 #> Model 2: D.3 ~ 1 #> #> Res.Df Df Chisq Pr(>Chisq) #> 1 43 #> 2 49 6 19.785 0.003024 ** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> #> The marginal model, m2, is summarized below: #> +-------------+--------+-----------------+-------+ #> | | (1) | #> +-------------+--------+-----------------+-------+ #> | | Est. | CI | p | #> +=============+========+=================+=======+ #> | (Intercept) | 0.207 | [-0.031, 0.446] | 0.089 | #> +-------------+--------+-----------------+-------+ #> | A.1 | 0.404 | [0.161, 0.647] | 0.001 | #> +-------------+--------+-----------------+-------+ #> | A.2 | -0.145 | [-0.420, 0.131] | 0.303 | #> +-------------+--------+-----------------+-------+ #> | A.3 | -0.318 | [-0.650, 0.013] | 0.060 | #> +-------------+--------+-----------------+-------+ #> | A.1 × A.2 | 0.234 | [-0.036, 0.505] | 0.089 | #> +-------------+--------+-----------------+-------+ #> | A.1 × A.3 | -0.018 | [-0.364, 0.328] | 0.918 | #> +-------------+--------+-----------------+-------+ #> | A.2 × A.3 | 0.247 | [-0.090, 0.584] | 0.152 | #> +-------------+--------+-----------------+-------+ #> | Num.Obs. | 50 | | | #> +-------------+--------+-----------------+-------+ fit_m3 <- fitModel( data = data, weights = w, outcome = \"D.3\", model = \"m3\", int_order = 2, covariates = c(\"C\") ) print(fit_m3) #> Please inspect the Wald test to determine if the exposures collectively predict significant variation in the outcome compared to a model without exposure terms. #> We strongly suggest only conducting history comparisons if the test is significant. #> #> Wald test #> Variance: HC0 robust (adjusted for estimation of weights) #> #> Model 1: D.3 ~ A.1 + A.2 + A.3 + A.1 + A.2 + A.3 + C + A.1:A.2 + A.1:A.3 + A.1:C + A.2:A.3 + A.2:C + A.3:C #> Model 2: D.3 ~ C #> #> Res.Df Df Chisq Pr(>Chisq) #> 1 39 #> 2 48 9 23.536 0.005098 ** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> #> The marginal model, m3, is summarized below: #> +-------------+--------+------------------+--------+ #> | | (1) | #> +-------------+--------+------------------+--------+ #> | | Est. | CI | p | #> +=============+========+==================+========+ #> | (Intercept) | 0.187 | [-0.058, 0.432] | 0.134 | #> +-------------+--------+------------------+--------+ #> | A.1 | 0.422 | [0.182, 0.662] | <0.001 | #> +-------------+--------+------------------+--------+ #> | A.2 | -0.126 | [-0.411, 0.159] | 0.387 | #> +-------------+--------+------------------+--------+ #> | A.3 | -0.353 | [-0.654, -0.053] | 0.021 | #> +-------------+--------+------------------+--------+ #> | C | -0.137 | [-0.360, 0.087] | 0.231 | #> +-------------+--------+------------------+--------+ #> | A.1 × A.2 | 0.238 | [-0.067, 0.542] | 0.126 | #> +-------------+--------+------------------+--------+ #> | A.1 × A.3 | 0.013 | [-0.352, 0.377] | 0.946 | #> +-------------+--------+------------------+--------+ #> | A.1 × C | 0.156 | [-0.102, 0.414] | 0.236 | #> +-------------+--------+------------------+--------+ #> | A.2 × A.3 | 0.281 | [-0.051, 0.614] | 0.097 | #> +-------------+--------+------------------+--------+ #> | A.2 × C | 0.199 | [-0.055, 0.454] | 0.124 | #> +-------------+--------+------------------+--------+ #> | A.3 × C | -0.080 | [-0.432, 0.271] | 0.655 | #> +-------------+--------+------------------+--------+ #> | Num.Obs. | 50 | | | #> +-------------+--------+------------------+--------+"},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":null,"dir":"Reference","previous_headings":"","what":"Initial step in devMSMs workflow — initMSM","title":"Initial step in devMSMs workflow — initMSM","text":"Initial step devMSMs workflow","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initial step in devMSMs workflow — initMSM","text":"","code":"initMSM( data, exposure, epoch = NULL, tv_conf, ti_conf = NULL, concur_conf = NULL, home_dir = NULL, sep = \"[\\\\._]\" )"},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initial step in devMSMs workflow — initMSM","text":"data data wide format : data frame, list imputed data frames, mids object mice package exposure names exposure variables \".timepoint\" suffix epoch (optional) group set exposure variables categories. Provide character vector corresponding category exposure tv_conf list time-varying confounders \".timepoint\" suffix, include exposure outcome variables (least time-varying exposure variables required ) ti_conf list time invariant confounders. Can left NULL none. concur_conf (optional) list variable names reflecting time-varying confounders retain formulas contemporaneously (default none) home_dir (optional) directory saving output. Either absolute path relative path respect getwd() sep (optional) seperator variable time period. variable names split last occurance sep second string containing time. uses regex notation, . must \\\\.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initial step in devMSMs workflow — initMSM","text":"object class devMSM contains initialized information.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Initial step in devMSMs workflow — initMSM","text":".timepoint suffix, mean time-varying exposure variable names must end either .# _#. allows us extract time-period variable measured allow us properly create formulae (omitting future mediators)","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/initMSM.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Initial step in devMSMs workflow — initMSM","text":"","code":"data <- data.frame( A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), D.3 = rnorm(n = 50), L.1 = sample(c(0, 1), size = 50, replace = TRUE), C = rnorm(n = 50) ) obj <- initMSM( data = data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\"), ti_conf = \"C\" ) obj #> Exposure (continuous): A.1, A.2, A.3 #> Variable and their encodings: #> var type time #> A.1 exposure 1 #> A.2 exposure 2 #> A.3 exposure 3 #> B.1 tv_conf 1 #> B.2 tv_conf 2 #> B.3 tv_conf 3 #> D.3 tv_conf 3 #> C ti_conf -1"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_imp_list.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","title":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package imputing mice package reading imputed dataset. data contain economic strain (ESEATA1) continuously distributed variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_imp_list.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","text":"","code":"sim_data_imp_list"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_imp_list.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_imp_list.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide data imputed and read in (continuous exposure) — sim_data_imp_list.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","title":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package. data contain economic strain (ESEATA1) continuously distributed variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","text":"","code":"sim_data_long_miss"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","text":"long data frame 6, 458 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"WAVE\" age (months) data collected \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Long data with missingness (continuous exposure) — sim_data_long_miss.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss_bin.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Long data with missingness (binary exposure) — sim_data_long_miss_bin.rda","title":"Long data with missingness (binary exposure) — sim_data_long_miss_bin.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package. data contain economic strain (ESEATA1) binary variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss_bin.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Long data with missingness (binary exposure) — sim_data_long_miss_bin.rda","text":"","code":"sim_data_long_miss_bin"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_long_miss_bin.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Long data with missingness (binary exposure) — sim_data_long_miss_bin.rda","text":"long data frame 6,458 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"WAVE\" age (months) data collected \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety #' @references DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_mice.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","title":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package prior imputation using mice via random forest. data contain economic strain (ESEATA1) continuously distributed variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_mice.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","text":"","code":"sim_data_mice"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_mice.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_mice.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide data imputed with mice (continuous exposure) — sim_data_mice.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","title":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","text":"Wide complete data (continuous exposure) data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). data contain economic strain (ESEATA1) continuously distributed variable missing data.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","text":"","code":"sim_data_wide"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide complete data (continuous exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a continuously distributed variable and have no missing data. — sim_data_wide.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_bin.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","title":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","text":"Wide complete data (binary exposure) data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). data contain economic strain (ESEATA1) binary variable, missing data.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_bin.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","text":"","code":"sim_data_wide_bin"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_bin.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_bin.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide complete data (binary exposure) These data are simulated based on data from the Family Life Project (FLP), a longitudinal study following 1,292 families representative of two geographic areas (three counties in North Carolina and three counties in Pennsylvania) with high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). These data contain economic strain (ESEATA1) as a binary variable, and have no missing data. — sim_data_wide_bin.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","title":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package. data contain economic strain (ESEATA1) continuously distributed variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","text":"","code":"sim_data_wide_miss"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide data with missingness (continuous exposure) — sim_data_wide_miss.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss_bin.rda.html","id":null,"dir":"Reference","previous_headings":"","what":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","title":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","text":"data simulated based data Family Life Project (FLP), longitudinal study following 1,292 families representative two geographic areas (three counties North Carolina three counties Pennsylvania) high rural child poverty (Vernon-Feagans et al., 2013; Burchinal et al., 2008). MAR missingness added using missMethods package. data contain economic strain (ESEATA1) binary variable.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss_bin.rda.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","text":"","code":"sim_data_wide_miss_bin"},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss_bin.rda.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","text":"wide data frame 1,292 observations 36 measured variables collected one following time points: 6, 15, 24, 35, 58 months. \"ID\" subject id \"ESETA1\" continuous exposure economic strain \"StrDif_Tot.58\" continuous outcome behavioral problems \"InRatioCor\" continuous income--needs ratio \"PmEd2\" parent's education level (0-11 = less high school, 12 = GED, 13 = GED additional training, 14 = high school grad, 15 = high school additional training, 16 = college, 17 = associates degree, 18 = four year college degree, 19 = post college, 20 = masters degree, 21 = professional degree, 22 = PhD) \"state\" family's state residence (NC = North Carolina, PA = Pennslyvania) \"TcBlac2\" child's race (1 = Black, 0 = White) \"bioDadInHH2\" whether biological father lives family (1 = yes, 0 = ) \"HomeOwnd\" whether family owns home (1 = owned bought family, 2 = owned bought someone else, 3 = rented rent, 4 = occupied without payment rent) \"KFASTScr\" continuous score caregiver reading comprehension \"PmBlac2\" primary caregiver's race (1 = Black, 0 = White) \"PmAge2\" primary caregiver age years \"PmMrSt2\" caregiver marital status (1 = single, 2 = married living spouse, 3 = married living spouse, 4 = divorced, 5 = separated, 6 = widowed) \"RMomAgeU\" continuous age years biological mother caregiver born \"RHealth\" index general caregiver health (1 = excellent, 2 = good, 3 = good, 4 = fair, 5 = poor) \"RHasSO\" whether caregiver significant (1 = yes, 0 = ) \"SmokTotl\" total cigarettes biological mother smoked pregnant (1 = 21 cigarettes less, 2 = 2 - 99 cigarettes, 3 = 100 cigarettes) \"caregiv_health\" sum score caregiver health problems including emotional problems, ADHD, asthma, cancer, high blood pressure, limited mobility, learning disability, general subjective health, mental health, overwight, seizures, depression, diabetes \"peri_health\" sum score pregnancy/birth health including excessive vomitting, fetal distress, colic, alcohol, high blood pressure, heavy bleeding, infection, congenital issues, stay pediatric intensive care, labor induction, independent breathing birth, surgery, NICU, smoked pregnant, breach, excessive weight loss, incubation, water retention, c-section \"SWghtLB\" child birth weight pounds \"SurpPreg\" whether caregiver surprise pregnancy (1 = yes, 0 = ) \"DrnkFreq\" frequently caregiver drank pregnant (1 = never, 2 = twice, 3 = month, 4 = twice month, 5 = couple times/week, 6 = everyday) \"gov_assist\" sum score whether family received government benefits including early headstart, early intervention, food stamps, subsidized childcare, heating assistance, government housing, transportation, school free lunch, WIC, AFDC \"ALI_LE\" continuous child language expression \"B18Raw\" continuous caregiver total depression problems \"CORTB\" continuous child salivary cortisol rest \"EARS_TJo\" \"fscore\" continuous executive function factor score \"HOMEETA1\" continuous sociocognitive resources factor score \"IBRAttn\" continuous child total joint attention \"LESMnNeg\" continuous family negative life events \"LESMnPos\" continuous family positive life events \"MDI\" continuous child Bayely mental development index \"RHAsSO\" whether caregiver significant given time (1 = yes, 0 = ) \"SAAmylase\" continuous child salivary alpha amylase rest \"WndNbrhood\" continuous neighborhood safety","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/sim_data_wide_miss_bin.rda.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Wide data with missingness (binary exposure) — sim_data_wide_miss_bin.rda","text":"DeJoseph, M. L., Sifre, R. D., Raver, C. C., Blair, C. B., & Berry, D. (2021). Capturing Environmental Dimensions Adversity Resources Context Poverty Across Infancy Early Adolescence: Moderated Nonlinear Factor Model. Child Development, n/(n/). https://doi.org/10.1111/cdev.13504 Burchinal, M., Howes, C., Pianta, R., Bryant, D., Early, D., Clifford, R., & Barbarin, O. (2008). Predicting Child Outcomes End Kindergarten Quality Pre-Kindergarten Teacher–Child Interactions Instruction. Applied Developmental Science, 12(3), 140–153. https://doi.org/10.1080/10888690802199418 Vernon-Feagans, L., Cox, M., Willoughby, M., Burchinal, M., Garrett-Peters, P., Mills-Koonce, R., Garrett-Peiers, P., Conger, R. D., & Bauer, P. J. (2013). Family Life Project: Epidemiological Developmental Study Young Children Living Poor Rural Communities. Monographs Society Research Child Development, 78(5), –150. Willoughby, M. T., Blair, C. B., Wirth, R. J., & Greenberg, M. (2010). measurement executive function age 3 years: psychometric properties criterion validity new battery tasks. Psychological assessment, 22(2), 306.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim IPTW balancing weights, if needed — trimWeights","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"Trims IPTW balancing weights heavy right tails populating weight values given quantile weight value quantile.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"","code":"trimWeights(weights, at = 0, lower = FALSE, verbose = FALSE, save.out = FALSE)"},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"weights list IPTW weights output createWeights() numeric; either quantile weights weights trimmed. single number .5 1, number weights trimmed (e.g., = 3 top 3 weights set 4th largest weight). lower logical; whether also trim lower quantile (e.g., = .9, trimming .1 .9, = 3, trimming top bottom 3 weights). Default FALSE trim higher weights. verbose (optional) TRUE FALSE indicator printing output console. default FALSE. save.(optional) Either logical character string. TRUE, output result default file name within home_dir set initMSM(). can load data x <- readRDS(file). use non-default file name, specify character string file name. save relative home_dir. might naming conflicts two objects get saved file. cases, users specify custom name. default FALSE.","code":""},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"list containing WeightIt::weightitMSM() output. length number datasets (1 data.frame number imputed datasets).","code":""},{"path":[]},{"path":"https://istallworthy.github.io/devMSMs/reference/trimWeights.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trim IPTW balancing weights, if needed — trimWeights","text":"","code":"library(devMSMs) data <- data.frame( ID = 1:50, A.1 = rnorm(n = 50), A.2 = rnorm(n = 50), A.3 = rnorm(n = 50), B.1 = rnorm(n = 50), B.2 = rnorm(n = 50), B.3 = rnorm(n = 50), C = rnorm(n = 50), D.3 = rnorm(n = 50) ) obj <- initMSM( data, exposure = c(\"A.1\", \"A.2\", \"A.3\"), ti_conf = c(\"C\"), tv_conf = c(\"B.1\", \"B.2\", \"B.3\", \"D.3\") ) f <- createFormulas(obj, type = \"short\") w <- createWeights(data = data, formulas = f) tw <- trimWeights(w, at = 0.975) print(tw) #> #> For the `glm` weighting method, after trimming at 97.5th quantile, the median weight value is 0.97 (SD = 0.32; range = 0.43-2). plot(tw) trimWeights(w, at = 0.975, lower = TRUE) #> #> For the `glm` weighting method, after trimming between 2.5th and 97.5th quantiles, the median weight value is 0.97 (SD = 0.32; range = 0.43-2)."}] diff --git a/sitemap.xml b/sitemap.xml index f1a83a47..c165c06a 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1,6 +1,7 @@ https://istallworthy.github.io/devMSMs/404.html https://istallworthy.github.io/devMSMs/articles/Assessing_Balance_Tv.html +https://istallworthy.github.io/devMSMs/articles/Customize_Balancing_Formulas.html https://istallworthy.github.io/devMSMs/articles/index.html https://istallworthy.github.io/devMSMs/authors.html https://istallworthy.github.io/devMSMs/index.html From 979d6561f6aac0517bc085361d102ef38c181460 Mon Sep 17 00:00:00 2001 From: "Isabella Stallworthy, PhD" Date: Tue, 8 Oct 2024 11:25:28 -0400 Subject: [PATCH 2/2] Update _pkgdown.yml --- _pkgdown.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_pkgdown.yml b/_pkgdown.yml index 5756995e..426ad680 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -23,5 +23,5 @@ navbar: menu: - text: Assessing Balance for Time-Varying Exposures href: articles/Assessing_Balance_Tv.html - # - text: Customizing Weights Formulas - # href: articles/Customizing_Balancing_Formulas.html + - text: Customizing Weights Formulas + href: articles/Customizing_Balancing_Formulas.html