I don't think it should compare nrow(uoa_cls_df) == nrow(x$model) here:
|
if (nrow(uoa_cls_df) == nrow(x$model)) { |
My thinking is that x$model removes NA's, and since uoa_cls_df will have a row for every unit regardless of whether its individuals are included in the model fit, we want to compare the number of rows in it to the number of rows in the model-fitting dataframe that includes rows that are excluded from the fit. Therefore, I think we should replace nrow(x$model) with nrow(expand.model.frame(x, uoa_cols)), where uoa_cols are obtained by var_names(x@StudySpecification, "u").
I don't think it should compare
nrow(uoa_cls_df) == nrow(x$model)here:propertee/R/teeMod.R
Line 769 in 223247d
My thinking is that
x$modelremoves NA's, and sinceuoa_cls_dfwill have a row for every unit regardless of whether its individuals are included in the model fit, we want to compare the number of rows in it to the number of rows in the model-fitting dataframe that includes rows that are excluded from the fit. Therefore, I think we should replacenrow(x$model)withnrow(expand.model.frame(x, uoa_cols)), whereuoa_colsare obtained byvar_names(x@StudySpecification, "u").