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

Error apears when I run: predict(plsRcoxmodel, type="expected") #2

Open
psalguerog opened this issue Jul 13, 2020 · 0 comments
Open

Comments

@psalguerog
Copy link

psalguerog commented Jul 13, 2020

Hello fbertran,

When I'm run a plsRcox model and then I want to predict new variables I can use different types of prediction ("risk", "expected", ...) but I am having a problem to run it with type "expected".

Error in model.frame.default(data = ttpred, formula = YwotNA ~ tt.1 + : variable lengths differ (found for 'tt.1')

I was looking into the code/error and seems like you can only predict the same data as you used to train the model. If you use another data, the predict function can not multiply the PLS components because I think the function is using the length of the train data instead of the new ones.

If you run the predict function with the train data as new data, it works, but if you select a subset of the train data it fails again.

How can I fix that problem? Any solution?

PS: Also I changed your predict.plsRcoxmodel function to work with the parameter "reference" as predict.coxph uses. I think should be great if you accept also this parameter.

Thank you,
Pedro Salguero

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