| Type: | Package | 
| Title: | Longitudinal PB Varying-Coefficient Groupwise Disparity Model | 
| Version: | 1.1.1 | 
| 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>. | 
| Depends: | KernSmooth, rlist, lme4, methods | 
| License: | GPL-3 | 
| Encoding: | UTF-8 | 
| RoxygenNote: | 7.2.3 | 
| URL: | https://github.com/SangkyuStat/vcPB, https://sangkyustat.github.io/vcPB/ | 
| BugReports: | https://github.com/SangkyuStat/vcPB/issues | 
| NeedsCompilation: | no | 
| Packaged: | 2024-03-26 15:11:49 UTC; lees57 | 
| Author: | Sang Kyu Lee [aut, cre], Seonjin Kim [aut], Hyokyoung (Grace) Hong [aut], Mi-Ok Kim [aut] | 
| Maintainer: | Sang Kyu Lee <lsk0816@gmail.com> | 
| Repository: | CRAN | 
| Date/Publication: | 2024-03-26 17:00:02 UTC | 
Peters-Belson Disparity Analysis
Description
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.
Usage
pb(formula, group, data, family = "gaussian")
Arguments
| 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. | 
Value
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. | 
Varying-Coefficient Disparity Decomposition Analysis for a Longitudinal Data
Description
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.
Usage
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,
  ...
)
Arguments
| 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. | 
Value
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. | 
Author(s)
Sang Kyu Lee
Examples
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