[GenABEL-dev] "data" argument in PredictABEL::predRisk

Yury Aulchenko yurii.aulchenko at gmail.com
Wed Mar 21 22:22:59 CET 2012


Hi Suman,

about the predRisk function of PredictABEL, we think that 

> function (riskModel, data, cID, filename) 
> {
>     if (any(class(riskModel) == "glm")) {
>         predrisk <- predict(riskModel, type = "response")

here you meant actually

predrisk <- predict(riskModel, newdata=data, type = "response")

which would allow to do prediction with estimated model on new data

>     }
>     else {
>         stop("The argument 'riskModel' should be a (GLM)model")
>     }
>     if (!missing(data) && !missing(cID) && !missing(filename)) {
>         tab <- cbind(ID = data[, cID], PredRisk = predrisk)
>         write.table(tab, file = filename, row.names = FALSE, 
>             sep = "\t")
>     }
>     return(predrisk)
> }
> 

Should we fix that in the code in repo?

bw,
Lina & Yurii
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20120321/af711da9/attachment.html>


More information about the genabel-devel mailing list