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

cv.grpsurvOverlap #4

Open
gunthergl opened this issue Sep 2, 2019 · 0 comments
Open

cv.grpsurvOverlap #4

gunthergl opened this issue Sep 2, 2019 · 0 comments

Comments

@gunthergl
Copy link

Hi, when trying to use cv.grpsurvOverlap I get the following error:

Error in cv.grpsurv(X = fit$X.latent, y = y, group = fit$grp.vec, ...,  : 
argument "cv.ind" is missing, with no default

MWE:

library(grpreg)
X <- Lung$X
y <- survival::Surv(time = Lung$y[, 1], event = Lung$y[, 2])
group <- Lung$group

fit <- grpsurv(X, y, group)
# plot(fit)
fit <- cv.grpsurv(X, y, group)
# plot(fit)

library(grpregOverlap)

named.groups <- lapply(levels(group), function(x)colnames(X)[levels(group) == x])
names(named.groups) <- levels(group)

# I know there are no overlapping groups now, but that should not matter:
cv.fit <- cv.grpsurvOverlap(
	X = X
	,y = y
	,group = named.groups
	,penalty="gel"
	,trace = TRUE
	# ,cv.ind = 1
)

The previous cv.grpsurvOverlap now throws the mentioned error, as well as the following:

# Generating overlapping groups:
named.groups_overlapping <- named.groups
named.groups_overlapping$trt <- c(named.groups$trt, "age2")
cv.fit <- cv.grpsurvOverlap(
	X = X
	,y = y
	,group = named.groups_overlapping
	,penalty="gel"
	,trace = TRUE
	# ,cv.ind = 1
)

I found that cv.grpsurvOverlap.R calls cv.grpsurv with cv.ind=cv.ind but cv.grpsurv's code does not seem to use it?

I must have missed something somewhere because if cv.ind was not used at all the error would not even occur.

Maybe a second issue; But defining cv.ind with any value seems to solve the problem and does not change anything in the cv folds.

Could you please take a look?

Best regards

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

1 participant