Title: | 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>. |
Authors: | Ander Wilson [aut, cre] |
Maintainer: | Ander Wilson <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.4.2 |
Built: | 2024-11-09 04:53:14 UTC |
Source: | https://github.com/anderwilson/bdlim |
Fit the BDLIM model with 1 pattern of modification
bdlim1( y, exposure, covars, group, id = NULL, w_free, b_free, df, nits, nburn = round(nits/2), nthin = 1 )
bdlim1( y, exposure, covars, group, id = NULL, w_free, b_free, df, nits, nburn = round(nits/2), nthin = 1 )
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. |
A list with posteriors of parameters
Fit the BDLIM model with 1 pattern of modification with logistic regression
bdlim1_logistic( y, exposure, covars, group, id = NULL, w_free, b_free, df, nits, nburn = round(nits/2), nthin = 1 )
bdlim1_logistic( y, exposure, covars, group, id = NULL, w_free, b_free, df, nits, nburn = round(nits/2), nthin = 1 )
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. |
A list with posteriors of parameters
Fit the BDLIM model with all 4 patterns of modification
bdlim4( y, exposure, covars, group, id = NULL, df, nits, nburn = round(nits/2), nthin = 1, parallel = FALSE, family = "gaussian" )
bdlim4( y, exposure, covars, group, id = NULL, df, nits, nburn = round(nits/2), nthin = 1, parallel = FALSE, family = "gaussian" )
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. |
A list of results from each different pattern of modification and model compassion metrics
# 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)
# 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)
Make orthonomal basis for weight functions
makebasis(exposure, df)
makebasis(exposure, df)
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. |
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.
B <- makebasis(sbd_bdlim[,paste0("pm25_",1:37)], df=4)
B <- makebasis(sbd_bdlim[,paste0("pm25_",1:37)], df=4)
Model comparison for bdlim objects
modelcompare(object)
modelcompare(object)
object |
An object of class bdlim4 obtained from the bdlim4 function. |
A vector of model probabilities.
Plot for Summary pf BDLIM
## S3 method for class 'summary.bdlim4' plot(x, ...)
## S3 method for class 'summary.bdlim4' plot(x, ...)
x |
An object of class summary.bdlim4. |
... |
Not used. |
An ggplot2 figure.
# 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)
# 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
## S3 method for class 'bdlim1' print(x, ...)
## S3 method for class 'bdlim1' print(x, ...)
x |
An object of class bdlim1. |
... |
Not used. |
Assorted model output.
Print Results
## S3 method for class 'bdlim4' print(x, ...)
## S3 method for class 'bdlim4' print(x, ...)
x |
An object of class bdlim4. |
... |
Not used. |
Assorted model output.
Print Summary of bdlim4
## S3 method for class 'summary.bdlim4' print(x, ...)
## S3 method for class 'summary.bdlim4' print(x, ...)
x |
An object of class summary.bdlim4. |
... |
Not used. |
Assorted model output.
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.
sbd_bdlim
sbd_bdlim
A data frame with 1000 rows (observations) and 202 variables:
Outcome to be used. Simulated birth weight for gestational age z-score.
Binary sex of child.
Continuous age in years.
Continuous estimated gestational age at birth in weeks.
Continuous maternal height in inches.
Continuous mothers pre-pregnancy weight in pounds.
Continuous mothers pre-pregnancy BMI.
Categorical race.
Binary indicator of Hispanic.
Categorical maternal heighest educational attainment.
Binary indicator of any smoking during pregnancy.
Categorical maternal marital status.
Categorical income.
Estimated date of conception.
Estimated month of conception.
Estimated year of conception.
Exposure to be used. Weekly average exposure to PM2.5 in week 1 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 2 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 3 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 4 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 5 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 6 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 7 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 8 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 9 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 10 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 11 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 12 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 13 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 14 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 15 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 16 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 17 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 18 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 19 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 20 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 21 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 22 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 23 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 24 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 25 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 26 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 27 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 28 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 29 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 30 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 31 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 32 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 33 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 34 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 35 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 36 of gestation.
Exposure to be used. Weekly average exposure to PM2.5 in week 37 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 1 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 2 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 3 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 4 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 5 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 6 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 7 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 8 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 9 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 10 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 11 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 12 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 13 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 14 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 15 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 16 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 17 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 18 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 19 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 20 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 21 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 22 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 23 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 24 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 25 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 26 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 27 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 28 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 29 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 30 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 31 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 32 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 33 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 34 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 35 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 36 of gestation.
Exposure to be used. Weekly average exposure to NO2 in week 37 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 1 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 2 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 3 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 4 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 5 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 6 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 7 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 8 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 9 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 10 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 11 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 12 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 13 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 14 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 15 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 16 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 17 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 18 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 19 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 20 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 21 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 22 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 23 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 24 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 25 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 26 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 27 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 28 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 29 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 30 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 31 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 32 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 33 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 34 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 35 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 36 of gestation.
Exposure to be used. Weekly average exposure to SO2 in week 37 of gestation.
Exposure to be used. Weekly average exposure to CO in week 1 of gestation.
Exposure to be used. Weekly average exposure to CO in week 2 of gestation.
Exposure to be used. Weekly average exposure to CO in week 3 of gestation.
Exposure to be used. Weekly average exposure to CO in week 4 of gestation.
Exposure to be used. Weekly average exposure to CO in week 5 of gestation.
Exposure to be used. Weekly average exposure to CO in week 6 of gestation.
Exposure to be used. Weekly average exposure to CO in week 7 of gestation.
Exposure to be used. Weekly average exposure to CO in week 8 of gestation.
Exposure to be used. Weekly average exposure to CO in week 9 of gestation.
Exposure to be used. Weekly average exposure to CO in week 10 of gestation.
Exposure to be used. Weekly average exposure to CO in week 11 of gestation.
Exposure to be used. Weekly average exposure to CO in week 12 of gestation.
Exposure to be used. Weekly average exposure to CO in week 13 of gestation.
Exposure to be used. Weekly average exposure to CO in week 14 of gestation.
Exposure to be used. Weekly average exposure to CO in week 15 of gestation.
Exposure to be used. Weekly average exposure to CO in week 16 of gestation.
Exposure to be used. Weekly average exposure to CO in week 17 of gestation.
Exposure to be used. Weekly average exposure to CO in week 18 of gestation.
Exposure to be used. Weekly average exposure to CO in week 19 of gestation.
Exposure to be used. Weekly average exposure to CO in week 20 of gestation.
Exposure to be used. Weekly average exposure to CO in week 21 of gestation.
Exposure to be used. Weekly average exposure to CO in week 22 of gestation.
Exposure to be used. Weekly average exposure to CO in week 23 of gestation.
Exposure to be used. Weekly average exposure to CO in week 24 of gestation.
Exposure to be used. Weekly average exposure to CO in week 25 of gestation.
Exposure to be used. Weekly average exposure to CO in week 26 of gestation.
Exposure to be used. Weekly average exposure to CO in week 27 of gestation.
Exposure to be used. Weekly average exposure to CO in week 28 of gestation.
Exposure to be used. Weekly average exposure to CO in week 29 of gestation.
Exposure to be used. Weekly average exposure to CO in week 30 of gestation.
Exposure to be used. Weekly average exposure to CO in week 31 of gestation.
Exposure to be used. Weekly average exposure to CO in week 32 of gestation.
Exposure to be used. Weekly average exposure to CO in week 33 of gestation.
Exposure to be used. Weekly average exposure to CO in week 34 of gestation.
Exposure to be used. Weekly average exposure to CO in week 35 of gestation.
Exposure to be used. Weekly average exposure to CO in week 36 of gestation.
Exposure to be used. Weekly average exposure to CO in week 37 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 1 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 2 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 3 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 4 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 5 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 6 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 7 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 8 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 9 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 10 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 11 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 12 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 13 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 14 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 15 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 16 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 17 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 18 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 19 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 20 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 21 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 22 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 23 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 24 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 25 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 26 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 27 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 28 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 29 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 30 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 31 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 32 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 33 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 34 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 35 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 36 of gestation.
Exposure to be used. Weekly average exposure to temperature in week 37 of gestation.
Variable indicating that the data came from the bdlim package.
Summary for bdlim1
## S3 method for class 'bdlim1' summary(object, ...)
## S3 method for class 'bdlim1' summary(object, ...)
object |
An object of class bdlim1. |
... |
Not used. |
An object of class summary.bdlim2.
Summary for bdlim4
## S3 method for class 'bdlim4' summary(object, model = NULL, ...)
## S3 method for class 'bdlim4' summary(object, model = NULL, ...)
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 |
An object of class summary.bdlim2.
# 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
# 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