bestVariability {lpda}R Documentation

Choosing the best explained variability for lpda-pca model.

Description

bestVariability computes the classification error for lpda.pca models obtained with the number of components needed to reach the explained variability specified in 'Vars' argument. The result is the average classification error rate from the R models computed for each explained variability.

Usage

bestVariability(data, group, ntest = 10, R = 10, Vars = c(0.5,0.7), f1 = NULL, f2 = NULL)

Arguments

data

Matrix containing data. Individuals in rows and variables in columns

group

Vector with the variable group

ntest

Number of samples to evaluate in the test-set.

R

Times the model is evaluated with each Variability indicated in Vars vector.

Vars

The different variabilities to check from which the best variability parameter will be chosen for lpdapca model.

f1

Vector with weights for individuals of the first group. If NULL they are equally weighted.

f2

Vector with weights for individuals of the second group. If NULL they are equally weighted.

Value

bestVar returns a vector with the average prediction error rate obtained from the R models for each variability specified in Vars input.

Author(s)

Maria Jose Nueda, mj.nueda@ua.es

See Also

lpda

Examples

  data(RNAseq)
  group = as.factor(rep(c("G1","G2"),each=30))
  bestVariability(RNAseq, group, ntest = 10, R = 5, Vars = c(0.1,0.9))
  

[Package lpda version 1.0.1 Index]