Skip to content

logit() computes the binary logit function. This is a simple wrapper for stats::qlogis() with default input arguments.

expit() computes the logistic function. This is a simple wrapper for stats::plogis() with default input arguments.

Usage

logit(x)

expit(x)

Arguments

x

numeric(n).

Value

A numeric(n) corresponding to transformed x.

Examples

x <- stats::runif(n = 100L)
logit(x)
#>   [1]  0.499616647  0.222215872  3.206188606  2.384526260  0.419132311
#>   [6] -0.792863709  0.221509802  2.709719579 -0.553567354 -0.669395114
#>  [11]  1.206525292 -0.840914083  0.530676818  1.401991539  0.169345807
#>  [16]  0.536498772 -1.451382622 -1.364853028  2.561634588 -0.349748316
#>  [21] -1.892410368 -2.731099366  2.051250092  0.373102779  0.956458537
#>  [26]  0.049582150 -0.866089472  0.574401026  2.016739334  2.866213050
#>  [31]  0.892552686  2.492588015 -4.105057499 -1.575186380 -1.301041632
#>  [36]  1.696791254 -1.134553697  0.060219609  1.842020477 -3.163601445
#>  [41] -0.160229022 -1.614210594  2.381224660 -0.366347769  0.577674696
#>  [46] -1.622804834 -1.509720990  5.638018577  0.597617075  2.416786278
#>  [51]  1.355733750  2.352050632 -0.444960649 -0.586664696  0.465683658
#>  [56] -1.434228138 -2.558785246 -0.817790215 -1.553534622  2.068073280
#>  [61] -0.008607154  0.818454108  1.938761579 -3.994321971 -0.481122684
#>  [66]  0.054385499 -3.004507385  1.405752330  0.549790283  1.215826256
#>  [71]  0.007055000  0.901651476 -2.290672822 -2.133229708 -1.237256562
#>  [76] -0.332372155 -0.645461223  0.682094271 -0.227521754 -0.818022627
#>  [81] -0.997943191 -0.992459294 -2.223162878  4.827864146 -2.147911586
#>  [86] -0.263561314  0.775398647 -0.708992392 -0.407370927  0.843284611
#>  [91] -1.138896031 -3.564373097 -2.585307333 -3.718153256 -1.345536215
#>  [96]  0.842000234  3.964918476  1.275317046  0.428328972 -1.334829022

x <- stats::rnorm(n = 100L)
expit(x)
#>   [1] 0.67220730 0.67037577 0.08422289 0.80285992 0.44778835 0.27086282
#>   [7] 0.87674563 0.64429293 0.43003811 0.36151700 0.48373187 0.27672924
#>  [13] 0.76309071 0.50466473 0.86490666 0.24727768 0.43714232 0.19844013
#>  [19] 0.34997444 0.56545077 0.19717980 0.69503211 0.47875879 0.65687092
#>  [25] 0.73330410 0.83616052 0.70167462 0.42509901 0.40233219 0.56291118
#>  [31] 0.47880150 0.65607527 0.19952215 0.81513553 0.48384594 0.30889985
#>  [37] 0.12621082 0.52119832 0.62641703 0.80435700 0.59800028 0.59148417
#>  [43] 0.85058998 0.33591770 0.24740875 0.37707682 0.38806429 0.27787346
#>  [49] 0.41390425 0.55606917 0.35546083 0.79663048 0.85147011 0.45652341
#>  [55] 0.73172590 0.38093061 0.37147765 0.46592229 0.74777098 0.41535921
#>  [61] 0.85493609 0.45718300 0.29424395 0.29109899 0.24683678 0.40104008
#>  [67] 0.55970473 0.65893331 0.70091548 0.34773503 0.31119260 0.40041903
#>  [73] 0.78607232 0.77025160 0.90784389 0.66893335 0.35345974 0.73618781
#>  [79] 0.62420125 0.29399052 0.32913709 0.35321616 0.58219920 0.40511532
#>  [85] 0.86609034 0.51404752 0.08506075 0.48507245 0.60441016 0.80499353
#>  [91] 0.82009260 0.72164714 0.37546645 0.28261653 0.29027780 0.66861990
#>  [97] 0.42664754 0.58688937 0.73818406 0.57053062