qstats: qstats

View source: R/qstats.R

qstatsR Documentation

qstats

Description

This function is a helper function that computes quantile statistics for the function qsmooth.

Usage

qstats(object, group_factor, window = 0.05)

Arguments

object

an object which is a data frame or matrix with observations (e.g. probes or genes) on the rows and samples as the columns.

group_factor

a group level continuous or categorial covariate associated with each sample or column in the object. The order of the group_factor must match the order of the columns in object.

window

window size for running median which is a fraction of the number of rows in object. Default is 0.05.

Value

A list of quantile statistics including

Q

sample quantiles

Qref

reference quantile

Qhat

linear model fit at each quantile

SST

total sum of squares

SSB

between sum of squares

SSE

within sum of squares

roughWeights

SSE / SST

smoothWeights

smoothed weights computed using a running median with a given window size.

Examples

dat <- cbind(matrix(rnorm(1000), nrow=100, ncol=10), 
             matrix(rnorm(1000, .1, .7), nrow=100, ncol=10))
qs <- qstats(object = dat, 
             group_factor = rep(c(0,1), each=10), 
             window = 0.05)


stephaniehicks/qsmooth documentation built on Nov. 7, 2022, 1:41 p.m.