bbolker / broom.mixed

tidy methods for mixed models in R
227 stars 23 forks source link

Add some basic testing of tidy.lme() confidence interval arguments #134

Closed matthieu-bruneaux closed 1 year ago

matthieu-bruneaux commented 1 year ago

This PR is to add some basic testing of the fix introduced in PR #133.

The added tests check that the output from tidy.lme() called with conf.int = TRUE has the expected number of columns, with the expected column names. They also check that using conf.level = 0.95 and conf.level = 0.25 gives wider confidence intervals for 0.95 than for 0.25.

The tests are run both for a linear model and for a non-linear model. For the linear model test of confidence intervals, there is a small hack to go around the fact that there are no confidence intervals reported for the residual variance. I added a FIXME note at this location of the test file, referring to an already existing FIXME note in R/nlme_tidiers.R (existing note was: "FIXME: also do confint on residual"), so that one can remember to update the test when the FIXME in nlme_tidiers.R is addressed.

I hope this doesn't make the updated test file too confusing! Please let me know if you think I should address the absence of confint for residual variance in a different way, and I'll be happy to update the PR :)