get_predictions_lin: Predictions for linear regression

Description Usage Arguments Value See Also Examples

View source: R/carrot_functions.R

Description

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

Usage

1
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

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

CARRoT documentation built on June 8, 2021, 5:09 p.m.