Title: | Weighted Meta-Analysis with Pseudo-Populations |
---|---|
Description: | Implementation of integrative weighting approaches for multiple observational studies and causal inferences. The package features three weighting approaches, each representing a special case of the unified weighting framework, introduced by Guha and Li (2024) <doi:10.1093/biomtc/ujae070>, which includes an extension of inverse probability weights for data integration settings. |
Authors: | Subharup Guha [aut, cre], Mengqi Xu [aut], Kashish Priyam [aut], Yi Li [aut] |
Maintainer: | Subharup Guha <[email protected]> |
License: | GPL-3 |
Version: | 1.1.0 |
Built: | 2024-11-30 12:24:30 UTC |
Source: | CRAN |
This function calculates balancing weights based on the specified pseudo-population method.
balancing.weights( S, Z, X, method, naturalGroupProp, num.random = 40, gammaMin = 0.001, gammaMax = (1 - 0.001), seed = NULL, verbose = TRUE )
balancing.weights( S, Z, X, method, naturalGroupProp, num.random = 40, gammaMin = 0.001, gammaMax = (1 - 0.001), seed = NULL, verbose = TRUE )
S |
Vector of factor levels representing the study memberships. Takes values in {1, ..., J}. |
Z |
Vector of factor levels representing the group memberships. Takes values in {1, ..., K}. |
X |
Covariate matrix of |
method |
Pseudo-population method, i.e., weighting method. Take values in |
naturalGroupProp |
Relevant only for FLEXOR method: a fixed user-specified probability vector |
num.random |
Relevant only for FLEXOR method: number of random starting points of |
gammaMin |
Relevant only for FLEXOR method: Lower bound for each |
gammaMax |
Relevant only for FLEXOR method: Upper bound for each |
seed |
Seed for random number generation. Default is |
verbose |
Logical; Relevant only for FLEXOR method: if |
An S3 list object with the following components:
empirically normalized sample weights.
Percentage sample effective sample size (ESS) for the pseudo-population.
data(demo) balancing.weights(S, Z, X, method = "IC", naturalGroupProp)
data(demo) balancing.weights(S, Z, X, method = "IC", naturalGroupProp)
This function estimates causal effects based on the specified pseudo-population method. The FLEXOR method involves an iterative two-step procedure.
causal.estimate( S, Z, X, Y, B = 100, method, naturalGroupProp = NULL, num.random = 40, gammaMin = 0.001, gammaMax = (1 - 0.001), seed = NULL, verbose = TRUE )
causal.estimate( S, Z, X, Y, B = 100, method, naturalGroupProp = NULL, num.random = 40, gammaMin = 0.001, gammaMax = (1 - 0.001), seed = NULL, verbose = TRUE )
S |
Vector of factor levels representing the study memberships. Takes values in {1, ..., J}. |
Z |
Vector of factor levels representing the group memberships. Takes values in {1, ..., K}. |
X |
Covariate matrix of |
Y |
Matrix of |
B |
Number of bootstrap samples for variance estimation. Default is 100. |
method |
Pseudo-population method, i.e., weighting method. Take values in |
naturalGroupProp |
Relevant only for FLEXOR method: a fixed user-specified probability vector |
num.random |
Relevant only for FLEXOR method: number of random starting points of |
gammaMin |
Relevant only for FLEXOR method: Lower bound for each |
gammaMax |
Relevant only for FLEXOR method: Upper bound for each |
seed |
Seed for random number generation. Default is |
verbose |
Logical; if |
An S3 list object with the following components:
Percentage sample effective sample size (ESS) of the pseudo-population.
An array of dimension , containing:
Estimated means, standard deviations (SDs), and medians (dimension 1),
For groups (dimension 2),
And counterfactual outcomes (dimension 3).
Estimated mean group differences for outcomes.
An array of dimension , containing:
moments.ar
of the th bootstrap sample (dimensions 1–3),
For bootstrap samples (dimension 4).
A matrix of dimension containing:
otherFeatures.v
of the th bootstrap sample (dimension 1),
For bootstrap samples (dimension 2).
A vector of length
containing percentage sample ESS for bootstrap samples.
Pseudo-population method, i.e., weighting method.
data(demo) set.seed(1) causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp)
data(demo) set.seed(1) causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp)
A dataset containing example data for demonstration purposes.
data(demo)
data(demo)
An rda object, with 450 observations and the following variables:
A vector of factor levels, representing the study memberships.
A vector of factor levels, representing the group memberships.
A covariate matrix.
An outcome matrix.
The relative group prevalences of the larger natural population. Necessary only for FLEXOR weights; it should be skipped for IC and IGO weights.
Disease subtype names "IDC" or "ILC"
Demo Dataset
data(demo)
data(demo)
A generic function to extract sample weights from objects of class 'balancing_weights'
get_weights(object)
get_weights(object)
object |
An objects of class 'balancing_weights'. |
Empirically normalized sample weights.
data(demo) output1 <- balancing.weights(S, Z, X, method = "IC", naturalGroupProp) get_weights(output1)
data(demo) output1 <- balancing.weights(S, Z, X, method = "IC", naturalGroupProp) get_weights(output1)
A generic function to extract mean differences for objects of class 'causal_estimates'.
mean_diff(object)
mean_diff(object)
object |
An objects of class 'causal_estimates'. |
The mean differences between two groups
data(demo) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) mean_diff(output2)
data(demo) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) mean_diff(output2)
A generic function to extract percentage sample ESS for different object classes
percentESS(object)
percentESS(object)
object |
An objects of class 'balancing_weights' or 'causal_estimates'. |
Percentage sample effective sample size (ESS) for the pseudo-population.
data(demo) output1 <- balancing.weights(S, Z, X, method = "IC", naturalGroupProp) percentESS(output1) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) percentESS(output2)
data(demo) output1 <- balancing.weights(S, Z, X, method = "IC", naturalGroupProp) percentESS(output1) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) percentESS(output2)
Plot method for objects of class 'causal_estimates' to generate a boxplot of percent sample effective sample size (ESS) for a specific weighting method using bootstrap samples.
## S3 method for class 'causal_estimates' plot(x, ...)
## S3 method for class 'causal_estimates' plot(x, ...)
x |
An object of class 'causal_estimates', the number of bootstrap samples |
... |
Additional arguments including:
|
A boxplot of percent sample ESS for a specific weighting method (FLEXOR
, IC
, or IGO
)
data(demo) set.seed(1) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) plot(output2)
data(demo) set.seed(1) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) plot(output2)
Print method for objects of class 'balancing_weights'
## S3 method for class 'balancing_weights' print(x, ...)
## S3 method for class 'balancing_weights' print(x, ...)
x |
An object of class 'balancing_weights' |
... |
Additional arguments affecting the printed results (so far no additional arguments are needed, so leave blank). |
Print values of the 'balancing_weights' object, including:
The total number of weights.
Percentage sample effective sample size (ESS) for the pseudo-population.
data(demo) output1 <- balancing.weights(S, Z, X, method = "IC", naturalGroupProp) print(output1)
data(demo) output1 <- balancing.weights(S, Z, X, method = "IC", naturalGroupProp) print(output1)
Print method for objects of class 'causal_estimates'
## S3 method for class 'causal_estimates' print(x, ...)
## S3 method for class 'causal_estimates' print(x, ...)
x |
An object of class 'causal_estimates' |
... |
Additional arguments affecting the printed results (so far no additional arguments are needed, so leave blank). |
Print values of the 'causal_estimates' object, including:
Percentage sample effective sample size (ESS) for the pseudo-population.
The mean differences between two groups
The ratios of standard deviations between two groups
data(demo) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) print(output2)
data(demo) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) print(output2)
A generic function to extract the ratios of standard deviations for objects of class 'causal_estimates'.
sigma_ratio(object)
sigma_ratio(object)
object |
An objects of class 'causal_estimates'. |
The ratios of standard deviations between two groups
data(demo) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) mean_diff(output2)
data(demo) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) mean_diff(output2)
Summary method for objects of class 'balancing_weights'
## S3 method for class 'balancing_weights' summary(object, ...)
## S3 method for class 'balancing_weights' summary(object, ...)
object |
An object of class 'balancing_weights' |
... |
Additional arguments affecting the summary produced (so far no additional arguments are needed, so leave blank). |
Printed summary of the 'balancing_weights' object, including:
The total number of weights.
Statistical summary of weight values.
Percentage sample effective sample size (ESS) for the pseudo-population.
data(demo) output1 <- balancing.weights(S, Z, X, method = "IC", naturalGroupProp) summary(output1)
data(demo) output1 <- balancing.weights(S, Z, X, method = "IC", naturalGroupProp) summary(output1)
Summary method for objects of class 'causal_estimates'
## S3 method for class 'causal_estimates' summary(object, ...)
## S3 method for class 'causal_estimates' summary(object, ...)
object |
An object of class 'causal_estimates' |
... |
Additional arguments affecting the summary produced (so far no additional arguments are needed, so leave blank). |
Printed summary of the 'causal_estimates' object, including:
Percentage sample effective sample size (ESS) for the pseudo-population.
B > 0
)The mean differences between two groups with their corresponding 95% confidence intervals.
B > 0
)The ratios of standard deviations between two groups with their corresponding 95% confidence intervals.
B = 0
)The mean differences between two groups.
B = 0
)The ratios of standard deviations between two groups.
data(demo) set.seed(1) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) summary(output2)
data(demo) set.seed(1) output2 <- causal.estimate(S, Z, X, Y, B = 5, method = "IC", naturalGroupProp) summary(output2)