Skip to content

.sanitize_Q_ids() determination of whether each unit has one observation in the model fit #249

@jwasserman2

Description

@jwasserman2

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").

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions