Skip to content
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

an error in cv.grpsurv function when penalty = "gel" or penalty = "cMCP" are used #12

Closed
tangzx998 opened this issue Mar 18, 2017 · 2 comments

Comments

@tangzx998
Copy link

I am using your R package grpreg (grpregOverlap) to perform survival analysis.

First I chose penalty = "grSCAD", then run the following code. it looks okay.
f.over <- grpsurv(x1m, y , penalty = "grSCAD" , group = groupvector, eps=0.005, max.iter=10000)
cv.over <- cv.grpsurv(x1m, y, nfolds = 10, trace=FALSE, seed=1, penalty = "grSCAD" , group = groupvector, lambda=f.over$lambda, eps=0.005, max.iter=10000)

There is no any error, and the output is reasonable.

However, if I set penalty = "gel" or penalty = "cMCP", the following code can run.
f.over <- grpsurv(x1m, y , penalty = "gel" , group = groupvector, eps=0.005, max.iter=10000)
f.over <- grpsurv(x1m, y , penalty = "grSCAD" , group = groupvector, eps=0.005, max.iter=10000)

but, I can not run cross-validation function, as following:
cv.over <- cv.grpsurv(x1m, y, nfolds = 10, trace=FALSE, seed=1, penalty = "gel", group = groupvector, lambda=f.over$lambda, eps=0.005, max.iter=10000)
cv.over <- cv.grpsurv(x1m, y, nfolds = 10, trace=FALSE, seed=1, penalty = "cMCP", group = groupvector, lambda=f.over$lambda, eps=0.005, max.iter=10000)

the error is:
Error in reorderGroups(group, group.multiplier, strtrim(penalty, 2) == :
Length of group.multiplier must equal number of penalized groups

if I remove penalty = "gel" or penalty = "cMCP" from above cv.grpsurv function. there is no error, but the output is unreasonable.
please help me on this problem.

Thanks very much.

Zaixiang Tang
tangzx81@gmail.com

@pbreheny
Copy link
Owner

Zaixiang,

Thank you very much for bringing this to my attention, and I sincerely apologize for how long it has taken me to get back to you on this. Unfortunately, 'grpreg' was in the middle of some massive internal changes and not fully functional on the development end when you filed this issue. However, 'grpreg' is now up and running again, and I believe this issue has been taken care of (as of commit 460cd78). I can't directly test your code because it isn't reproducible, but 'cv.grpsurv' is certainly working with the 'gel' and 'cMCP' penalties.

These changes will be posted to CRAN soon; the new version will be 3.1-0. If you get a chance to test this out, I would very much appreciate you letting me know if this fixes the bug you were running into. And again, I really do apologize for the delay in getting back to you on this.

(I'm closing the issue, but let me know if you're still having issues and I'll re-open it)

@tangzx998
Copy link
Author

tangzx998 commented May 22, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants