Description Usage Arguments Value Examples
Computes association test pvalues from a generalized linear model for each considered threshold, and computes a pvalue for the combination of all the envisioned thresholds through Fisher's method using perturbation resampling.
1 2 3  test_combine(match_prob, y, x, thresholds = seq(from = 0.5, to = 0.95, by =
0.05), nb_perturb = 200, dist_family = c("gaussian", "binomial"),
impute_strategy = c("weighted average", "best"))

match_prob 
matching probabilities matrix (e.g. obtained through 
y 
response variable of length 
x 
a 
thresholds 
a vector (possibly of length 
nb_perturb 
the number of perturbation used for the pvalue combination. Default is 200. 
dist_family 
a character string indicating the distribution family for the glm.
Currently, only 
impute_strategy 
a character string indicating which strategy to use to impute x
from the matching probabilities 
a list containing the following:
influencefn_pvals
pvalues obtained from influence function perturbations
with the covariates as columns and the thresholds
as rows, with an additional row
at the top for the combination
wald_pvals
a matrix containing the pvalues obtained from the Wald
test with the covariates as columns and the thresholds
as rows
ptbed_pvals
a list containing, for each covariates, a matrix with
the nb_perturb
perturbed pvalues with the different thresholds
as rows
theta_impute
a matrix of the estimated coefficients from the glm when imputing
the weighted average for covariates (as columns) with the thresholds
as rows
sd_theta
a matrix of the estimated SD (from the influence function) of the
coefficients from the glm when imputing the weighted average for covariates (as columns),
with the thresholds
as rows
ptbed_theta_impute
a list containing, for each covariates, a matrix with
the nb_perturb
perturbed estimated coefficients from the glm when imputing
the weighted average for covariates, with the different thresholds
as rows
impute_strategy
a character string indicating which impute
strategy was used (either "weighted average"
or "best"
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  #rm(list=ls())
res < list()
n_sims < 1#5000
for(n in 1:n_sims){
x < matrix(ncol=2, nrow=99, stats::rnorm(n=99*2))
#plot(density(rbeta(n=1000, 1,2)))
match_prob < matrix(rbeta(n=103*99, 1, 2), nrow=103, ncol=99)
#y < rnorm(n=103, 1, 0.5)
#res[[n]] < test_combine(match_prob, y, x, dist_family="gaussian")$influencefn_pvals
y < rbinom(n=103, 1, prob=0.5)
res[[n]] < test_combine(match_prob, y, x, dist_family="binomial")$influencefn_pvals
cat(n, "/", n_sims, "\n", sep="")
}
size < matrix(NA, ncol=nrow(res[[1]]), nrow=ncol(res[[1]])2)
colnames(size) < rownames(res[[1]])
rownames(size) < colnames(res[[1]])[(1:0 + ncol(res[[1]]))]
for(i in 1:(ncol(res[[1]])2)){
size[i, ] < rowMeans(sapply(res, function(m){m[, i]<0.05}), na.rm = TRUE)
}
size

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.