Title: | Longitudinal PB Varying-Coefficient Groupwise Disparity Model |
---|---|
Description: | Estimating the disparity between two groups based on the extended model of the Peters-Belson (PB) method. Our model is the first work on the longitudinal data, and also can set a varying variable to find the complicated association between other variables and the varying variable. Our work is an extension of the Peters-Belson method which was originally published in Peters (1941)<doi:10.1080/00220671.1941.10881036> and Belson (1956)<doi:10.2307/2985420>. |
Authors: | Sang Kyu Lee [aut, cre], Seonjin Kim [aut], Mi-Ok Kim [aut], Hyokyoung (Grace) Hong [aut] |
Maintainer: | Sang Kyu Lee <[email protected]> |
License: | GPL-3 |
Version: | 1.1.1 |
Built: | 2025-03-13 04:16:35 UTC |
Source: | https://github.com/sangkyustat/vcpb |
Function pb
offers Peters-Belson(PB) type of regression method which gets the disparity between a majority group
and a minority group based on various regression models.
pb(formula, group, data, family = "gaussian")
pb(formula, group, data, family = "gaussian")
formula |
a formula for the model. |
group |
a vector within the |
data |
a data frame and data has to be included with the form of |
family |
a character indicating which model should be used. Details can be found later. |
pb
returns an object of class "pb"
, which is a list containing
following components:
call |
a matched call. |
overall_disparity |
overall disparity between major and minor groups. |
explained_disparity |
explained disparity between major and minor groups. |
unexplained_disparity |
unexplained disparity between major and minor groups. |
major |
a majority group label. |
minor |
a minority group label. |
The vc.pb
offers Peters-Belson(PB) type of nonparametric varying-coefficient regression method which measures the disparity between a majority group
and a minority group for the longitudinal data.
vc.pb( formula, group, data, id, modifier = NULL, local_time = NULL, bandwidth_M = NULL, bandwidth_m = NULL, bandwidth_xM = NULL, bandwidth_xm = NULL, bandwidth_Z_M = NULL, bandwidth_Z_m = NULL, bandwidth_Z_xM = NULL, bandwidth_Z_xm = NULL, detail = FALSE, ... )
vc.pb( formula, group, data, id, modifier = NULL, local_time = NULL, bandwidth_M = NULL, bandwidth_m = NULL, bandwidth_xM = NULL, bandwidth_xm = NULL, bandwidth_Z_M = NULL, bandwidth_Z_m = NULL, bandwidth_Z_xM = NULL, bandwidth_Z_xm = NULL, detail = FALSE, ... )
formula |
a formula for the model. |
group |
a vector within the |
data |
a data frame and data has to be included with the form of |
id |
a vector within the |
modifier |
(optional) a vector from the |
local_time |
(optional) a vector used for the local points of time variable in the kernel regression. |
bandwidth_M |
(optional) a bandwidth for the time variable used for estimating the time-varying coefficient of the majority group. |
bandwidth_m |
(optional) a bandwidth for the time variable used for estimating the time-varying coefficient of the minority group. |
bandwidth_xM |
(optional) a vector of |
bandwidth_xm |
(optional) a vector of |
bandwidth_Z_M |
(optional) a bandwidth for the varying variable used for estimating the time-varying coefficient of the majority group. Used only when the class of |
bandwidth_Z_m |
(optional) a bandwidth for the varying variable used for estimating the time-varying coefficient of the minority group. Used only when the class of |
bandwidth_Z_xM |
(optional) a vector of |
bandwidth_Z_xm |
(optional) a vector of |
detail |
a bool argument whether the detailed results are provided or not. |
... |
used for controlling the others. |
vc.pb
returns an object of class "vc.pb"
, which is a list containing
following components:
call |
a matched call. |
overall_disparity |
overall disparity between major and minor groups. |
explained_disparity |
explained disparity between major and minor groups, this component is given only when |
explained_disparity_by_X |
explained disparity from the variables without |
explained_disparity_by_Z |
explained disparity from |
unexplained_disparity |
unexplained disparity between major and minor groups. |
times |
local time points used for kernel regression. |
major |
a majority group label. |
minor |
a minority group label. |
modfier , varying.type
|
the modifier variable and the type of the modifier variable, these components are given only when |
bandwidths |
various corresponding bandwidths. Please see the details or the attached reference for more information. |
Sang Kyu Lee
set.seed(1) n <- 100 x1 <- rnorm(n) x2 <- rnorm(n) time <- rep(1:5, 20) + runif(n) y <- rnorm(n) sub_id <- rep(1:25, 1, each = 4) group <- rep(as.character(1:2), 25, each = 2) z <- as.character(rbinom(n, 1, prob = 0.5)) data <- data.frame(y = y, x1 = x1, x2 = x2, z = z, group = group, time = time, sub_id = sub_id) fit <- vc.pb(y ~ (x1|time) + x2, data = data, id = sub_id, group = group) fit
set.seed(1) n <- 100 x1 <- rnorm(n) x2 <- rnorm(n) time <- rep(1:5, 20) + runif(n) y <- rnorm(n) sub_id <- rep(1:25, 1, each = 4) group <- rep(as.character(1:2), 25, each = 2) z <- as.character(rbinom(n, 1, prob = 0.5)) data <- data.frame(y = y, x1 = x1, x2 = x2, z = z, group = group, time = time, sub_id = sub_id) fit <- vc.pb(y ~ (x1|time) + x2, data = data, id = sub_id, group = group) fit