ggPMX
ggPMX copied to clipboard
Test Tomas: Individual plots showing NA when stratified
Describe the bug
The function pmx_plot_individual() showing NA groups when stratified.
To Reproduce
ctr %>% pmx_plot_individual(strat.facet = ~REGREG1C)
Screenshots

Additional context
Further investigation of the individual plot dataset:

@tmss1
- thanks for reporting this
- it has been possible to reproduce the problem and develop a fix
- pull request forthcoming after testing
Not working yet in the latest development version.
While the above example appears to be working now with one facet variable, some subjects and time-points are missing when facetting.
For example, without facetting:
ctrx = pmx_mlxtran(file_name = mlx_fpath)
ctrx %>% pmx_plot_individual()

With facetting, some subjects and time-points are missing as the prediction lines are not covering the same range. For example, see the missing ID=1001_10003 and the shorter prediction line in others.
ctrx %>% pmx_plot_individual(strat.facet = ~REGREG1C)

Also, it cannot handle more than one facet variable. This will give an error, for example,
ctrx %>% pmx_plot_individual(strat.facet = ~REGREG1C+HEM)

In addition, BLOQ plotting cannot be switched off, whether by the bloq argument, or by setting the controller. For example, all of the following will generate the same plots with the red dots (labelled "ignored" to denote the BLOQ data I believe) as above.
ctrx = pmx_mlxtran(file_name=mlx_fpath, bloq=pmx_bloq(cens="CENS", show=FALSE))
ctrx %>% pmx_plot_individual()
ctrx %>% pmx_plot_individual(bloq=pmx_bloq(cens="CENS", show=TRUE))
ctrx %>% pmx_plot_individual(bloq=pmx_bloq(cens="CENS", show=FALSE))