Home » date » 2008 » Jan » 30 » attachments

Binghnetty Logistic Regression 6 (males and females)

R Software Module: rwasp_logisticregression.wasp (opens new window with default values)
Title produced by software: Bias-Reduced Logistic Regression
Date of computation: Wed, 30 Jan 2008 05:13:01 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Jan/30/t1201695322glqrbeoba4s4vw4.htm/, Retrieved Wed, 30 Jan 2008 13:15:22 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
1 70.6 1 7.8 1 1 71.3 1 6.0 1 1 67.5 1 6.0 1 1 73.2 1 7.1 1 1 81.2 1 5.9 1 1 75.5 1 3.6 1 1 66.7 1 6.9 1 1 68.7 1 8.0 1 1 73.0 1 5.6 1 1 78.4 1 6.1 1 1 76.1 1 5.1 1 1 65.7 1 5.0 1 1 66.7 1 5.2 1 1 72.3 1 2.9 1 1 66.2 1 4.9 1 1 67.7 1 4.7 1 1 64.9 1 6.5 1 1 72.2 1 7.5 1 1 69.4 1 3.9 1 1 72.8 1 3.2 1 1 75.4 1 4.5 1 1 74.7 1 6.5 1 1 77.4 1 7.4 1 1 68.8 1 3.3 1 1 75.3 1 5.9 1 1 72.4 1 4.8 1 1 72.7 1 4.4 1 1 65.3 1 5.4 1 1 67.0 1 5.9 1 1 66.7 1 6.1 1 1 67.0 1 5.4 1 1 67.5 1 6.0 1 1 69.9 1 4.9 1 1 72.5 1 5.3 1 1 73.8 1 6.0 1 1 71.9 1 3.2 1 1 69.9 1 6.5 1 1 71.4 1 3.6 1 1 64.9 1 5.9 1 1 70.2 1 5.2 1 1 65.3 1 7.3 1 1 67.5 1 8.9 1 1 68.1 1 1.8 1 1 82.9 1 6.5 1 1 66.2 1 3.0 1 1 74.0 1 7.0 1 1 69.8 1 7.0 1 1 81.3 1 5.9 1 1 76.9 1 6.3 1 1 76.6 1 3.8 1 1 72.7 1 7.6 1 1 78.6 1 6.3 1 1 70.2 1 5.6 1 1 69.5 1 6.4 1 1 73.8 1 7.5 1 1 66.1 1 7.0 1 1 77.8 1 1.1 1 1 73.2 1 6.0 1 1 72.8 1 6.5 1 1 74.8 1 5.7 1 1 67.2 1 5.5 1 1 80.7 1 6.4 1 1 67.2 1 6.5 1 1 75.4 1 1.9 1 1 75.3 1 3.4 1 1 73.2 1 6.4 1 1 65.3 1 1.6 1 1 71.8 1 6.8 1 1 67.3 1 6.1 1 1 73.7 1 6.3 1 1 80.6 0 5.1 1 1 75.7 0 4.7 1 1 73.0 0 4.1 1 1 71.3 0 3.0 1 1 70.8 0 6.5 1 1 69.6 0 5.3 1 1 66.1 0 6.4 1 1 65.6 0 6.8 1 0 65.0 1 12.0 1 0 65.0 1 7.0 1 0 65.0 0 6.0 1 0 65.0 1 5.0 1 0 65.0 1 7.0 1 0 65.0 1 8.0 1 0 65.0 0 5.0 1 0 65.0 1 8.0 1 0 65.0 1 5.0 1 0 65.0 1 6.0 1 0 65.0 1 9.0 1 0 65.0 0 7.0 1 0 65.0 1 6.0 1 0 65.0 0 6.0 1 0 65.0 0 7.0 1 0 65.0 0 6.0 1 0 65.0 0 6.0 1 0 65.0 0 8.0 1 0 65.0 0 7.0 1 0 65.0 0 5.0 1 0 65.0 0 7.0 1 0 65.0 0 7.0 1 0 65.0 1 6.0 1 0 65.0 1 5.0 1 0 65.0 1 7.0 1 0 65.0 0 8.0 1 0 65.0 1 8.0 1 0 65.0 0 9.0 1 0 65.0 0 99.0 1 0 65.0 0 8.0 1 0 65.0 0 6.0 1 0 65.0 1 5.0 1 0 65.0 1 9.0 1 0 65.0 1 7.0 1 0 65.0 1 6.0 1 0 65.0 1 7.0 1 0 65.0 0 6.0 1 0 65.0 0 6.0 1 0 65.0 1 7.0 1 0 65.0 1 7.0 1 0 65.0 0 6.0 1 0 65.0 1 6.0 1 0 65.0 0 6.0 1 0 65.0 0 8.0 1 0 65.0 1 6.0 1 0 65.0 0 7.0 1 0 65.0 1 7.0 1 0 65.0 1 5.0 1 0 65.0 0 8.0 1 0 65.0 1 4.0 1 0 65.0 1 7.0 1 0 65.0 1 8.0 1 0 65.0 1 10.0 1 0 65.0 1 6.0 1 0 65.0 0 7.0 1 0 65.0 1 5.0 1 0 65.0 0 6.0 1 0 65.0 0 6.0 1 0 65.0 0 10.0 1 0 65.0 0 7.0 1 0 65.0 0 6.0 1 1 68.7 1 5.29 2 1 67.5 1 4.6 2 1 68.9 1 5.86 2 1 70.5 1 6.4 2 1 73.5 1 4.48 2 1 68.1 1 3.1 2 1 66.7 1 3.79 2 1 69.3 1 5.73 2 1 67.5 1 3.57 2 1 67.8 1 3.63 2 1 69.4 1 6.07 2 1 68.8 1 5.33 2 1 71.7 1 4.28 2 1 67 1 6.45 2 1 70.5 1 6.23 2 1 76.5 1 6.9 2 1 73.8 1 7.21 2 1 71.2 1 6.55 2 1 82.3 1 5.73 2 1 72.5 1 6.81 2 1 67.3 1 2.18 2 1 72.7 1 2.17 2 1 69.6 1 4.05 2 1 74.8 1 5.23 2 1 71.2 1 5.76 2 1 72.4 1 5.17 2 1 83.2 1 5.58 2 1 65.6 1 5.7 2 1 79.6 1 4.35 2 1 66.2 1 5.44 2 1 68.6 1 6.08 2 1 65.8 1 6.48 2 1 82.9 1 4.65 2 1 88 1 6.75 2 1 76.6 1 6.28 2 1 70.7 1 3.76 2 1 77.3 1 3.06 2 1 65.5 1 6.49 2 1 68.5 1 7.1 2 1 77.1 1 1.01 2 1 82.3 0 4.92 2 1 80.7 0 5.75 2 1 74.4 0 5.55 2 1 71.2 0 4.86 2 1 71.1 0 5.24 2 1 69.5 0 6.99 2 0 65 1 5 2 0 65 1 8 2 0 65 0 6 2 0 65 1 5 2 0 65 1 8 2 0 65 0 10 2 0 65 1 1 2 0 65 1 7 2 0 65 1 6 2 0 65 1 4 2 0 65 0 6 2 0 65 0 6 2 0 65 1 8 2 0 65 0 7 2 0 65 0 6 2 0 65 1 7 2 0 65 1 6 2 0 65 1 6 2 0 65 0 6 2 0 65 1 5 2 0 65 1 6 2 0 65 1 7 2 0 65 1 6 2 0 65 1 3 2 0 65 1 6 2 0 65 1 3 2 0 65 1 7 2 0 65 1 5 2 0 65 1 7 2 0 65 1 5 2 0 65 1 7 2 0 65 1 7 2 0 65 1 6 2 0 65 1 7 2 0 65 1 5 2 0 65 1 6 2 0 65 1 6 2 0 65 1 6 2 0 65 1 5 2 0 65 1 8 2 0 65 0 3 2 0 65 0 5 2 0 65 0 6 2 0 65 0 6 2 0 65 1 6 2 0 65 0 9 2 0 65 1 8 2 0 65 1 8 2 0 65 0 4 2 0 65 1 9 2 0 65 1 5 2 0 65 0 6 2 0 65 1 9 2 0 65 1 6 2 0 65 1 6 2 0 65 1 7 2 0 65 1 5 2 0 65 0 9 2 0 65 1 6 2 0 65 1 6 2 0 65 0 6 2 0 65 1 7 2 0 65 0 8 2 0 65 0 7 2 0 65 1 6 2 0 65 2 6 2 0 65 1 5 2 0 65 1 7 2 0 65 1 6 2 0 65 0 7 2 0 65 1 9 2 0 65 1 6 2 0 65 1 7 2 0 65 1 6 2 0 65 1 7 2 0 65 1 7 2 0 65 0 8 2 0 65 1 4 2 0 65 0 5 2 0 65 1 6 2 0 65 1 6 2 0 65 1 6 2 0 65 1 7 2
 
Text written by user:
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Coefficients of Bias-Reduced Logistic Regression
VariableParameterS.E.t-stat2-sided p-value
(Intercept)-287.11794538472972.3549629452117-3.968185922534979.34708308724108e-05
age4.41307801665331.109221316205043.978536972000948.9715915304156e-05
snoring1.426107269786320.880100628253731.620391150743700.106346625158878
sleep_time-0.2267013789696110.222295695639293-1.019819022215650.308751485869799
sex-1.547661967903150.725978073170543-2.131830182066090.0339477442071952


Summary of Bias-Reduced Logistic Regression
Deviance39.8686178577758
Penalized deviance33.8476247843873
Residual Degrees of Freedom263
ROC Area0.996975806451613


Fit of Logistic Regression
IndexActualFittedError
110.999999999839951.6004964020766e-10
210.9999999999951534.84656759169866e-12
310.9999070222880029.29777119978992e-05
410.9999999999999991.44328993201270e-15
5110
6110
710.9961220538099690.00387794619003112
810.9999992664348067.33565193700159e-07
910.9999999999999982.44249065417534e-15
10110
11110
1210.8272438880884060.172756111911594
1310.9973590087060010.00264099129399864
1410.999999999999972.90878432451791e-14
1510.9780206597704870.0219793402295128
1610.9999713516243352.86483756652967e-05
1710.090767811932930.90923218806707
1810.9999999999998721.28341781646668e-13
1910.9999999868122691.31877310183270e-08
2010.9999999999999973.44169137633799e-15
21110
22110
23110
2410.9999998374293361.62570663930772e-07
25110
2610.9999999999999712.87547763377916e-14
2710.9999999999999936.99440505513849e-15
2810.4280790171732420.571920982826758
2910.9991749069009650.000825093099035334
3010.9967631908837950.00323680911620527
3110.9992632608013150.000736739198684777
3210.9999070222880029.29777119978992e-05
3310.9999999981788841.82111570268262e-09
3410.999999999999982.07611705604904e-14
35111.11022302462516e-16
3610.9999999999998181.81854531433601e-13
3710.9999999973826262.61737398421502e-09
3810.999999999998191.80921944092916e-12
3910.1026358057107010.897364194289299
4010.9999999994813185.18682319317065e-10
4110.3272992561757240.672700743824276
4210.9998205839595270.000179416040472669
4310.999997459254232.54074576988561e-06
44110
4510.985601959822440.0143980401775602
46110
4710.9999999954422464.55775417407267e-09
48110
49110
50110
5110.9999999999999861.44328993201270e-14
52110
5310.9999999994320855.6791527036637e-10
5410.9999999850496821.49503179835975e-08
55111.11022302462516e-16
5610.9467504992498570.0532495007501431
57110
5810.9999999999999991.11022302462516e-15
5910.9999999999999937.21644966006352e-15
60110
6110.9996880903546150.000311909645384523
62110
6310.999608754373770.000391245626230163
64110
65110
6610.9999999999999991.22124532708767e-15
6710.6391720000059940.360827999994006
6810.999999999999366.39599484486553e-13
6910.9997701312172010.000229868782798848
70111.11022302462516e-16
71110
72110
7310.9999999999999937.21644966006352e-15
7410.999999999989781.02192698747672e-11
7510.9999999997947432.05257255636582e-10
7610.9999999688080363.11919643447567e-08
7710.830328997574630.169671002425369
7810.3297626307619210.670237369238079
7900.0427029576791383-0.0427029576791383
8000.121709681039107-0.121709681039107
8100.0400887708556661-0.0400887708556661
8200.179029600688178-0.179029600688178
8300.121709681039107-0.121709681039107
8400.099477825213058-0.099477825213058
8500.0497817537385838-0.0497817537385838
8600.099477825213058-0.099477825213058
8700.179029600688178-0.179029600688178
8800.148092954196832-0.148092954196832
8900.0809326996448088-0.0809326996448088
9000.0322191109548249-0.0322191109548249
9100.148092954196832-0.148092954196832
9200.0400887708556661-0.0400887708556661
9300.0322191109548249-0.0322191109548249
9400.0400887708556661-0.0400887708556661
9500.0400887708556661-0.0400887708556661
9600.0258527044846808-0.0258527044846808
9700.0322191109548249-0.0322191109548249
9800.0497817537385838-0.0497817537385838
9900.0322191109548249-0.0322191109548249
10000.0322191109548249-0.0322191109548249
10100.148092954196832-0.148092954196832
10200.179029600688178-0.179029600688178
10300.121709681039107-0.121709681039107
10400.0258527044846808-0.0258527044846808
10500.099477825213058-0.099477825213058
10600.0207173524240420-0.0207173524240420
10702.91381504547126e-11-2.91381504547126e-11
10800.0258527044846808-0.0258527044846808
10900.0400887708556661-0.0400887708556661
11000.179029600688178-0.179029600688178
11100.0809326996448088-0.0809326996448088
11200.121709681039107-0.121709681039107
11300.148092954196832-0.148092954196832
11400.121709681039107-0.121709681039107
11500.0400887708556661-0.0400887708556661
11600.0400887708556661-0.0400887708556661
11700.121709681039107-0.121709681039107
11800.121709681039107-0.121709681039107
11900.0400887708556661-0.0400887708556661
12000.148092954196832-0.148092954196832
12100.0400887708556661-0.0400887708556661
12200.0258527044846808-0.0258527044846808
12300.148092954196832-0.148092954196832
12400.0322191109548249-0.0322191109548249
12500.121709681039107-0.121709681039107
12600.179029600688178-0.179029600688178
12700.0258527044846808-0.0258527044846808
12800.214799423771802-0.214799423771802
12900.121709681039107-0.121709681039107
13000.099477825213058-0.099477825213058
13100.0655930202545721-0.0655930202545721
13200.148092954196832-0.148092954196832
13300.0322191109548249-0.0322191109548249
13400.179029600688178-0.179029600688178
13500.0400887708556661-0.0400887708556661
13600.0400887708556661-0.0400887708556661
13700.0165847141838496-0.0165847141838496
13800.0322191109548249-0.0322191109548249
13900.0400887708556661-0.0400887708556661
14010.9999981346265131.86537348667581e-06
14110.999681884456310.000318115543689546
14210.9999991218462068.78153794459102e-07
14310.9999999991484388.5156159901345e-10
144119.9920072216264e-16
14510.9999839642931541.60357068456074e-05
14610.991039633827930.00896036617206963
14710.9999998540710161.45928983563692e-07
14810.9997481135251620.000251886474838092
14910.9999320453121256.79546878749049e-05
15010.9999998986184831.01381517403354e-07
15110.9999987892715511.21072844860848e-06
15210.999999999997362.63999933025616e-12
15310.9956222855042920.00437771449570823
15410.9999999991806338.1936735174537e-10
155110
156114.44089209850063e-16
15710.9999999999598784.01219057977187e-11
158110
15910.9999999999998631.37223565843669e-13
16010.9995557947234620.000444205276538434
16110.999999999999981.98729921407903e-14
16210.9999999734683472.65316533187843e-08
163110
16410.9999999999664573.35430572206974e-11
16510.9999999999998531.47104550762833e-13
166110
16710.3586008527867710.641399147213229
168110
16910.8933424876190980.106657512380902
17010.9999965310166043.46898339553814e-06
17110.5310466339056290.468953366094371
172110
173110
174110
17510.9999999998063671.93632998524151e-10
176110
17710.2311473576845990.768852642315401
17810.9999932035428976.79645710310872e-06
179110
180110
181110
182111.11022302462516e-16
18310.9999999998861471.13852594019193e-10
18410.9999999998070641.92936000509292e-10
18510.9999996656276123.34372387555959e-07
18600.0443364887690096-0.0443364887690096
18700.0229616156992790-0.0229616156992790
18800.00880661500903168-0.00880661500903168
18900.0443364887690096-0.0443364887690096
19000.0229616156992790-0.0229616156992790
19100.00357498813599847-0.00357498813599847
19200.103049395925835-0.103049395925835
19300.0286370008555614-0.0286370008555614
19400.0356639574520229-0.0356639574520229
19500.0549976745859896-0.0549976745859896
19600.00880661500903168-0.00880661500903168
19700.00880661500903168-0.00880661500903168
19800.0229616156992790-0.0229616156992790
19900.00703283367282752-0.00703283367282752
20000.00880661500903168-0.00880661500903168
20100.0286370008555614-0.0286370008555614
20200.0356639574520229-0.0356639574520229
20300.0356639574520229-0.0356639574520229
20400.00880661500903168-0.00880661500903168
20500.0443364887690096-0.0443364887690096
20600.0356639574520229-0.0356639574520229
20700.0286370008555614-0.0286370008555614
20800.0356639574520229-0.0356639574520229
20900.0680399380218618-0.0680399380218618
21000.0356639574520229-0.0356639574520229
21100.0680399380218618-0.0680399380218618
21200.0286370008555614-0.0286370008555614
21300.0443364887690096-0.0443364887690096
21400.0286370008555614-0.0286370008555614
21500.0443364887690096-0.0443364887690096
21600.0286370008555614-0.0286370008555614
21700.0286370008555614-0.0286370008555614
21800.0356639574520229-0.0356639574520229
21900.0286370008555614-0.0286370008555614
22000.0443364887690096-0.0443364887690096
22100.0356639574520229-0.0356639574520229
22200.0356639574520229-0.0356639574520229
22300.0356639574520229-0.0356639574520229
22400.0443364887690096-0.0443364887690096
22500.0229616156992790-0.0229616156992790
22600.0172371250379668-0.0172371250379668
22700.0110228031604347-0.0110228031604347
22800.00880661500903168-0.00880661500903168
22900.00880661500903168-0.00880661500903168
23000.0356639574520229-0.0356639574520229
23100.00448058660141497-0.00448058660141497
23200.0229616156992790-0.0229616156992790
23300.0229616156992790-0.0229616156992790
23400.0137889374568408-0.0137889374568408
23500.0183897050929530-0.0183897050929530
23600.0443364887690096-0.0443364887690096
23700.00880661500903168-0.00880661500903168
23800.0183897050929530-0.0183897050929530
23900.0356639574520229-0.0356639574520229
24000.0356639574520229-0.0356639574520229
24100.0286370008555614-0.0286370008555614
24200.0443364887690096-0.0443364887690096
24300.00448058660141497-0.00448058660141497
24400.0356639574520229-0.0356639574520229
24500.0356639574520229-0.0356639574520229
24600.00880661500903168-0.00880661500903168
24700.0286370008555614-0.0286370008555614
24800.00561429427982578-0.00561429427982578
24900.00703283367282752-0.00703283367282752
25000.0356639574520229-0.0356639574520229
25100.133403861641241-0.133403861641241
25200.0443364887690096-0.0443364887690096
25300.0286370008555614-0.0286370008555614
25400.0356639574520229-0.0356639574520229
25500.00703283367282752-0.00703283367282752
25600.0183897050929530-0.0183897050929530
25700.0356639574520229-0.0356639574520229
25800.0286370008555614-0.0286370008555614
25900.0356639574520229-0.0356639574520229
26000.0286370008555614-0.0286370008555614
26100.0286370008555614-0.0286370008555614
26200.00561429427982578-0.00561429427982578
26300.0549976745859896-0.0549976745859896
26400.0110228031604347-0.0110228031604347
26500.0356639574520229-0.0356639574520229
26600.0356639574520229-0.0356639574520229
26700.0356639574520229-0.0356639574520229
26800.0286370008555614-0.0286370008555614


Type I & II errors for various threshold values
ThresholdType IType II
0.0100.875
0.0200.819444444444444
0.0300.631944444444444
0.0400.423611111111111
0.0500.25
0.0600.236111111111111
0.0700.215277777777778
0.0800.215277777777778
0.0900.201388888888889
0.10.008064516129032260.173611111111111
0.110.01612903225806450.166666666666667
0.120.01612903225806450.166666666666667
0.130.01612903225806450.104166666666667
0.140.01612903225806450.0972222222222222
0.150.01612903225806450.0486111111111111
0.160.01612903225806450.0486111111111111
0.170.01612903225806450.0486111111111111
0.180.01612903225806450.00694444444444444
0.190.01612903225806450.00694444444444444
0.20.01612903225806450.00694444444444444
0.210.01612903225806450.00694444444444444
0.220.01612903225806450
0.230.01612903225806450
0.240.02419354838709680
0.250.02419354838709680
0.260.02419354838709680
0.270.02419354838709680
0.280.02419354838709680
0.290.02419354838709680
0.30.02419354838709680
0.310.02419354838709680
0.320.02419354838709680
0.330.04032258064516130
0.340.04032258064516130
0.350.04032258064516130
0.360.04838709677419350
0.370.04838709677419350
0.380.04838709677419350
0.390.04838709677419350
0.40.04838709677419350
0.410.04838709677419350
0.420.04838709677419350
0.430.05645161290322580
0.440.05645161290322580
0.450.05645161290322580
0.460.05645161290322580
0.470.05645161290322580
0.480.05645161290322580
0.490.05645161290322580
0.50.05645161290322580
0.510.05645161290322580
0.520.05645161290322580
0.530.05645161290322580
0.540.0645161290322580
0.550.0645161290322580
0.560.0645161290322580
0.570.0645161290322580
0.580.0645161290322580
0.590.0645161290322580
0.60.0645161290322580
0.610.0645161290322580
0.620.0645161290322580
0.630.0645161290322580
0.640.07258064516129030
0.650.07258064516129030
0.660.07258064516129030
0.670.07258064516129030
0.680.07258064516129030
0.690.07258064516129030
0.70.07258064516129030
0.710.07258064516129030
0.720.07258064516129030
0.730.07258064516129030
0.740.07258064516129030
0.750.07258064516129030
0.760.07258064516129030
0.770.07258064516129030
0.780.07258064516129030
0.790.07258064516129030
0.80.07258064516129030
0.810.07258064516129030
0.820.07258064516129030
0.830.08064516129032260
0.840.08870967741935480
0.850.08870967741935480
0.860.08870967741935480
0.870.08870967741935480
0.880.08870967741935480
0.890.08870967741935480
0.90.0967741935483870
0.910.0967741935483870
0.920.0967741935483870
0.930.0967741935483870
0.940.0967741935483870
0.950.1048387096774190
0.960.1048387096774190
0.970.1048387096774190
0.980.1129032258064520
0.990.1209677419354840
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/30/t1201695322glqrbeoba4s4vw4/1m8431201695172.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/30/t1201695322glqrbeoba4s4vw4/1m8431201695172.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/30/t1201695322glqrbeoba4s4vw4/244ze1201695172.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/30/t1201695322glqrbeoba4s4vw4/244ze1201695172.ps (open in new window)


 
Parameters (Session):
 
Parameters (R input):
 
R code (references can be found in the software module):
library(brlr)
roc.plot <- function (sd, sdc, newplot = TRUE, ...)
{
sall <- sort(c(sd, sdc))
sens <- 0
specc <- 0
for (i in length(sall):1) {
sens <- c(sens, mean(sd >= sall[i], na.rm = T))
specc <- c(specc, mean(sdc >= sall[i], na.rm = T))
}
if (newplot) {
plot(specc, sens, xlim = c(0, 1), ylim = c(0, 1), type = 'l',
xlab = '1-specificity', ylab = 'sensitivity', main = 'ROC plot', ...)
abline(0, 1)
}
else lines(specc, sens, ...)
npoints <- length(sens)
area <- sum(0.5 * (sens[-1] + sens[-npoints]) * (specc[-1] -
specc[-npoints]))
lift <- (sens - specc)[-1]
cutoff <- sall[lift == max(lift)][1]
sensopt <- sens[-1][lift == max(lift)][1]
specopt <- 1 - specc[-1][lift == max(lift)][1]
list(area = area, cutoff = cutoff, sensopt = sensopt, specopt = specopt)
}
roc.analysis <- function (object, newdata = NULL, newplot = TRUE, ...)
{
if (is.null(newdata)) {
sd <- object$fitted[object$y == 1]
sdc <- object$fitted[object$y == 0]
}
else {
sd <- predict(object, newdata, type = 'response')[newdata$y ==
1]
sdc <- predict(object, newdata, type = 'response')[newdata$y ==
0]
}
roc.plot(sd, sdc, newplot, ...)
}
hosmerlem <- function (y, yhat, g = 10)
{
cutyhat <- cut(yhat, breaks = quantile(yhat, probs = seq(0,
1, 1/g)), include.lowest = T)
obs <- xtabs(cbind(1 - y, y) ~ cutyhat)
expect <- xtabs(cbind(1 - yhat, yhat) ~ cutyhat)
chisq <- sum((obs - expect)^2/expect)
P <- 1 - pchisq(chisq, g - 2)
c('X^2' = chisq, Df = g - 2, 'P(>Chi)' = P)
}
x <- as.data.frame(t(y))
r <- brlr(x)
summary(r)
rc <- summary(r)$coeff
bitmap(file='test0.png')
ra <- roc.analysis(r)
dev.off()
te <- array(0,dim=c(2,99))
for (i in 1:99) {
threshold <- i / 100
numcorr1 <- 0
numfaul1 <- 0
numcorr0 <- 0
numfaul0 <- 0
for (j in 1:length(r$fitted.values)) {
if (y[1,j] > 0.99) {
if (r$fitted.values[j] >= threshold) numcorr1 = numcorr1 + 1 else numfaul1 = numfaul1 + 1
} else {
if (r$fitted.values[j] < threshold) numcorr0 = numcorr0 + 1 else numfaul0 = numfaul0 + 1
}
}
te[1,i] <- numfaul1 / (numfaul1 + numcorr1)
te[2,i] <- numfaul0 / (numfaul0 + numcorr0)
}
bitmap(file='test1.png')
op <- par(mfrow=c(2,2))
plot((1:99)/100,te[1,],xlab='Threshold',ylab='Type I error', main='1 - Specificity')
plot((1:99)/100,te[2,],xlab='Threshold',ylab='Type II error', main='1 - Sensitivity')
plot(te[1,],te[2,],xlab='Type I error',ylab='Type II error', main='(1-Sens.) vs (1-Spec.)')
plot((1:99)/100,te[1,]+te[2,],xlab='Threshold',ylab='Sum of Type I & II error', main='(1-Sens.) + (1-Spec.)')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Coefficients of Bias-Reduced Logistic Regression',5,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.E.',header=TRUE)
a<-table.element(a,'t-stat',header=TRUE)
a<-table.element(a,'2-sided p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:length(rc[,1])) {
a<-table.row.start(a)
a<-table.element(a,labels(rc)[[1]][i],header=TRUE)
a<-table.element(a,rc[i,1])
a<-table.element(a,rc[i,2])
a<-table.element(a,rc[i,3])
a<-table.element(a,2*(1-pt(abs(rc[i,3]),r$df.residual)))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Summary of Bias-Reduced Logistic Regression',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Deviance',1,TRUE)
a<-table.element(a,r$deviance)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Penalized deviance',1,TRUE)
a<-table.element(a,r$penalized.deviance)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Residual Degrees of Freedom',1,TRUE)
a<-table.element(a,r$df.residual)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'ROC Area',1,TRUE)
a<-table.element(a,ra$area)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Fit of Logistic Regression',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Index',1,TRUE)
a<-table.element(a,'Actual',1,TRUE)
a<-table.element(a,'Fitted',1,TRUE)
a<-table.element(a,'Error',1,TRUE)
a<-table.row.end(a)
for (i in 1:length(r$fitted.values)) {
a<-table.row.start(a)
a<-table.element(a,i,1,TRUE)
a<-table.element(a,y[1,i])
a<-table.element(a,r$fitted.values[i])
a<-table.element(a,y[1,i]-r$fitted.values[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Type I & II errors for various threshold values',3,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Threshold',1,TRUE)
a<-table.element(a,'Type I',1,TRUE)
a<-table.element(a,'Type II',1,TRUE)
a<-table.row.end(a)
for (i in 1:99) {
a<-table.row.start(a)
a<-table.element(a,i/100,1,TRUE)
a<-table.element(a,te[1,i])
a<-table.element(a,te[2,i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable3.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by