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] -3.163601445 -0.160229022 -1.614210594  2.381224660 -0.366347769
#>   [6]  0.577674696 -1.622804834 -1.509720990  5.638018577  0.597617075
#>  [11]  2.416786278  1.355733750  2.352050632 -0.444960649 -0.586664696
#>  [16]  0.465683658 -1.434228138 -2.558785246 -0.817790215 -1.553534622
#>  [21]  2.068073280 -0.008607154  0.818454108  1.938761579 -3.994321971
#>  [26] -0.481122684  0.054385499 -3.004507385  1.405752330  0.549790283
#>  [31]  1.215826256  0.007055000  0.901651476 -2.290672822 -2.133229708
#>  [36] -1.237256562 -0.332372155 -0.645461223  0.682094271 -0.227521754
#>  [41] -0.818022627 -0.997943191 -0.992459294 -2.223162878  4.827864146
#>  [46] -2.147911586 -0.263561314  0.775398647 -0.708992392 -0.407370927
#>  [51]  0.843284611 -1.138896031 -3.564373097 -2.585307333 -3.718153256
#>  [56] -1.345536215  0.842000234  3.964918476  1.275317046  0.428328972
#>  [61] -1.334829022  1.172953692  1.508144081  1.158787401  1.575928497
#>  [66] -4.758051105 -2.328113337  2.440719415  0.568411045 -0.335159563
#>  [71]  0.857009742 -1.650612950 -0.498429405  3.668365065 -0.390673505
#>  [76]  0.963186280 -0.467577066 -0.451145486 -1.904129884 -0.921017081
#>  [81] -1.894397401 -0.103897472  3.892289271 -1.597434852 -1.505960175
#>  [86]  1.982421413  0.738464386  0.029776652 -0.074399665  3.419874456
#>  [91] -1.109575121 -1.876298516 -2.613633205 -0.404532879 -0.630753948
#>  [96] -2.424192913 -3.175800940 -1.005261196 -0.061708816  0.421515005

x <- stats::rnorm(n = 100L)
expit(x)
#>   [1] 0.31063480 0.28578984 0.51830868 0.77524555 0.67224827 0.63168830
#>   [7] 0.25707371 0.36801595 0.32844981 0.45538892 0.54114929 0.32576374
#>  [13] 0.36869086 0.35442036 0.76532298 0.54716260 0.56191783 0.74012982
#>  [19] 0.21597116 0.59269450 0.36426078 0.57503562 0.55533898 0.27644454
#>  [25] 0.51300516 0.71095780 0.40253807 0.72194821 0.35704467 0.18594386
#>  [31] 0.20136646 0.20657880 0.32373977 0.38458985 0.79908884 0.84224277
#>  [37] 0.76439115 0.46284404 0.45566094 0.69064188 0.39752332 0.77073916
#>  [43] 0.77562668 0.66500432 0.49330073 0.57678286 0.56214311 0.20481611
#>  [49] 0.64551439 0.50216193 0.52266361 0.34140093 0.38183136 0.50443935
#>  [55] 0.29743635 0.79538644 0.77119324 0.81059991 0.47853521 0.35033460
#>  [61] 0.44565052 0.20982092 0.08610022 0.19623886 0.56325849 0.57343267
#>  [67] 0.51419363 0.47435880 0.87565618 0.70652496 0.21305351 0.52257072
#>  [73] 0.71143384 0.63400132 0.29528776 0.49019759 0.37321435 0.28662150
#>  [79] 0.53750782 0.60834372 0.78914544 0.56132990 0.71946847 0.41528699
#>  [85] 0.43139869 0.59475477 0.80952246 0.84991063 0.61216678 0.66984929
#>  [91] 0.88733355 0.50597736 0.56117928 0.56759835 0.27042674 0.49310595
#>  [97] 0.90228234 0.53879782 0.29543821 0.23604445