Skip to content

Commit

Permalink
styler applied
Browse files Browse the repository at this point in the history
  • Loading branch information
BERENZ committed Feb 1, 2025
1 parent 4d595d0 commit a8ac9f5
Show file tree
Hide file tree
Showing 21 changed files with 458 additions and 436 deletions.
122 changes: 61 additions & 61 deletions R/boot_dr.R
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
boot_dr <- function(outcome,
data,
svydesign,
SelectionModel,
OutcomeModel,
family_outcome,
method_outcome,
start_outcome,
num_boot,
weights,
weights_rand,
R,
theta_hat,
mu_hat,
method_selection,
start_selection,
control_selection,
control_outcome,
control_inference,
n_nons,
n_rand,
optim_method,
est_method,
h,
maxit,
pop_size,
pop_totals,
pop_means,
bias_correction,
verbose,
...) {
data,
svydesign,
SelectionModel,
OutcomeModel,
family_outcome,
method_outcome,
start_outcome,
num_boot,
weights,
weights_rand,
R,
theta_hat,
mu_hat,
method_selection,
start_selection,
control_selection,
control_outcome,
control_inference,
n_nons,
n_rand,
optim_method,
est_method,
h,
maxit,
pop_size,
pop_totals,
pop_means,
bias_correction,
verbose,
...) {
mu_hats <- vector(mode = "numeric", length = num_boot)
k <- 1
rep_type <- control_inference$rep_type
Expand Down Expand Up @@ -262,37 +262,37 @@ boot_dr <- function(outcome,
#' @importFrom parallel stopCluster
#' @importFrom doParallel registerDoParallel
boot_dr_multicore <- function(outcome,
data,
svydesign,
SelectionModel,
OutcomeModel,
family_outcome,
method_outcome,
start_outcome,
num_boot,
weights,
weights_rand,
R,
theta_hat,
mu_hat,
method_selection,
control_selection,
start_selection,
control_outcome,
control_inference,
n_nons,
n_rand,
optim_method,
est_method,
h,
maxit,
pop_size,
pop_totals,
pop_means,
bias_correction,
cores,
verbose,
...) {
data,
svydesign,
SelectionModel,
OutcomeModel,
family_outcome,
method_outcome,
start_outcome,
num_boot,
weights,
weights_rand,
R,
theta_hat,
mu_hat,
method_selection,
control_selection,
start_selection,
control_outcome,
control_inference,
n_nons,
n_rand,
optim_method,
est_method,
h,
maxit,
pop_size,
pop_totals,
pop_means,
bias_correction,
cores,
verbose,
...) {
# mu_hats <- vector(mode = "numeric", length = num_boot)
# k <- 1
if (is.character(family_outcome)) {
Expand Down
63 changes: 31 additions & 32 deletions R/boot_dr_sel.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
boot_dr_sel <- function(X,
R,
y,
svydesign,
weights,
weights_rand,
method_selection,
family_nonprobsvy,
mu_hat,
n_nons,
n_rand,
num_boot,
rep_type,
start_selection,
start_outcome,
verbose) { # TODO function to test
R,
y,
svydesign,
weights,
weights_rand,
method_selection,
family_nonprobsvy,
mu_hat,
n_nons,
n_rand,
num_boot,
rep_type,
start_selection,
start_outcome,
verbose) { # TODO function to test
mu_hats <- vector(mode = "numeric", length = num_boot)
k <- 1
loc_nons <- which(R == 1)
Expand Down Expand Up @@ -107,30 +107,29 @@ boot_dr_sel <- function(X,
)
}


# multicore
#' @importFrom foreach %dopar%
#' @importFrom foreach foreach
#' @importFrom parallel makeCluster
#' @importFrom parallel stopCluster
#' @importFrom doParallel registerDoParallel
boot_dr_sel_multicore <- function(X,
svydesign,
R,
y,
weights,
weights_rand,
method_selection,
family_nonprobsvy,
mu_hat,
n_nons,
n_rand,
num_boot,
rep_type,
start_selection,
start_outcome,
cores,
verbose) {
svydesign,
R,
y,
weights,
weights_rand,
method_selection,
family_nonprobsvy,
mu_hat,
n_nons,
n_rand,
num_boot,
rep_type,
start_selection,
start_outcome,
cores,
verbose) {
mu_hats <- vector(mode = "numeric", length = num_boot)
loc_nons <- which(R == 1)
loc_rand <- which(R == 0)
Expand Down
96 changes: 48 additions & 48 deletions R/boot_ipw.R
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
boot_ipw <- function(X_rand,
X_nons,
svydesign,
weights,
ys,
R,
theta_hat,
num_boot,
weights_rand,
mu_hats,
method_selection,
start_selection,
n_nons,
n_rand,
optim_method,
est_method,
h,
rep_type,
maxit,
control_inference,
control_selection,
verbose,
pop_size,
pop_totals,
...) {
X_nons,
svydesign,
weights,
ys,
R,
theta_hat,
num_boot,
weights_rand,
mu_hats,
method_selection,
start_selection,
n_nons,
n_rand,
optim_method,
est_method,
h,
rep_type,
maxit,
control_inference,
control_selection,
verbose,
pop_size,
pop_totals,
...) {
if (!is.null(weights_rand)) N <- sum(weights_rand)
estimation_method <- get_method(est_method)
method_selection_function <- paste(method_selection, "_model_nonprobsvy", sep = "")
Expand Down Expand Up @@ -184,30 +184,30 @@ boot_ipw <- function(X_rand,
#' @importFrom parallel stopCluster
#' @importFrom doParallel registerDoParallel
boot_ipw_multicore <- function(X_rand,
X_nons,
svydesign,
weights,
ys,
R,
theta_hat,
num_boot,
weights_rand,
mu_hats,
method_selection,
start_selection,
n_nons,
n_rand,
optim_method,
est_method,
h,
maxit,
control_selection,
control_inference,
cores,
pop_size,
pop_totals,
verbose,
...) {
X_nons,
svydesign,
weights,
ys,
R,
theta_hat,
num_boot,
weights_rand,
mu_hats,
method_selection,
start_selection,
n_nons,
n_rand,
optim_method,
est_method,
h,
maxit,
control_selection,
control_inference,
cores,
pop_size,
pop_totals,
verbose,
...) {
if (!is.null(weights_rand)) N <- sum(weights_rand)
estimation_method <- get_method(est_method)
method_selection_function <- paste(method_selection, "_model_nonprobsvy", sep = "")
Expand Down
Loading

0 comments on commit a8ac9f5

Please sign in to comment.