| Title: | Bayesian Distributed Lag Interaction Models | 
| Version: | 0.5.0 | 
| Date: | 2025-06-09 | 
| Description: | Estimation and interpretation of Bayesian distributed lag interaction models (BDLIMs). A BDLIM regresses a scalar outcome on repeated measures of exposure and allows for modification by a categorical variable under four specific patterns of modification. The main function is bdlim(). There are also summary and plotting files. Details on methodology are described in Wilson et al. (2017) <doi:10.1093/biostatistics/kxx002>. | 
| License: | GPL (≥ 3) | 
| Encoding: | UTF-8 | 
| Imports: | LaplacesDemon, ggplot2, parallel, BayesLogit | 
| RoxygenNote: | 7.3.2 | 
| BugReports: | https://github.com/anderwilson/bdlim/issues/ | 
| URL: | https://anderwilson.github.io/bdlim/, https://github.com/AnderWilson/bdlim/ | 
| Depends: | R (≥ 2.10) | 
| LazyData: | true | 
| NeedsCompilation: | no | 
| Packaged: | 2025-06-10 22:16:40 UTC; anderwilson | 
| Author: | Ander Wilson | 
| Maintainer: | Ander Wilson <ander.wilson@colostate.edu> | 
| Repository: | CRAN | 
| Date/Publication: | 2025-06-11 03:00:02 UTC | 
bdlim: Bayesian Distributed Lag Interaction Models
Description
 
Estimation and interpretation of Bayesian distributed lag interaction models (BDLIMs). A BDLIM regresses a scalar outcome on repeated measures of exposure and allows for modification by a categorical variable under four specific patterns of modification. The main function is bdlim(). There are also summary and plotting files. Details on methodology are described in Wilson et al. (2017) doi:10.1093/biostatistics/kxx002.
Details
The main function is bdlim4.
Author(s)
Maintainer: Ander Wilson ander.wilson@colostate.edu (ORCID)
References
Wilson A, Chiu YM, Hsu HL, Wright RO, Wright RJ, Coull BA (2017). “Bayesian distributed lag interaction models to identify perinatal windows of vulnerability in children's health.” Biostatistics, 18(3), 537–552. doi:10.1093/biostatistics/kxx002. arXiv preprint.
See Also
Useful links:
- Report bugs at https://github.com/anderwilson/bdlim/issues/ 
Fit the BDLIM model with 1 pattern of modification
Description
Fit the BDLIM model with 1 pattern of modification
Usage
bdlim1(
  y,
  exposure,
  covars,
  group,
  id = NULL,
  w_free,
  b_free,
  df,
  nits,
  nburn = round(nits/2),
  nthin = 1,
  progress = TRUE
)
Arguments
| y | A vector of outcomes | 
| exposure | A matrix of exposures with one row for each individual | 
| covars | A matrix or data.frame of covariates This should not include the grouping factor (see group below). This may include factor variables. | 
| group | A vector of group memberships. This should be a factor variable. | 
| id | An optional vector of individual IDs if there are repeated measures or other groupings that a random intercept should be included for. This must be a factor variable. | 
| w_free | Logical indicating if the weight functions are shared by all groups (FALSE) or group-specific (TRUE). | 
| b_free | Logical indicating if the effect sizes are shared by all groups (FALSE) or group-specific (TRUE). | 
| df | Degrees of freedom for the weight functions | 
| nits | Number of MCMC iterations. | 
| nburn | Number of MCMC iterations to be discarded as burn in. The default is half if the MCMC iterations. This is only used for WAIC in this function but is passed to summary and plot functions and used there. | 
| nthin | Thinning factors for the MCMC. This is only used for WAIC in this function but is passed to summary and plot functions and used there. | 
| progress | Logical indicating if a progress bar should be shown during MCMC iterations. Default is TRUE. | 
Value
A list with posteriors of parameters
Examples
# run BDLIM with modification by ChildSex
fit_sex <- bdlim1(
  y = sbd_bdlim$bwgaz,
  exposure = sbd_bdlim[,paste0("pm25_",1:37)],
  covars = sbd_bdlim[,c("MomPriorBMI","MomAge","race","Hispanic",
                                   "EstMonthConcept","EstYearConcept")],
  group = as.factor(sbd_bdlim$ChildSex),
  w_free = TRUE,
  b_free = TRUE,
  df = 5,
  nits = 5000
)
# show model fit results
fit_sex
#summarize results
sfit_sex <- summary(fit_sex)
sfit_sex
# graph the estimated distributed lag functions for each group
plot(sfit_sex)
# run BDLIM with no modification
# here a single group is put in for group
# the group must be a factor
# w_free and b_free must be FALSE because modification is not allowed with only one group
fit_onegroup <- bdlim1(
  y = sbd_bdlim$bwgaz,
  exposure = sbd_bdlim[,paste0("pm25_",1:37)],
  covars = sbd_bdlim[,c("MomPriorBMI","MomAge","race","Hispanic",
                        "EstMonthConcept","EstYearConcept")],
  group = as.factor(rep("A",nrow(sbd_bdlim))),
  w_free = FALSE,
  b_free = FALSE,
  df = 5,
  nits = 5000
)
# show model fit results
fit_onegroup
#summarize results
sfit_onegroup <- summary(fit_onegroup)
sfit_onegroup
# graph the estimated distributed lag functions for the one group
plot(sfit_onegroup)
# extract the weight function
getw(fit_onegroup)
Fit the BDLIM model with 1 pattern of modification with logistic regression
Description
Fit the BDLIM model with 1 pattern of modification with logistic regression
Usage
bdlim1_logistic(
  y,
  exposure,
  covars,
  group,
  id = NULL,
  w_free,
  b_free,
  df,
  nits,
  nburn = round(nits/2),
  nthin = 1,
  progress = TRUE
)
Arguments
| y | A vector of binary outcomes | 
| exposure | A matrix of exposures with one row for each individual | 
| covars | A matrix or data.frame of covariates This should not include the grouping factor (see group below). This may include factor variables. | 
| group | A vector of group memberships. This should be a factor variable. | 
| id | An optional vector of individual IDs if there are repeated measures or other groupings that a random intercept should be included for. This must be a factor variable. | 
| w_free | Logical indicating if the weight functions are shared by all groups (FALSE) or group-specific (TRUE). | 
| b_free | Logical indicating if the effect sizes are shared by all groups (FALSE) or group-specific (TRUE). | 
| df | Degrees of freedom for the weight functions | 
| nits | Number of MCMC iterations. | 
| nburn | Number of MCMC iterations to be discarded as burn in. The default is half if the MCMC iterations. This is only used for WAIC in this function but is passed to summary and plot functions and used there. | 
| nthin | Thinning factors for the MCMC. This is only used for WAIC in this function but is passed to summary and plot functions and used there. | 
| progress | Logical indicating if a progress bar should be shown during MCMC iterations. Default is TRUE. | 
Value
A list with posteriors of parameters
Fit the BDLIM model with all 4 patterns of modification
Description
Fit the BDLIM model with all 4 patterns of modification
Usage
bdlim4(
  y,
  exposure,
  covars,
  group,
  id = NULL,
  df,
  nits,
  nburn = round(nits/2),
  nthin = 1,
  parallel = FALSE,
  family = "gaussian"
)
Arguments
| y | A vector of outcomes | 
| exposure | A matrix of exposures with one row for each individual | 
| covars | A matrix or data.frame of covariates This should not include the grouping factor (see group below). This may include factor variables. | 
| group | A vector of group memberships. This should be a factor variable. | 
| id | An optional vector of individual IDs if there are repeated measures or other groupings that a random intercept should be included for. This must be a factor variable. | 
| df | Degrees of freedom for the weight functions | 
| nits | Number of MCMC iterations. | 
| nburn | Number of MCMC iterations to be discarded as burn in. The default is half if the MCMC iterations. This is only used for WAIC in this function but is passed to summary and plot functions and used there. | 
| nthin | Thinning factors for the MCMC. This is only used for WAIC in this function but is passed to summary and plot functions and used there. | 
| parallel | Logical to use parallel computing for 4 models. If TRUE then the min of 4 and number of cores available will be used. | 
| family | Family of model to be used. Supported options are "gaussian" for a normal/Gaussian linear model and "binomial" for a logistic model. | 
Value
A list of results from each different pattern of modification and model compassion metrics
Examples
# run BDLIM with modification by ChildSex
fit_sex <- bdlim4(
  y = sbd_bdlim$bwgaz,
  exposure = sbd_bdlim[,paste0("pm25_",1:37)],
  covars = sbd_bdlim[,c("MomPriorBMI","MomAge","race","Hispanic",
                                   "EstMonthConcept","EstYearConcept")],
  group = as.factor(sbd_bdlim$ChildSex),
  df = 5,
  nits = 5000,
  parallel = FALSE
)
# show model comparison results
fit_sex
#summarize results
sfit_sex <- summary(fit_sex)
sfit_sex
# graph the estimated distributed lag functions for each group
plot(sfit_sex)
Get weight function
Description
Get weight function
Usage
getw(object, type = "normal", ...)
Arguments
| object | An object of class bdlim1. | 
| type | Type of summary. The default is 'normal' which returns a summary with the mean projected to conform with the norm 1 constraint. Others are  | 
| ... | Not used. | 
Value
A data frame with either the summary of the weight function (types normal and raw) or a posterior sample of the weight function (type full).
Make orthonomal basis for weight functions
Description
Make orthonomal basis for weight functions
Usage
makebasis(exposure, df)
Arguments
| exposure | Matrix of repeated measures of exposure that is n x T where n is the number of observations and T is the number of time points. | 
| df | Degrees of freedom (including intercept) for the natural spline basis to be used. | 
Value
A matrix with orthonormal basis expansions of exposure time. The matrix is T x df. These have the span of natural splines with an intercept and df degrees of freedom.
Examples
  B <- makebasis(sbd_bdlim[,paste0("pm25_",1:37)], df=4)
Model comparison for bdlim objects
Description
Model comparison for bdlim objects
Usage
modelcompare(object)
Arguments
| object | An object of class bdlim4 obtained from the bdlim4 function. | 
Value
A vector of model probabilities.
Plot for Summary of BDLIM (summary.bdlim1 version)
Description
Plot for Summary of BDLIM (summary.bdlim1 version)
Usage
## S3 method for class 'summary.bdlim1'
plot(x, ...)
Arguments
| x | An object of class summary.bdlim1. | 
| ... | Not used. | 
Value
An ggplot2 figure.
Examples
# run BDLIM with modification by ChildSex
fit_sex <- bdlim4(
  y = sbd_bdlim$bwgaz,
  exposure = sbd_bdlim[,paste0("pm25_",1:37)],
  covars = sbd_bdlim[,c("MomPriorBMI","MomAge","race","Hispanic",
                                      "EstMonthConcept","EstYearConcept")],
  group = as.factor(sbd_bdlim$ChildSex),
  df = 5,
  nits = 5000,
  parallel = FALSE
)
# show model comparison results
fit_sex
#summarize results
sfit_sex <- summary(fit_sex)
# graph the estimated distributed lag functions for each group
plot(sfit_sex)
# can save plot as an object and modify with ggplot2
library(ggplot2)
plt <- plot(sfit_sex)
plt + ggtitle("My plot with BDLIM") +
 ylab("Estimated expected difference in\nBWGAZ per 1 ug/m3 increase in exposure")
# the summary file has the data to make this plot
head(sfit_sex$dlfun)
Plot for Summary of BDLIM
Description
Plot for Summary of BDLIM
Usage
## S3 method for class 'summary.bdlim4'
plot(x, ...)
Arguments
| x | An object of class summary.bdlim4. | 
| ... | Not used. | 
Value
An ggplot2 figure.
Examples
# run BDLIM with modification by ChildSex
fit_sex <- bdlim4(
  y = sbd_bdlim$bwgaz,
  exposure = sbd_bdlim[,paste0("pm25_",1:37)],
  covars = sbd_bdlim[,c("MomPriorBMI","MomAge","race","Hispanic",
                                      "EstMonthConcept","EstYearConcept")],
  group = as.factor(sbd_bdlim$ChildSex),
  df = 5,
  nits = 5000,
  parallel = FALSE
)
# show model comparison results
fit_sex
#summarize results
sfit_sex <- summary(fit_sex)
# graph the estimated distributed lag functions for each group
plot(sfit_sex)
# can save plot as an object and modify with ggplot2
library(ggplot2)
plt <- plot(sfit_sex)
plt + ggtitle("My plot with BDLIM") +
 ylab("Estimated expected difference in\nBWGAZ per 1 ug/m3 increase in exposure")
# the summary file has the data to make this plot
head(sfit_sex$dlfun)
Print Results
Description
Print Results
Usage
## S3 method for class 'bdlim1'
print(x, ...)
Arguments
| x | An object of class bdlim1. | 
| ... | Not used. | 
Value
Assorted model output.
Print Results
Description
Print Results
Usage
## S3 method for class 'bdlim4'
print(x, ...)
Arguments
| x | An object of class bdlim4. | 
| ... | Not used. | 
Value
Assorted model output.
Print Summary of bdlim4
Description
Print Summary of bdlim4
Usage
## S3 method for class 'summary.bdlim4'
print(x, ...)
Arguments
| x | An object of class summary.bdlim4. | 
| ... | Not used. | 
Value
Assorted model output.
Simulated Birth Data
Description
A dataset containing simulated birth data for examples with bdlim. Add outcome and covariate data is simulated. The exposure data is real exposure data. Therefore, it has realistic correlation structure. The exposures are consistent with the date of conception variables. Each exposure is scaled by its IQR.
Usage
sbd_bdlim
Format
A data frame with 1000 rows (observations) and 202 variables:
- bwgaz
- Outcome to be used. Simulated birth weight for gestational age z-score. 
- ChildSex
- Binary sex of child. 
- MomAge
- Continuous age in years. 
- GestAge
- Continuous estimated gestational age at birth in weeks. 
- MomHeightIn
- Continuous maternal height in inches. 
- MomPriorWeightLbs
- Continuous mothers pre-pregnancy weight in pounds. 
- MomPriorBMI
- Continuous mothers pre-pregnancy BMI. 
- race
- Categorical race. 
- Hispanic
- Binary indicator of Hispanic. 
- MomEdu
- Categorical maternal heighest educational attainment. 
- SmkAny
- Binary indicator of any smoking during pregnancy. 
- Marital
- Categorical maternal marital status. 
- Income
- Categorical income. 
- EstDateConcept
- Estimated date of conception. 
- EstMonthConcept
- Estimated month of conception. 
- EstYearConcept
- Estimated year of conception. 
- pm25_1
- Exposure to be used. Weekly average exposure to PM2.5 in week 1 of gestation. 
- pm25_2
- Exposure to be used. Weekly average exposure to PM2.5 in week 2 of gestation. 
- pm25_3
- Exposure to be used. Weekly average exposure to PM2.5 in week 3 of gestation. 
- pm25_4
- Exposure to be used. Weekly average exposure to PM2.5 in week 4 of gestation. 
- pm25_5
- Exposure to be used. Weekly average exposure to PM2.5 in week 5 of gestation. 
- pm25_6
- Exposure to be used. Weekly average exposure to PM2.5 in week 6 of gestation. 
- pm25_7
- Exposure to be used. Weekly average exposure to PM2.5 in week 7 of gestation. 
- pm25_8
- Exposure to be used. Weekly average exposure to PM2.5 in week 8 of gestation. 
- pm25_9
- Exposure to be used. Weekly average exposure to PM2.5 in week 9 of gestation. 
- pm25_10
- Exposure to be used. Weekly average exposure to PM2.5 in week 10 of gestation. 
- pm25_11
- Exposure to be used. Weekly average exposure to PM2.5 in week 11 of gestation. 
- pm25_12
- Exposure to be used. Weekly average exposure to PM2.5 in week 12 of gestation. 
- pm25_13
- Exposure to be used. Weekly average exposure to PM2.5 in week 13 of gestation. 
- pm25_14
- Exposure to be used. Weekly average exposure to PM2.5 in week 14 of gestation. 
- pm25_15
- Exposure to be used. Weekly average exposure to PM2.5 in week 15 of gestation. 
- pm25_16
- Exposure to be used. Weekly average exposure to PM2.5 in week 16 of gestation. 
- pm25_17
- Exposure to be used. Weekly average exposure to PM2.5 in week 17 of gestation. 
- pm25_18
- Exposure to be used. Weekly average exposure to PM2.5 in week 18 of gestation. 
- pm25_19
- Exposure to be used. Weekly average exposure to PM2.5 in week 19 of gestation. 
- pm25_20
- Exposure to be used. Weekly average exposure to PM2.5 in week 20 of gestation. 
- pm25_21
- Exposure to be used. Weekly average exposure to PM2.5 in week 21 of gestation. 
- pm25_22
- Exposure to be used. Weekly average exposure to PM2.5 in week 22 of gestation. 
- pm25_23
- Exposure to be used. Weekly average exposure to PM2.5 in week 23 of gestation. 
- pm25_24
- Exposure to be used. Weekly average exposure to PM2.5 in week 24 of gestation. 
- pm25_25
- Exposure to be used. Weekly average exposure to PM2.5 in week 25 of gestation. 
- pm25_26
- Exposure to be used. Weekly average exposure to PM2.5 in week 26 of gestation. 
- pm25_27
- Exposure to be used. Weekly average exposure to PM2.5 in week 27 of gestation. 
- pm25_28
- Exposure to be used. Weekly average exposure to PM2.5 in week 28 of gestation. 
- pm25_29
- Exposure to be used. Weekly average exposure to PM2.5 in week 29 of gestation. 
- pm25_30
- Exposure to be used. Weekly average exposure to PM2.5 in week 30 of gestation. 
- pm25_31
- Exposure to be used. Weekly average exposure to PM2.5 in week 31 of gestation. 
- pm25_32
- Exposure to be used. Weekly average exposure to PM2.5 in week 32 of gestation. 
- pm25_33
- Exposure to be used. Weekly average exposure to PM2.5 in week 33 of gestation. 
- pm25_34
- Exposure to be used. Weekly average exposure to PM2.5 in week 34 of gestation. 
- pm25_35
- Exposure to be used. Weekly average exposure to PM2.5 in week 35 of gestation. 
- pm25_36
- Exposure to be used. Weekly average exposure to PM2.5 in week 36 of gestation. 
- pm25_37
- Exposure to be used. Weekly average exposure to PM2.5 in week 37 of gestation. 
- no2_1
- Exposure to be used. Weekly average exposure to NO2 in week 1 of gestation. 
- no2_2
- Exposure to be used. Weekly average exposure to NO2 in week 2 of gestation. 
- no2_3
- Exposure to be used. Weekly average exposure to NO2 in week 3 of gestation. 
- no2_4
- Exposure to be used. Weekly average exposure to NO2 in week 4 of gestation. 
- no2_5
- Exposure to be used. Weekly average exposure to NO2 in week 5 of gestation. 
- no2_6
- Exposure to be used. Weekly average exposure to NO2 in week 6 of gestation. 
- no2_7
- Exposure to be used. Weekly average exposure to NO2 in week 7 of gestation. 
- no2_8
- Exposure to be used. Weekly average exposure to NO2 in week 8 of gestation. 
- no2_9
- Exposure to be used. Weekly average exposure to NO2 in week 9 of gestation. 
- no2_10
- Exposure to be used. Weekly average exposure to NO2 in week 10 of gestation. 
- no2_11
- Exposure to be used. Weekly average exposure to NO2 in week 11 of gestation. 
- no2_12
- Exposure to be used. Weekly average exposure to NO2 in week 12 of gestation. 
- no2_13
- Exposure to be used. Weekly average exposure to NO2 in week 13 of gestation. 
- no2_14
- Exposure to be used. Weekly average exposure to NO2 in week 14 of gestation. 
- no2_15
- Exposure to be used. Weekly average exposure to NO2 in week 15 of gestation. 
- no2_16
- Exposure to be used. Weekly average exposure to NO2 in week 16 of gestation. 
- no2_17
- Exposure to be used. Weekly average exposure to NO2 in week 17 of gestation. 
- no2_18
- Exposure to be used. Weekly average exposure to NO2 in week 18 of gestation. 
- no2_19
- Exposure to be used. Weekly average exposure to NO2 in week 19 of gestation. 
- no2_20
- Exposure to be used. Weekly average exposure to NO2 in week 20 of gestation. 
- no2_21
- Exposure to be used. Weekly average exposure to NO2 in week 21 of gestation. 
- no2_22
- Exposure to be used. Weekly average exposure to NO2 in week 22 of gestation. 
- no2_23
- Exposure to be used. Weekly average exposure to NO2 in week 23 of gestation. 
- no2_24
- Exposure to be used. Weekly average exposure to NO2 in week 24 of gestation. 
- no2_25
- Exposure to be used. Weekly average exposure to NO2 in week 25 of gestation. 
- no2_26
- Exposure to be used. Weekly average exposure to NO2 in week 26 of gestation. 
- no2_27
- Exposure to be used. Weekly average exposure to NO2 in week 27 of gestation. 
- no2_28
- Exposure to be used. Weekly average exposure to NO2 in week 28 of gestation. 
- no2_29
- Exposure to be used. Weekly average exposure to NO2 in week 29 of gestation. 
- no2_30
- Exposure to be used. Weekly average exposure to NO2 in week 30 of gestation. 
- no2_31
- Exposure to be used. Weekly average exposure to NO2 in week 31 of gestation. 
- no2_32
- Exposure to be used. Weekly average exposure to NO2 in week 32 of gestation. 
- no2_33
- Exposure to be used. Weekly average exposure to NO2 in week 33 of gestation. 
- no2_34
- Exposure to be used. Weekly average exposure to NO2 in week 34 of gestation. 
- no2_35
- Exposure to be used. Weekly average exposure to NO2 in week 35 of gestation. 
- no2_36
- Exposure to be used. Weekly average exposure to NO2 in week 36 of gestation. 
- no2_37
- Exposure to be used. Weekly average exposure to NO2 in week 37 of gestation. 
- so2_1
- Exposure to be used. Weekly average exposure to SO2 in week 1 of gestation. 
- so2_2
- Exposure to be used. Weekly average exposure to SO2 in week 2 of gestation. 
- so2_3
- Exposure to be used. Weekly average exposure to SO2 in week 3 of gestation. 
- so2_4
- Exposure to be used. Weekly average exposure to SO2 in week 4 of gestation. 
- so2_5
- Exposure to be used. Weekly average exposure to SO2 in week 5 of gestation. 
- so2_6
- Exposure to be used. Weekly average exposure to SO2 in week 6 of gestation. 
- so2_7
- Exposure to be used. Weekly average exposure to SO2 in week 7 of gestation. 
- so2_8
- Exposure to be used. Weekly average exposure to SO2 in week 8 of gestation. 
- so2_9
- Exposure to be used. Weekly average exposure to SO2 in week 9 of gestation. 
- so2_10
- Exposure to be used. Weekly average exposure to SO2 in week 10 of gestation. 
- so2_11
- Exposure to be used. Weekly average exposure to SO2 in week 11 of gestation. 
- so2_12
- Exposure to be used. Weekly average exposure to SO2 in week 12 of gestation. 
- so2_13
- Exposure to be used. Weekly average exposure to SO2 in week 13 of gestation. 
- so2_14
- Exposure to be used. Weekly average exposure to SO2 in week 14 of gestation. 
- so2_15
- Exposure to be used. Weekly average exposure to SO2 in week 15 of gestation. 
- so2_16
- Exposure to be used. Weekly average exposure to SO2 in week 16 of gestation. 
- so2_17
- Exposure to be used. Weekly average exposure to SO2 in week 17 of gestation. 
- so2_18
- Exposure to be used. Weekly average exposure to SO2 in week 18 of gestation. 
- so2_19
- Exposure to be used. Weekly average exposure to SO2 in week 19 of gestation. 
- so2_20
- Exposure to be used. Weekly average exposure to SO2 in week 20 of gestation. 
- so2_21
- Exposure to be used. Weekly average exposure to SO2 in week 21 of gestation. 
- so2_22
- Exposure to be used. Weekly average exposure to SO2 in week 22 of gestation. 
- so2_23
- Exposure to be used. Weekly average exposure to SO2 in week 23 of gestation. 
- so2_24
- Exposure to be used. Weekly average exposure to SO2 in week 24 of gestation. 
- so2_25
- Exposure to be used. Weekly average exposure to SO2 in week 25 of gestation. 
- so2_26
- Exposure to be used. Weekly average exposure to SO2 in week 26 of gestation. 
- so2_27
- Exposure to be used. Weekly average exposure to SO2 in week 27 of gestation. 
- so2_28
- Exposure to be used. Weekly average exposure to SO2 in week 28 of gestation. 
- so2_29
- Exposure to be used. Weekly average exposure to SO2 in week 29 of gestation. 
- so2_30
- Exposure to be used. Weekly average exposure to SO2 in week 30 of gestation. 
- so2_31
- Exposure to be used. Weekly average exposure to SO2 in week 31 of gestation. 
- so2_32
- Exposure to be used. Weekly average exposure to SO2 in week 32 of gestation. 
- so2_33
- Exposure to be used. Weekly average exposure to SO2 in week 33 of gestation. 
- so2_34
- Exposure to be used. Weekly average exposure to SO2 in week 34 of gestation. 
- so2_35
- Exposure to be used. Weekly average exposure to SO2 in week 35 of gestation. 
- so2_36
- Exposure to be used. Weekly average exposure to SO2 in week 36 of gestation. 
- so2_37
- Exposure to be used. Weekly average exposure to SO2 in week 37 of gestation. 
- co_1
- Exposure to be used. Weekly average exposure to CO in week 1 of gestation. 
- co_2
- Exposure to be used. Weekly average exposure to CO in week 2 of gestation. 
- co_3
- Exposure to be used. Weekly average exposure to CO in week 3 of gestation. 
- co_4
- Exposure to be used. Weekly average exposure to CO in week 4 of gestation. 
- co_5
- Exposure to be used. Weekly average exposure to CO in week 5 of gestation. 
- co_6
- Exposure to be used. Weekly average exposure to CO in week 6 of gestation. 
- co_7
- Exposure to be used. Weekly average exposure to CO in week 7 of gestation. 
- co_8
- Exposure to be used. Weekly average exposure to CO in week 8 of gestation. 
- co_9
- Exposure to be used. Weekly average exposure to CO in week 9 of gestation. 
- co_10
- Exposure to be used. Weekly average exposure to CO in week 10 of gestation. 
- co_11
- Exposure to be used. Weekly average exposure to CO in week 11 of gestation. 
- co_12
- Exposure to be used. Weekly average exposure to CO in week 12 of gestation. 
- co_13
- Exposure to be used. Weekly average exposure to CO in week 13 of gestation. 
- co_14
- Exposure to be used. Weekly average exposure to CO in week 14 of gestation. 
- co_15
- Exposure to be used. Weekly average exposure to CO in week 15 of gestation. 
- co_16
- Exposure to be used. Weekly average exposure to CO in week 16 of gestation. 
- co_17
- Exposure to be used. Weekly average exposure to CO in week 17 of gestation. 
- co_18
- Exposure to be used. Weekly average exposure to CO in week 18 of gestation. 
- co_19
- Exposure to be used. Weekly average exposure to CO in week 19 of gestation. 
- co_20
- Exposure to be used. Weekly average exposure to CO in week 20 of gestation. 
- co_21
- Exposure to be used. Weekly average exposure to CO in week 21 of gestation. 
- co_22
- Exposure to be used. Weekly average exposure to CO in week 22 of gestation. 
- co_23
- Exposure to be used. Weekly average exposure to CO in week 23 of gestation. 
- co_24
- Exposure to be used. Weekly average exposure to CO in week 24 of gestation. 
- co_25
- Exposure to be used. Weekly average exposure to CO in week 25 of gestation. 
- co_26
- Exposure to be used. Weekly average exposure to CO in week 26 of gestation. 
- co_27
- Exposure to be used. Weekly average exposure to CO in week 27 of gestation. 
- co_28
- Exposure to be used. Weekly average exposure to CO in week 28 of gestation. 
- co_29
- Exposure to be used. Weekly average exposure to CO in week 29 of gestation. 
- co_30
- Exposure to be used. Weekly average exposure to CO in week 30 of gestation. 
- co_31
- Exposure to be used. Weekly average exposure to CO in week 31 of gestation. 
- co_32
- Exposure to be used. Weekly average exposure to CO in week 32 of gestation. 
- co_33
- Exposure to be used. Weekly average exposure to CO in week 33 of gestation. 
- co_34
- Exposure to be used. Weekly average exposure to CO in week 34 of gestation. 
- co_35
- Exposure to be used. Weekly average exposure to CO in week 35 of gestation. 
- co_36
- Exposure to be used. Weekly average exposure to CO in week 36 of gestation. 
- co_37
- Exposure to be used. Weekly average exposure to CO in week 37 of gestation. 
- temp_1
- Exposure to be used. Weekly average exposure to temperature in week 1 of gestation. 
- temp_2
- Exposure to be used. Weekly average exposure to temperature in week 2 of gestation. 
- temp_3
- Exposure to be used. Weekly average exposure to temperature in week 3 of gestation. 
- temp_4
- Exposure to be used. Weekly average exposure to temperature in week 4 of gestation. 
- temp_5
- Exposure to be used. Weekly average exposure to temperature in week 5 of gestation. 
- temp_6
- Exposure to be used. Weekly average exposure to temperature in week 6 of gestation. 
- temp_7
- Exposure to be used. Weekly average exposure to temperature in week 7 of gestation. 
- temp_8
- Exposure to be used. Weekly average exposure to temperature in week 8 of gestation. 
- temp_9
- Exposure to be used. Weekly average exposure to temperature in week 9 of gestation. 
- temp_10
- Exposure to be used. Weekly average exposure to temperature in week 10 of gestation. 
- temp_11
- Exposure to be used. Weekly average exposure to temperature in week 11 of gestation. 
- temp_12
- Exposure to be used. Weekly average exposure to temperature in week 12 of gestation. 
- temp_13
- Exposure to be used. Weekly average exposure to temperature in week 13 of gestation. 
- temp_14
- Exposure to be used. Weekly average exposure to temperature in week 14 of gestation. 
- temp_15
- Exposure to be used. Weekly average exposure to temperature in week 15 of gestation. 
- temp_16
- Exposure to be used. Weekly average exposure to temperature in week 16 of gestation. 
- temp_17
- Exposure to be used. Weekly average exposure to temperature in week 17 of gestation. 
- temp_18
- Exposure to be used. Weekly average exposure to temperature in week 18 of gestation. 
- temp_19
- Exposure to be used. Weekly average exposure to temperature in week 19 of gestation. 
- temp_20
- Exposure to be used. Weekly average exposure to temperature in week 20 of gestation. 
- temp_21
- Exposure to be used. Weekly average exposure to temperature in week 21 of gestation. 
- temp_22
- Exposure to be used. Weekly average exposure to temperature in week 22 of gestation. 
- temp_23
- Exposure to be used. Weekly average exposure to temperature in week 23 of gestation. 
- temp_24
- Exposure to be used. Weekly average exposure to temperature in week 24 of gestation. 
- temp_25
- Exposure to be used. Weekly average exposure to temperature in week 25 of gestation. 
- temp_26
- Exposure to be used. Weekly average exposure to temperature in week 26 of gestation. 
- temp_27
- Exposure to be used. Weekly average exposure to temperature in week 27 of gestation. 
- temp_28
- Exposure to be used. Weekly average exposure to temperature in week 28 of gestation. 
- temp_29
- Exposure to be used. Weekly average exposure to temperature in week 29 of gestation. 
- temp_30
- Exposure to be used. Weekly average exposure to temperature in week 30 of gestation. 
- temp_31
- Exposure to be used. Weekly average exposure to temperature in week 31 of gestation. 
- temp_32
- Exposure to be used. Weekly average exposure to temperature in week 32 of gestation. 
- temp_33
- Exposure to be used. Weekly average exposure to temperature in week 33 of gestation. 
- temp_34
- Exposure to be used. Weekly average exposure to temperature in week 34 of gestation. 
- temp_35
- Exposure to be used. Weekly average exposure to temperature in week 35 of gestation. 
- temp_36
- Exposure to be used. Weekly average exposure to temperature in week 36 of gestation. 
- temp_37
- Exposure to be used. Weekly average exposure to temperature in week 37 of gestation. 
- source
- Variable indicating that the data came from the bdlim package. 
Summary for bdlim1
Description
Summary for bdlim1
Usage
## S3 method for class 'bdlim1'
summary(object, ...)
Arguments
| object | An object of class bdlim1. | 
| ... | Not used. | 
Value
An object of class summary.bdlim1.
Summary for bdlim4
Description
Summary for bdlim4
Usage
## S3 method for class 'bdlim4'
summary(object, model = NULL, ...)
Arguments
| object | An object of class bdlim4. | 
| model | Pattern of heterogeneity to be printed. If not specified (default) the best fitting model will be used. Options are "n", "b", "w" and "bw" where b indicates the effect sizes are subgroup specific and w indicates the weight functions are subgroups specific. | 
| ... | Other arguments | 
Value
An object of class summary.bdlim4.
Examples
# run BDLIM with modification by ChildSex
fit_sex <- bdlim4(
  y = sbd_bdlim$bwgaz,
  exposure = sbd_bdlim[,paste0("pm25_",1:37)],
  covars = sbd_bdlim[,c("MomPriorBMI","MomAge","race","Hispanic",
                                      "EstMonthConcept","EstYearConcept")],
  group = as.factor(sbd_bdlim$ChildSex),
  df = 5,
  nits = 5000,
  parallel = FALSE
)
#summarize results
summary(fit_sex)
# obtain estimates of the distributed lag function
# these are note displayed when printed but available for use
sfit_sex <- summary(fit_sex)
head(sfit_sex$dlfun)
# can summarize with a specific model
sfit_hisp_n <- summary(fit_sex, model="n") # no modification
sfit_hisp_b <- summary(fit_sex, model="b") # subgroup-specific effects (beta)
sfit_hisp_w <- summary(fit_sex, model="w") # subgroup-specific weight function
sfit_hisp_bw <- summary(fit_sex, model="bw") # both subgroup-specific