get_predictions_lin {CARRoT}R Documentation

Predictions for linear regression

Description

Function which runs a linear regression on a training set, computes predictions for the test set

Usage

get_predictions_lin(trset,testset,outc,k)

Arguments

trset

values of predictors on the training set

testset

values of predictors on the test set

outc

values of predictors on the training set

k

length of the test set

Value

An array of continous variables of the length equal to the size of a testset

See Also

Function uses function lsfit and coef

Examples

trset<-matrix(c(rnorm(90,2,4),runif(90,0,0.5),rbinom(90,1,0.5)),ncol=3)

testset<-matrix(c(rnorm(10,2,4),runif(10,0,0.5),rbinom(10,1,0.5)),ncol=3)

get_predictions_lin(trset,testset,runif(90,0,1),10)

[Package CARRoT version 2.5.2 Index]