RelimpPCR.predict: Predictor Function for RelimpPCR

Description Usage Arguments Value Examples

View source: R/RelimpPCR_Predict.R

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

1
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

1
2
3
4
5
6
7
#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))

RelimpPCR documentation built on May 6, 2019, 1:06 a.m.