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

S. Kundu s.kundu at erasmusmc.nl
Thu Mar 22 12:33:24 CET 2012


Dear Yurii,
Yes, indeed modifying the function will allow for prediction on new data. I will update this in the next version of the package. In your analysis you can modify the code.
Regards,
Suman


Yury Aulchenko said the following:
> 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


More information about the genabel-devel mailing list