-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
case weights #308
base: main
Are you sure you want to change the base?
case weights #308
Conversation
@mattsecrest I think this weight calculation could be called from the setMethod(
f = "prepare_stan_data_inputs",
signature = c("OutcomeSurvPEM", "BorrowingPowerPriorCaseWeights", "ANY"),
definition = function(outcome, borrowing, analysis_obj) {
analysis_obj <- cast_mat_to_long_pem(analysis_obj)
analysis_obj <- calculate_case_weights(analysis_object)
....
# Add covariates and weights
data_in <- add_covariates_and_weights(data_in, analysis_obj, data_matrix)
return(data_in)
}) |
Hey @gravesti, still need some time to review as I work my way thruogh the SI text. In the meantime, is your example code working?
I'm erroring from mismatched dimensions here: psborrow2/R/case_weight_helpers.R Line 231 in d47af1c
|
Other, high-level thoughts as I keep going through the SI text:
If you prefer yours, let's go with it. I only preferred this b/c it separates the two steps more cleanly. |
I avoided that so we don't duplicate all the data transformation, finding the variables etc. |
@mattsecrest Please have a look at the overall idea :)
This code creates a borrowing type for case weights. If any weights were specified in the outcome object
they will be silently ignored. Is that the point of #309 to create another borrowing type and remove the weights from
the outcome?
Using the same same example, the results are quite different from the full or HC borrowing.