eCDF with confidence intervals

ecdf_fun(x, CI = TRUE, CI.interval = 0.95)

Arguments

x

numeric vector of the observations for ecdf; for the methods, an object inheriting from class "ecdf".

CI

If TRUE CDF confidence intervals will be calculated; default is set to TRUE.

CI.interval

Confidence interval; default is set to 0.95

Value

Compute an empirical cumulative distribution function, returns a data frame with value and proporiton. Code based on base eCDF function.

Examples

set.seed(12)
test<-rnorm(100)
ecdf_fun(test)
#>            value proportion      lwr.CI    upr.CI
#> 1   -2.149260002       0.01 0.000000000 0.1458102
#> 2   -1.997642097       0.02 0.000000000 0.1558102
#> 3   -1.595625656       0.03 0.000000000 0.1658102
#> 4   -1.480567595       0.04 0.000000000 0.1758102
#> 5   -1.314272797       0.05 0.000000000 0.1858102
#> 6   -1.293882298       0.06 0.000000000 0.1958102
#> 7   -1.274059551       0.07 0.000000000 0.2058102
#> 8   -1.271053787       0.08 0.000000000 0.2158102
#> 9   -1.155992890       0.09 0.000000000 0.2258102
#> 10  -1.070492158       0.10 0.000000000 0.2358102
#> 11  -1.050890062       0.11 0.000000000 0.2458102
#> 12  -1.025244839       0.12 0.000000000 0.2558102
#> 13  -1.007298960       0.13 0.000000000 0.2658102
#> 14  -1.004451202       0.14 0.004189848 0.2758102
#> 15  -0.984673797       0.15 0.014189848 0.2858102
#> 16  -0.977053283       0.16 0.024189848 0.2958102
#> 17  -0.963398332       0.17 0.034189848 0.3058102
#> 18  -0.956744479       0.18 0.044189848 0.3158102
#> 19  -0.920005248       0.19 0.054189848 0.3258102
#> 20  -0.779566508       0.20 0.064189848 0.3358102
#> 21  -0.777719582       0.21 0.074189848 0.3458102
#> 22  -0.703464254       0.22 0.084189848 0.3558102
#> 23  -0.694737942       0.23 0.094189848 0.3658102
#> 24  -0.633838203       0.24 0.104189848 0.3758102
#> 25  -0.628255237       0.25 0.114189848 0.3858102
#> 26  -0.541888860       0.26 0.124189848 0.3958102
#> 27  -0.541028649       0.27 0.134189848 0.4058102
#> 28  -0.525400626       0.28 0.144189848 0.4158102
#> 29  -0.492599111       0.29 0.154189848 0.4258102
#> 30  -0.485141355       0.30 0.164189848 0.4358102
#> 31  -0.479512562       0.31 0.174189848 0.4458102
#> 32  -0.429406611       0.32 0.184189848 0.4558102
#> 33  -0.383950394       0.33 0.194189848 0.4658102
#> 34  -0.372456732       0.34 0.204189848 0.4758102
#> 35  -0.342289274       0.35 0.214189848 0.4858102
#> 36  -0.315348711       0.36 0.224189848 0.4958102
#> 37  -0.308503656       0.37 0.234189848 0.5058102
#> 38  -0.302459245       0.38 0.244189848 0.5158102
#> 39  -0.293305149       0.39 0.254189848 0.5258102
#> 40  -0.272296044       0.40 0.264189848 0.5358102
#> 41  -0.267384830       0.41 0.274189848 0.5458102
#> 42  -0.250038722       0.42 0.284189848 0.5558102
#> 43  -0.239013591       0.43 0.294189848 0.5658102
#> 44  -0.202110338       0.44 0.304189848 0.5758102
#> 45  -0.199105661       0.45 0.314189848 0.5858102
#> 46  -0.182519622       0.46 0.324189848 0.5958102
#> 47  -0.177968544       0.47 0.334189848 0.6058102
#> 48  -0.176724455       0.48 0.344189848 0.6158102
#> 49  -0.152416238       0.49 0.354189848 0.6258102
#> 50  -0.112670576       0.50 0.364189848 0.6358102
#> 51  -0.106463885       0.51 0.374189848 0.6458102
#> 52  -0.103310466       0.52 0.384189848 0.6558102
#> 53  -0.042684912       0.53 0.394189848 0.6658102
#> 54  -0.023379409       0.54 0.404189848 0.6758102
#> 55   0.004258039       0.55 0.414189848 0.6858102
#> 56   0.011951759       0.56 0.424189848 0.6958102
#> 57   0.104984233       0.57 0.434189848 0.7058102
#> 58   0.129262533       0.58 0.444189848 0.7158102
#> 59   0.131122595       0.59 0.454189848 0.7258102
#> 60   0.145799896       0.60 0.464189848 0.7358102
#> 61   0.189997859       0.61 0.474189848 0.7458102
#> 62   0.197128917       0.62 0.484189848 0.7558102
#> 63   0.223641415       0.63 0.494189848 0.7658102
#> 64   0.250320103       0.64 0.504189848 0.7758102
#> 65   0.274784178       0.65 0.514189848 0.7858102
#> 66   0.314204596       0.66 0.524189848 0.7958102
#> 67   0.340512271       0.67 0.534189848 0.8058102
#> 68   0.362064721       0.68 0.544189848 0.8158102
#> 69   0.376448400       0.69 0.554189848 0.8258102
#> 70   0.406546694       0.70 0.564189848 0.8358102
#> 71   0.428014802       0.71 0.574189848 0.8458102
#> 72   0.449465922       0.72 0.584189848 0.8558102
#> 73   0.452281257       0.73 0.594189848 0.8658102
#> 74   0.456827248       0.74 0.604189848 0.8758102
#> 75   0.506968172       0.75 0.614189848 0.8858102
#> 76   0.516755802       0.76 0.624189848 0.8958102
#> 77   0.539249744       0.77 0.634189848 0.9058102
#> 78   0.578134627       0.78 0.644189848 0.9158102
#> 79   0.673981164       0.79 0.654189848 0.9258102
#> 80   0.731453357       0.80 0.664189848 0.9358102
#> 81   0.734652106       0.81 0.674189848 0.9458102
#> 82   0.798105326       0.82 0.684189848 0.9558102
#> 83   0.834325038       0.83 0.694189848 0.9658102
#> 84   0.846790152       0.84 0.704189848 0.9758102
#> 85   0.855768432       0.85 0.714189848 0.9858102
#> 86   0.897156750       0.86 0.724189848 0.9958102
#> 87   0.897559402       0.87 0.734189848 1.0000000
#> 88   0.971120270       0.88 0.744189848 1.0000000
#> 89   0.994420600       0.89 0.754189848 1.0000000
#> 90   1.011979118       0.90 0.764189848 1.0000000
#> 91   1.033702981       0.91 0.774189848 1.0000000
#> 92   1.113709078       0.92 0.784189848 1.0000000
#> 93   1.145061573       0.93 0.794189848 1.0000000
#> 94   1.164465880       0.94 0.804189848 1.0000000
#> 95   1.188879156       0.95 0.814189848 1.0000000
#> 96   1.577169472       0.96 0.824189848 1.0000000
#> 97   1.954105255       0.97 0.834189848 1.0000000
#> 98   2.007201457       0.98 0.844189848 1.0000000
#> 99   2.020334842       0.99 0.854189848 1.0000000
#> 100  2.072035768       1.00 0.864189848 1.0000000