Closed jsocolar closed 9 months ago
I think for a similar reason get_Z also fails in
fd1 <- simulate_flocker_data()
get_Z(example_flocker_model_single, new_data = fd1$unit_covs, history_condition = FALSE)
I think the problem is the assertion at line 154 of fitted_flocker.R
assertthat::assert_that(
all(names(flocker_fit$data) %in% names(new_data_fmtd)),
msg = "new_data is missing columns required by flocker_fit (some covariates are missing or misnamed)"
)
We need this not to apply to event covariates when only unit covariates are required, and we need this not to apply to unneeded indexing columns.
We check that all of the important columns from the original data are present in the new data, but in doing so we incorrectly error when indexing columns are missing.