jacob-long / panelr

Regression models and utilities for repeated measures and panel data
Other
97 stars 21 forks source link

wbm doesn't work with natural cubic spline #36

Open Nr051190 opened 3 years ago

Nr051190 commented 3 years ago

Hi,

When running the WBM, inputting either ns or bs from base R leads to the following dplyr error:

Error: Problem with mutate() input bs(age, df = 6). x Input bs(age, df = 6) must return compatible vectors across groups ℹ Input bs(age, df = 6) is bs(age, df = 6). ℹ Result type for group 1 (id = "1833965"): . ℹ Result type for group 2 (id = "68008847"): .

I thought this might have been a problem with LME4, but glmer works fine with a spline.

jacob-long commented 3 years ago

Thank you for reporting this. The way I'm doing the data transformations, I'm not surprised that this fails because I didn't take this sort of usage into consideration. I should be able to deal with this, but it will likely take some time for me to implement that I don't have at the moment. I do think it's worthwhile, though.