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,
  ...
)

Arguments

formula

a formula for the model.

group

a vector within the data which is used for separating majority and minority groups.

data

a data frame and data has to be included with the form of data.frame.

id

a vector within the data which is used for identifying the observations.

modifier

(optional) a vector from the data which is an optional argument to add the varying term into the model. The default is NULL. If the class of the vector is given as integer then, the continuous version of vc.PB is performed and if the class is factor or character, then the discrete version is proceeded. Three different sets of inputs are needed for different versions.

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 p number of bandwidths for estimating the local expectations of the design matrix for the majority group.

bandwidth_xm

(optional) a vector of p number of bandwidths for estimating the local expectations of the design matrix for the minority group.

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 modifier is integer.

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 modifier is integer.

bandwidth_Z_xM

(optional) a vector of p number of bandwidths for estimating the local expectations of the design matrix related to varying variable for the majority group. Used only when the class of modifier is integer.

bandwidth_Z_xm

(optional) a vector of p number of bandwidths for estimating the local expectations of the design matrix related to varying variable for the minority group. Used only when the class of modifier is integer.

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 varying is null.

explained_disparity_by_X

explained disparity from the variables without modifier variable given that the modifier variable is from the majority group, this component is given only when varying is not null.

explained_disparity_by_Z

explained disparity from modifier variable, this component is given only when varying is not null.

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 varying is not null.

bandwidths

various corresponding bandwidths. Please see the details or the attached reference for more information.

Author

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
#> 
#> Call:
#> 
#> vc.pb(formula = y ~ (x1 | time) + x2, group = group, data = data, 
#>     id = sub_id)
#> 
#> Group Variables:
#> 
#> Major: 1 
#> Minor: 2 
#> 
#> Disparity Summary Results:
#> 
#>                         t = 1.5198 t = 2.5139 t = 3.5081 t = 4.5022 t = 5.4963
#>     Overall Disparity:      0.2391     0.1706     0.0830    -0.3148    -0.2327
#>   Explained Disparity:     -0.1347    -0.0333     0.0221     0.1179    -0.0367
#> Unexplained Disparity:      0.3738     0.2039     0.0608    -0.4328    -0.1960
#>