Calculate cohort deviation
cohortdeviation(
A,
P,
C,
model = temp6,
weight = "wt",
covariate,
gee = FALSE,
unequal_interval = FALSE,
age_range = NULL,
period_range = NULL,
age_interval = NULL,
period_interval = NULL,
age_group = NULL,
period_group = NULL,
...
)
A list containing:
The estimated inter-cohort average deviations from age and period main effects.
The estimated intra-cohort life-course linear slopes.
A matrix containing the estimated coefficients for age-by-period interactions.
Indices indicating different cohorts.
The numbers of age groups, period groups, and cohort groups separately.
A generalized linear regression model generated from the internal function temp_model
An optional vector of sample weights to be used in the model fitting process. If non-NULL, the weights will be used in the first step to estimate the model. Observations with negative weights will be automatically dropped in modeling.
An optional vector of characters, representing the name(s) of the user-specified covariate(s) to be used in the model. If the variable(s) are not found in data, there will be an error message reminding the users to check the data again.
Logical, indicating if the data is cross-sectional data or
longitudinal/panel data. If TRUE
, the generalized estimating equation
will be used to correct the standard error estimates. The default is
FALSE
, indicating that the data are cross-sectional.
Logical, indicating if age and period groups are
of the same interval width. The default is set as TRUE
.
Numeric vector indicating the actual age and period range (e.g., 10 to 59 years old from 2000 to 2019).
Numeric
values or character vectors indicating how age and period are
grouped. age_interval
and period_interval
are numbers
indicating the width of age and period groups respectively.
age_group
and period_group
are character vectors
explicitly listing all potential age and period groups. Either
age_interval
(period_interval
) or age_group
(period_group
) have to be defined when unequal_interval
is TRUE
.
Additional arguments to be passed to the function.