Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/maic_anchored.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ maic_anchored <- function(weights_object,

# : assign weights to real and pseudo ipd
if (normalize_weights) {
ipd$weights <- weights_object$data$scaled_weights[match(weights_object$data$USUBJID, ipd$USUBJID)]
ipd$weights <- weights_object$data$scaled_weights[match(ipd$USUBJID, weights_object$data$USUBJID)]
} else {
ipd$weights <- weights_object$data$weights[match(weights_object$data$USUBJID, ipd$USUBJID)]
ipd$weights <- weights_object$data$weights[match(ipd$USUBJID, weights_object$data$USUBJID)]
}
pseudo_ipd$weights <- 1
if (!"USUBJID" %in% names(pseudo_ipd)) pseudo_ipd$USUBJID <- paste0("ID", seq_len(nrow(pseudo_ipd)))
Expand Down
4 changes: 2 additions & 2 deletions R/maic_unanchored.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ maic_unanchored <- function(weights_object,

# : assign weights to real and pseudo ipd
if (normalize_weights) {
ipd$weights <- weights_object$data$scaled_weights[match(weights_object$data$USUBJID, ipd$USUBJID)]
ipd$weights <- weights_object$data$scaled_weights[match(ipd$USUBJID, weights_object$data$USUBJID)]
} else {
ipd$weights <- weights_object$data$weights[match(weights_object$data$USUBJID, ipd$USUBJID)]
ipd$weights <- weights_object$data$weights[match(ipd$USUBJID, weights_object$data$USUBJID)]
}
pseudo_ipd$weights <- 1

Expand Down
2 changes: 1 addition & 1 deletion vignettes/anchored_binary.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ result$inferential$fit$res_AB
# merge in adrs with ipd_matched

ipd <- adrs_twt
ipd$weights <- weighted_data$data$weights[match(weighted_data$data$USUBJID, ipd$USUBJID)]
ipd$weights <- weighted_data$data$weights[match(ipd$USUBJID, weighted_data$data$USUBJID)]

pseudo_ipd <- pseudo_adrs
pseudo_ipd$weights <- 1
Expand Down
2 changes: 1 addition & 1 deletion vignettes/anchored_survival.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ result$inferential$fit$res_AB
# merge in adtte with ipd_matched

ipd <- adtte_twt
ipd$weights <- weighted_data$data$weights[match(weighted_data$data$USUBJID, ipd$USUBJID)]
ipd$weights <- weighted_data$data$weights[match(ipd$USUBJID, weighted_data$data$USUBJID)]

pseudo_ipd <- pseudo_ipd_twt
pseudo_ipd$weights <- 1
Expand Down