RelimpPCR.predict {RelimpPCR} | R Documentation |
Predictor Function for RelimpPCR
Description
This function takes the trained RelimpPCR object and proceeds to perform a prediction from the best model (as defined in the documentation of RelimpPCR()).
Usage
RelimpPCR.predict(pcr, newdata)
Arguments
pcr |
(pcr_object): The trained RelimpPCR object produced by the RelimpPCR() function. |
newdata |
(data frame): The new X value(s) you wish to draw a prediction from. |
Value
pred (data frame): A data frame containing the preictions.
Examples
#The below function takes a trained PCR object (produced by RelimpPCR)
#and a dataframe (using the same columns that the PCR object was trained
#with) and produces a prediction.
y = mtcars$mpg[1:20]; x = mtcars[1:20,c("cyl","disp")]
pcr_object = RelimpPCR(Y = y, X = x,target_r2 = 0.75, multicore = FALSE,
remove_factors = FALSE, normalize_data = FALSE, plot_this = FALSE)
pred = RelimpPCR.predict(pcr_object, data.frame(mtcars$cyl, mtcars$disp))
[Package RelimpPCR version 0.3.0 Index]