--------------------------------------------------- lines 6-165 of file: example/absolute_covariates.py --------------------------------------------------- {xrst_begin_parent absolute_covariates} {xrst_spell dage dtime } Example Using absolute_covariates Option in all_node_database ############################################################# For this example everything is constant w.r.t. age and time. Nodes ***** The following is a diagram of the node tree for this example. The :ref:`glossary@root_node` is n0, the :ref:`glossary@fit_goal_set` and :ref:`fit_goal_table-name` are {n3, n4, n2}, and the leaf nodes are {n3, n4, n5, n6}:: n0 /-----/\-----\ n1 (n2) / \ / \ (n3) (n4) n5 n6 fit_goal_set ============ {xrst_literal # BEGIN_FIT_GOAL # END_FIT_GOAL } Rates ***** The only non-zero dismod_at rates for this example are :ref:`glossary@iota`.and :ref:`glossary@omega`. Splitting Covariate =================== This cascade is set up to split by sex reference value; see :ref:`split_reference_table-name` {xrst_literal # BEGIN split_reference_table # END split_reference_table } Covariate ********* There are three covariates for this example, sex, vaccine, and income. Income is the only :ref:`glossary@Relative Covariate`. {xrst_literal # BEGIN avg_income # END avg_income } {xrst_literal # BEGIN split_reference_list # END split_reference_list } absolute_covariates =================== The only absolute covariate in this example is vaccine (0 for no vaccine, 1 for yes vaccine). {xrst_literal # BEGIN_1 absolute_covariates # END_1 absolute_covariates } alpha ===== We use *alpha*\ ``[income]`` and *alpha*\ ``[vaccine]`` for the :ref:`glossary@rate_value` covariate multipliers that multiply the income and vaccine covariates. The true value for *alpha* (used which simulating the data) is {xrst_literal # BEGIN alpha_true # END alpha_true } Random Effects ************** There are no random effect for this example. Simulated Data ************** rate_true(rate, a, t, n, c) =========================== For *rate* equal to iota or omega, this is the true value for *rate* in node *n* at age *a*, time *t*, and covariate values *c=[sex,income]*. The covariate values are a list in the same order as the covariate table. The values *a*, *t*, *n*, *sex* are not used by this function for this example. {xrst_literal # BEGIN rate_true # END rate_true } y_i === The only simulated integrand for this example is :ref:`glossary@Sincidence` which is a direct measurement of iota. This data is simulated without any noise; i.e., the i-th measurement is simulated as *y_i = rate_true('iota', None, None, None, [None, I_i])* where *I_i* is the income for the i-th measurement. The data is modeled as having noise even though there is no simulated noise. n_i === Data is only simulated for the leaf nodes; i.e., each *n_i* is in the set { n3, n4, n5, n6 }. Since the data does not have any nose, the data residuals are a measure of how good the fit is for the nodes in the fit_goal_set. Parent Rate Smoothing ********************* This is the iota smoothing used for the fit_node. There are no :ref:`glossary@dage` or :ref:`glossary@dtime` priors because there is only one age and one time point in the smoothing grid. Value Prior =========== The following is the value prior used for the root_node {xrst_literal # BEGIN parent_value_prior # END parent_value_prior } The mean and standard deviation are only used for the root_node. The :ref:`create_shift_db-name` routine replaces them for other nodes. Alpha Smoothing *************** This is the smoothing used for *alpha* which multiplies the income covariate. There is only one age and one time point in this smoothing so it does not have dage or dtime priors. Value Prior =========== The following is the value prior used for this smoothing: {xrst_literal # BEGIN alpha_value_prior # END alpha_value_prior } The mean and standard deviation are only used for the root_node. The create_shift_db routine replaces them for other nodes. Checking The Fit **************** The results of the fit are checked by check_cascade_node using the :ref:`check_cascade_node@avgint_table` that was created by the root_node_db routine. The node_id for each row is replaced by the node_id for the fit being checked. {xrst_end absolute_covariates}