Logit and Expit Transformations
logit.Rd
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.
Examples
x <- stats::runif(n = 100L)
logit(x)
#> [1] 0.98545697 -2.99139444 -0.19511379 1.35085857 1.54798370
#> [6] -1.33065185 -1.59839158 3.90590613 0.40825760 -1.72151364
#> [11] -0.88211989 -0.20850967 1.54305108 3.45582330 -0.86925587
#> [16] -1.19318524 -0.72869558 -2.19309674 -0.70716596 -1.43321206
#> [21] -1.00034479 2.02628514 0.71100487 -2.52213299 0.77827957
#> [26] 0.40886456 0.87671235 -0.12750843 -4.49990877 1.28497649
#> [31] 0.49742199 1.86655138 2.44034244 -0.72906963 2.38611124
#> [36] -2.43496632 1.77854962 -0.82346336 1.02715026 2.76873170
#> [41] 1.82381475 -0.55730991 2.34484344 1.11425866 0.58180403
#> [46] 1.35809758 4.18267957 0.49961665 0.22221587 3.20618861
#> [51] 2.38452626 0.41913231 -0.79286371 0.22150980 2.70971958
#> [56] -0.55356735 -0.66939511 1.20652529 -0.84091408 0.53067682
#> [61] 1.40199154 0.16934581 0.53649877 -1.45138262 -1.36485303
#> [66] 2.56163459 -0.34974832 -1.89241037 -2.73109937 2.05125009
#> [71] 0.37310278 0.95645854 0.04958215 -0.86608947 0.57440103
#> [76] 2.01673933 2.86621305 0.89255269 2.49258802 -4.10505750
#> [81] -1.57518638 -1.30104163 1.69679125 -1.13455370 0.06021961
#> [86] 1.84202048 -3.16360145 -0.16022902 -1.61421059 2.38122466
#> [91] -0.36634777 0.57767470 -1.62280483 -1.50972099 5.63801858
#> [96] 0.59761707 2.41678628 1.35573375 2.35205063 -0.44496065
x <- stats::rnorm(n = 100L)
expit(x)
#> [1] 0.4096492 0.2954755 0.3760011 0.7711308 0.6240932 0.1095865
#> [7] 0.5085190 0.7011392 0.6777014 0.6357937 0.2229455 0.4482178
#> [13] 0.6044327 0.3759680 0.3517118 0.9177121 0.4588537 0.3916442
#> [19] 0.6276097 0.1280488 0.1210366 0.6274284 0.6852021 0.3074392
#> [25] 0.7131533 0.7208645 0.2061894 0.5876298 0.6295447 0.4228768
#> [31] 0.4392625 0.4275441 0.2445145 0.2454772 0.8863450 0.2870984
#> [37] 0.6126296 0.4883475 0.3360483 0.1840975 0.4031125 0.1480873
#> [43] 0.4903343 0.3106348 0.2857898 0.5183087 0.7752455 0.6722483
#> [49] 0.6316883 0.2570737 0.3680160 0.3284498 0.4553889 0.5411493
#> [55] 0.3257637 0.3686909 0.3544204 0.7653230 0.5471626 0.5619178
#> [61] 0.7401298 0.2159712 0.5926945 0.3642608 0.5750356 0.5553390
#> [67] 0.2764445 0.5130052 0.7109578 0.4025381 0.7219482 0.3570447
#> [73] 0.1859439 0.2013665 0.2065788 0.3237398 0.3845899 0.7990888
#> [79] 0.8422428 0.7643912 0.4628440 0.4556609 0.6906419 0.3975233
#> [85] 0.7707392 0.7756267 0.6650043 0.4933007 0.5767829 0.5621431
#> [91] 0.2048161 0.6455144 0.5021619 0.5226636 0.3414009 0.3818314
#> [97] 0.5044394 0.2974363 0.7953864 0.7711932