Learn R Programming

MDR (version 1.2)

predict.mdr: MDR model predictions

Description

method for class 'mdr' to predict case/control status for new data using a previously fit MDR model.

Usage

"predict"(object, new.data,...)

Arguments

object
an object of class 'mdr', a result of a call to either mdr.cv or mdr.3WS
new.data
a new data set with the same original variables in the same order, without the response
...
additional arguments

Value

a vector with predicted binary status ...

See Also

mdr.cv, mdr.3WS, summary.mdr, plot.mdr

Examples

Run this code
#load data
data(mdr1)

#fit mdr model to a subset of the sample data
fit<-mdr.cv(data=mdr1[,1:11], K=2, cv=5) 

#create 'new' data from which to predict
new<-mdr1[,2:11] #same predictor variables, without the response

predict(fit, new.data=new) #predict case/control status for this 'new' data

Run the code above in your browser using DataLab