insongkim / PanelMatch

113 stars 34 forks source link

Environment Error during Refinement #82

Closed Paul-Andrew-Friesen closed 2 years ago

Paul-Andrew-Friesen commented 3 years ago

Receiving message "Error in attr(form, ".Environment") <- environment() : attempt to set an attribute on NULL" in the PanelMatch function. Assuming the issue is sourced from the refinement calculation as I do not receive this message when refinement is set to "none".

justindbk commented 2 years ago

I had this same error message recently, too.

Thanks to some eagle-eye checking from @adamrauh, I realized this was because I wasn't actually specifying any covariates to match on using the covs.formula argument. Therefore when using any kind of matching (that is, anything other than refinement="none") it would throw this error, because there were no covariates to match on. So if you add some covariates, @Paul-Andrew-Friesen, that may fix your issue if you haven't already fixed!