dgrtwo / ebbr

Empirical Bayes binomial estimation
Other
69 stars 13 forks source link

prior_subset not working in combination with method = "gamlss" #5

Open marboe123 opened 4 years ago

marboe123 commented 4 years ago

Hello,

I try to add prior_subset to add_ebb_estimate in combination with gamlss as below:

eb_career_ab <- career %>%
  add_ebb_estimate(H, AB, method = "gamlss",
                    prior_subset = AB >= 500,
                   mu_predictors = ~ log10(AB))

Although this gives this error:

Error in lm.wfit(X[onlydata, , drop = FALSE], y, w) : 
  incompatible dimensions
In addition: Warning message:
`data_frame()` is deprecated as of tibble 1.1.0.
Please use `tibble()` instead.

Alternatively I did succeed to fit the prior with ebb_fit_prior on a subset of the data, followed by augment(prior, newdata = full_dataset) on the complete dataset.

Thanks.

jan-glx commented 3 years ago

Can you check if this is solved by #7 ?

marboe123 commented 3 years ago

The error is still the same, although the warning has changed:

Error in lm.wfit(X[onlydata, , drop = FALSE], y, w) : 
  incompatible dimensions
In addition: Warning message:
gamlss tidiers are deprecated and will be removed in an upcoming release of broom. These tidiers are now maintained in the broom.mixed package.