-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in plotting functions plot.CBPS
and plot.CBPSContinuous
when using "covars" argument
#21
Comments
Thanks for this. Would you mind making a pull request? Also, the |
Thank you for flagging these. I've pushed an update that fixed the plotting issues and will get that on CRAN later this week. Can you please post code so that I can replicate the CBMSM bug you've run into? I didn't code that one myself, so I want to make sure I understand what's going on so that I can fix the documentation. |
Hi Christian, Thanks for fixing the plotting issues faster than I could get round to making a pull request! In the code below I've used the example for
|
Thanks, I've replicated your error, and that seems like bad behavior to me. I will consider a documentation fix as a last resort, but I'm trying to figure out what's causing it. Will probably take a little while, since rtools is also giving me crap after the 4.0 update, but I will do my best to figure this out. |
I wasn't able to figure out what in CBMSM is causing the function to rely on observations being sorted by time, so I have simply added to the documentation that the function expects data to be sorted by time, as you have suggested. Thank you so much for flagging these issues for us. |
Hi,
Firstly, thanks for your work on this package.
I have found some minor bugs in the plotting functionality:
plot.CBPS
fails if "covars" is not in the form1:x
wherex
is a number less than the number of covariates e.g3:4
orc(1, 2, 4)
would not work.I think the reason is that these lines select according to "covars":
balanced.std.mean <- bal.x[["balanced"]][covars, ]
original.std.mean <- bal.x[["original"]][covars, ]
but then later (in the for loop) the code tries to select the rows "covars" from
balanced.std.mean
andoriginal.std.mean
which causes an error. So selecting the rows according to "covars" should only happen once.plot.CBPSContinuous
fails when "silent = FALSE" is used in combination with "covars".The bug here is in the code that returns the output. I think it should be
data.frame(covariate = rownames(bal.x[["balanced"]])[covars], balanced = balanced.abs.cor, original = original.abs.cor))
instead ofdata.frame(covariate = rownames(bal.x[["balanced"]]), balanced = balanced.abs.cor, original = original.abs.cor)
I also noticed that the documentation for
CBMSM
doesn't state that the data need to be sorted by "time" rather than "id". My data were sorted by "id" and it took me a long time to work out why I was getting weights estimates of NA, so it would be really helpful if this could be added to the documentation.I am using version 0.21 of CBPS on R 3.6.3.
Thanks!
The text was updated successfully, but these errors were encountered: