You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: