beta2m {preputils} | R Documentation |
Convert proportional data to M-Values
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
beta2m(b)
Arguments
b |
vector or matrix holding the original data |
Details
Data are transformed according to M=log2(b⁄1-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
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)
[Package preputils version 1.0.3 Index]