# findWeights: Finds weights of each level of a factor. In RUVcorr: Removal of unwanted variation for gene-gene correlations and related analysis

## Description

findWeights returns a list of variances and weights based on the correlation between genes for each level of a factor found in the annotation. This function is typically used to find the weights of each individual in the data set.

## Usage

 1 findWeights(X, anno, Factor) 

## Arguments

 X A matrix of gene expression values. anno A dataframe or a matrix containing the annotation of arrays in X. Factor A character string corresponding to a column name of anno. For all levels of this factor corresponding weights will be calculated.

## Details

Note that because calculations of weights include finding correlations between all genes, this function might take some time. Hence, recalculation of weights is not advisable and should be avoided. However often the inverse variances can be used to calculate new weights. In particlular, when W_i denotes the weight of the i^{th} level and V_i the variance as calculated from the gene-gene correlations:

W_i=\frac{\frac{1}{V_i}}{∑_{i=1}^{n}\frac{1}{V_i}}

## Value

findWeights returns output of the class Weights. An object of class Weights is a list with the following components:

• Weights A list containing the weights of each level of Factor.

• Inv.Sigma A list containing the inverse variances of each level of Factor.

## Examples

 1 2 3 4 5 Y<-simulateGEdata(500, 500, 10, 2, 5, g=NULL, Sigma.eps=0.1, 250, 100, intercept=FALSE, check.input=FALSE) anno<-as.matrix(sample(1:4, dim(Y$Y)[1], replace=TRUE)) colnames(anno)<-"Factor" findWeights(Y$Y, anno, "Factor") 

RUVcorr documentation built on Nov. 8, 2020, 5:10 p.m.