Description Usage Arguments Details Value Data Processing Steps Author(s) References
dspDat
is used to create an object of class
"dspDat"
;
the resultant object may then be used as input to the dsp
function to
sample an MCMC chain for the methodology proposed by Dunson and Stanford in
Bayesian Inferences on Predictors of Conception Probabilities (2005).
The dspDat
function is essentially a convenience function provided to
(if necessary) merge multiple datasets of varying time-specificities, as is
common for the type of fertility data for which the aformentioned methodology
is designed.
1 2 3 |
dsp_model |
An object of class |
baseline |
Either |
cycle |
Either |
daily |
A |
id_name |
A string specifying the name of the column in each of the
non- |
cyc_name |
A string specifying the name of the column in each of the
non- |
sex_name |
A string specifying the name of the column in the
|
fw_name |
If non- As a convenience, if the name specified by |
fw_incl |
An atomic vector specifying the days in the cycle that are in
the fertile window. In more detail, the elements of |
use_na |
One of either |
req_min_days |
A single nonnegative numeric value specifying a minimum number of day-specific observations in the data for a given cycle which we require to include a cycle in the model. So for example, specifying the value 0 means that we do not require any day-specific data in order to include a cycle in the model as long as we have the pregnancy outcome status for the cycle. Specifying a value of 1 would require at least 1 day-specific observation in the data for a given cycle for the cycle to be included, and so on. Note that this parameter only has an effect when |
keep_data |
Either It is strongly recommended that the first time a model is specified using
|
The class
"dspDat"
is equipped with a summary
function.
It is natural to record fertility study data in up to three datasets
of varying time-specificities. First, a dataset of variables that do not
change throughout the study which we denote as the baseline
data,
second a dataset of cycle-specific variables which we denote as the
cycle
data, and third a dataset of day-specific variables which we
denote as the daily
data. dspDat
is provided as a
convenience function which merges all of the provided datasets into one
day-specific dataset and creates some internal objects for use by the
MCMC sampler function dsp
.
At a minimum the daily
data must be provided so that daily
intercourse data is available. baseline
and cycle
data are
optional, so long as pregnancy information is included in one of either
the cycle
data or daily
data. For example, if the data was
collected only in a daily format or has already been combined, then only
a day-specific dataset would need to be passed to dspDat
.
The usual model.matrix
is used to construct the
design matrix for the specified model, so any of the usual
formula
commands are available. In particular, a
formula has an implied intercept term which may not be desireable for
these types of models. To remove this use either e.g. y ~ x - 1
or y ~ 0 + x
.
dspDat
returns an object of class
"dspDat"
. An object of class "dspDat"
is a list containing
the following components:
this section needs reworked
cleanDat
A list containing objects bas
,
cyc
, and day
, which are the datasets after removing
missing and reducing the daily
data to fertile window days as
described in Data Processing Steps. If NULL
was
supplied for baseline
or cycle
, then the value of
bas
or cyc
is also NULL
.
redDat
A list containing objects bas
,
cyc
, and day
, which are the datasets after reducing the
cleaned data to the set of IDs and cycles that are common to every
non-NULL
dataset. If NULL
was supplied for
baseline
or cycle
, then the value of bas
or
cyc
is also NULL
.
combDat
*******
modelObj
A list containing objects Y
, X
,
U
, and id
. Y
, X
, U
are as in the
Dunson and Stanford paper, and id
is a vector of subject IDs
such that each observation specifies the subject ID for the
corresponding observation.
samplerObj
A list containing objects for use by the
dsp
function when executing the MCMC algorithm
datInfo
A list containing objects for use by the
summary
function
If either a baseline
or cycle
dataset is provided, then all observations that contain missing data
among the model variables are removed. All non-fertile window days
are removed from the daily
dataset, and any cycles that either
contain missing in the fertile window or have too many or too few
fertile window days are also removed.
Each non-NULL
dataset is reduced to the
set of IDs and cycles that are common to every non-NULL
dataset.
David Pritchard
Dunson, David B., and Joseph B. Stanford. "Bayesian inferences on predictors of conception probabilities." Biometrics 61.1 (2005): 126-133.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.