beta2m: Convert proportional data to M-Values

Description Usage Arguments Details Value Examples

View source: R/beta2m.R

Description

Proportional data are commonly modelled using a glm approach with logit link function. When performing the logit transformation in advance separately, simple OLS methods can be applied.

Usage

1
beta2m(b)

Arguments

b

vector or matrix holding the original data

Details

Data are transformed according to M=log2(b1-b) . The input data are assumed to have the range 0<b<1. Data outside this range will lead to missing values. Corner cases (data of b=0 or b=1) can be handled by use of fixlimits().

Value

A named vector/matrix with same dimensions as b and log2 transformed values

Examples

1
2
3
4
    a <- sapply(c(0.01,0.05,0.5,0.8,0.9),function(x) rbinom(30,100,x)/100)
    matplot(a,pch=20)
    matplot(beta2m(a),pch=20)
    matplot(a,beta2m(a),pch=20)

preputils documentation built on July 1, 2020, 5:35 p.m.

Related to beta2m in preputils...