Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_logisticregression.wasp
Title produced by softwareBias-Reduced Logistic Regression
Date of computationWed, 04 Sep 2013 09:09:57 -0400
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2013/Sep/04/t1378300227i6zb9htcu0h1snk.htm/, Retrieved Fri, 03 May 2024 23:18:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=211390, Retrieved Fri, 03 May 2024 23:18:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact189
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Bias-Reduced Logistic Regression] [] [2013-09-04 13:09:57] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
0	18	35	43	49
0	10	31	40	42
0	14	32	21	34
0	3	5	13	17
0	1	5	9	10
0	2	8	3	6
1	4	40	40	50
0	5	37	44	48
1	4	40	50	50
0	0	3	1	2
0	0	4	0	1
0	0	2	0	3
0	20	38	50	49
0	23	39	48	50
0	18	39	50	50
0	10	17	9	12
0	6	13	8	11
0	5	12	13	11
1	4	50	50	50
1	6	44	50	50
1	5	48	50	50
0	0	4	1	3
0	0	0	2	6
0	0	2	6	4
0	30	38	47	48
1	32	43	47	47
1	29	46	46	48
0	38	39	24	28
0	40	39	25	30
0	38	40	23	28
1	6	50	50	50
1	6	50	50	50
1	8	50	50	50
0	2	7	14	10
0	3	5	10	11
0	1	6	10	11




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=211390&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=211390&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=211390&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net







Coefficients of Bias-Reduced Logistic Regression
VariableParameterS.E.t-stat2-sided p-value
(Intercept)-5.455566642892972.74161465040632-1.989910085315760.055483411486553
X1-0.1147759884615110.0677149339743317-1.694987822110530.10010172968
X20.307969461929720.1507064569980852.043505421493880.0495801457535985
X30.0938337911433690.168770653453850.5559840483110260.58221283621237
X4-0.1973256902961430.22127902931809-0.8917505237809320.379396444737552

\begin{tabular}{lllllllll}
\hline
Coefficients of Bias-Reduced Logistic Regression \tabularnewline
Variable & Parameter & S.E. & t-stat & 2-sided p-value \tabularnewline
(Intercept) & -5.45556664289297 & 2.74161465040632 & -1.98991008531576 & 0.055483411486553 \tabularnewline
X1 & -0.114775988461511 & 0.0677149339743317 & -1.69498782211053 & 0.10010172968 \tabularnewline
X2 & 0.30796946192972 & 0.150706456998085 & 2.04350542149388 & 0.0495801457535985 \tabularnewline
X3 & 0.093833791143369 & 0.16877065345385 & 0.555984048311026 & 0.58221283621237 \tabularnewline
X4 & -0.197325690296143 & 0.22127902931809 & -0.891750523780932 & 0.379396444737552 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=211390&T=1

[TABLE]
[ROW][C]Coefficients of Bias-Reduced Logistic Regression[/C][/ROW]
[ROW][C]Variable[/C][C]Parameter[/C][C]S.E.[/C][C]t-stat[/C][C]2-sided p-value[/C][/ROW]
[ROW][C](Intercept)[/C][C]-5.45556664289297[/C][C]2.74161465040632[/C][C]-1.98991008531576[/C][C]0.055483411486553[/C][/ROW]
[ROW][C]X1[/C][C]-0.114775988461511[/C][C]0.0677149339743317[/C][C]-1.69498782211053[/C][C]0.10010172968[/C][/ROW]
[ROW][C]X2[/C][C]0.30796946192972[/C][C]0.150706456998085[/C][C]2.04350542149388[/C][C]0.0495801457535985[/C][/ROW]
[ROW][C]X3[/C][C]0.093833791143369[/C][C]0.16877065345385[/C][C]0.555984048311026[/C][C]0.58221283621237[/C][/ROW]
[ROW][C]X4[/C][C]-0.197325690296143[/C][C]0.22127902931809[/C][C]-0.891750523780932[/C][C]0.379396444737552[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=211390&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=211390&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Coefficients of Bias-Reduced Logistic Regression
VariableParameterS.E.t-stat2-sided p-value
(Intercept)-5.455566642892972.74161465040632-1.989910085315760.055483411486553
X1-0.1147759884615110.0677149339743317-1.694987822110530.10010172968
X20.307969461929720.1507064569980852.043505421493880.0495801457535985
X30.0938337911433690.168770653453850.5559840483110260.58221283621237
X4-0.1973256902961430.22127902931809-0.8917505237809320.379396444737552







Summary of Bias-Reduced Logistic Regression
Deviance11.8159893340827
Penalized deviance-8.96262366434337
Residual Degrees of Freedom31
ROC Area0.992307692307692
Hosmer–Lemeshow test
Chi-square2.00861318738299
Degrees of Freedom8
P(>Chi)0.980746653936425

\begin{tabular}{lllllllll}
\hline
Summary of Bias-Reduced Logistic Regression \tabularnewline
Deviance & 11.8159893340827 \tabularnewline
Penalized deviance & -8.96262366434337 \tabularnewline
Residual Degrees of Freedom & 31 \tabularnewline
ROC Area & 0.992307692307692 \tabularnewline
Hosmer–Lemeshow test \tabularnewline
Chi-square & 2.00861318738299 \tabularnewline
Degrees of Freedom & 8 \tabularnewline
P(>Chi) & 0.980746653936425 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=211390&T=2

[TABLE]
[ROW][C]Summary of Bias-Reduced Logistic Regression[/C][/ROW]
[ROW][C]Deviance[/C][C]11.8159893340827[/C][/ROW]
[ROW][C]Penalized deviance[/C][C]-8.96262366434337[/C][/ROW]
[ROW][C]Residual Degrees of Freedom[/C][C]31[/C][/ROW]
[ROW][C]ROC Area[/C][C]0.992307692307692[/C][/ROW]
[ROW][C]Hosmer–Lemeshow test[/C][/ROW]
[ROW][C]Chi-square[/C][C]2.00861318738299[/C][/ROW]
[ROW][C]Degrees of Freedom[/C][C]8[/C][/ROW]
[ROW][C]P(>Chi)[/C][C]0.980746653936425[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=211390&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=211390&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of Bias-Reduced Logistic Regression
Deviance11.8159893340827
Penalized deviance-8.96262366434337
Residual Degrees of Freedom31
ROC Area0.992307692307692
Hosmer–Lemeshow test
Chi-square2.00861318738299
Degrees of Freedom8
P(>Chi)0.980746653936425







Fit of Logistic Regression
IndexActualFittedError
100.0849660756927395-0.0849660756927395
200.169299419915491-0.169299419915491
300.124993283807139-0.124993283807139
400.00166752686803773-0.00166752686803773
500.00571319037056952-0.00571319037056952
600.0159249407540364-0.0159249407540364
710.5722837708049910.427716229195009
800.505619059001614-0.505619059001614
910.7737333129997640.226266687000236
1000.00790380451155001-0.00790380451155001
1100.0118792176119567-0.0118792176119567
1200.00435700096538085-0.00435700096538085
1300.263954319613781-0.263954319613781
1400.190484066999432-0.190484066999432
1500.335074885792021-0.335074885792021
1600.0525878137564888-0.0525878137564888
1700.0276381261217597-0.0276381261217597
1800.0361048140625357-0.0361048140625357
1910.9867341494039580.0132658505960416
2010.9030724327615890.0969275672384114
2110.9728404836220370.0271595163779628
2200.00882036899534707-0.00882036899534707
2300.00157511096512351-0.00157511096512351
2400.00626851385695364-0.00626851385695364
2500.0947086323899808-0.0947086323899808
2610.3208581979150680.679141802084932
2710.5565683226967870.443431677303213
2800.253628374597467-0.253628374597467
2900.166627061548474-0.166627061548474
3000.296250339366943-0.296250339366943
3110.9833680114726270.0166319885273726
3210.9833680114726270.0166319885273726
3310.979165768803960.02083423119604
3400.0149362353228359-0.0149362353228359
3500.00410150246652389-0.00410150246652389
3600.00700034737359068-0.00700034737359068

\begin{tabular}{lllllllll}
\hline
Fit of Logistic Regression \tabularnewline
Index & Actual & Fitted & Error \tabularnewline
1 & 0 & 0.0849660756927395 & -0.0849660756927395 \tabularnewline
2 & 0 & 0.169299419915491 & -0.169299419915491 \tabularnewline
3 & 0 & 0.124993283807139 & -0.124993283807139 \tabularnewline
4 & 0 & 0.00166752686803773 & -0.00166752686803773 \tabularnewline
5 & 0 & 0.00571319037056952 & -0.00571319037056952 \tabularnewline
6 & 0 & 0.0159249407540364 & -0.0159249407540364 \tabularnewline
7 & 1 & 0.572283770804991 & 0.427716229195009 \tabularnewline
8 & 0 & 0.505619059001614 & -0.505619059001614 \tabularnewline
9 & 1 & 0.773733312999764 & 0.226266687000236 \tabularnewline
10 & 0 & 0.00790380451155001 & -0.00790380451155001 \tabularnewline
11 & 0 & 0.0118792176119567 & -0.0118792176119567 \tabularnewline
12 & 0 & 0.00435700096538085 & -0.00435700096538085 \tabularnewline
13 & 0 & 0.263954319613781 & -0.263954319613781 \tabularnewline
14 & 0 & 0.190484066999432 & -0.190484066999432 \tabularnewline
15 & 0 & 0.335074885792021 & -0.335074885792021 \tabularnewline
16 & 0 & 0.0525878137564888 & -0.0525878137564888 \tabularnewline
17 & 0 & 0.0276381261217597 & -0.0276381261217597 \tabularnewline
18 & 0 & 0.0361048140625357 & -0.0361048140625357 \tabularnewline
19 & 1 & 0.986734149403958 & 0.0132658505960416 \tabularnewline
20 & 1 & 0.903072432761589 & 0.0969275672384114 \tabularnewline
21 & 1 & 0.972840483622037 & 0.0271595163779628 \tabularnewline
22 & 0 & 0.00882036899534707 & -0.00882036899534707 \tabularnewline
23 & 0 & 0.00157511096512351 & -0.00157511096512351 \tabularnewline
24 & 0 & 0.00626851385695364 & -0.00626851385695364 \tabularnewline
25 & 0 & 0.0947086323899808 & -0.0947086323899808 \tabularnewline
26 & 1 & 0.320858197915068 & 0.679141802084932 \tabularnewline
27 & 1 & 0.556568322696787 & 0.443431677303213 \tabularnewline
28 & 0 & 0.253628374597467 & -0.253628374597467 \tabularnewline
29 & 0 & 0.166627061548474 & -0.166627061548474 \tabularnewline
30 & 0 & 0.296250339366943 & -0.296250339366943 \tabularnewline
31 & 1 & 0.983368011472627 & 0.0166319885273726 \tabularnewline
32 & 1 & 0.983368011472627 & 0.0166319885273726 \tabularnewline
33 & 1 & 0.97916576880396 & 0.02083423119604 \tabularnewline
34 & 0 & 0.0149362353228359 & -0.0149362353228359 \tabularnewline
35 & 0 & 0.00410150246652389 & -0.00410150246652389 \tabularnewline
36 & 0 & 0.00700034737359068 & -0.00700034737359068 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=211390&T=3

[TABLE]
[ROW][C]Fit of Logistic Regression[/C][/ROW]
[ROW][C]Index[/C][C]Actual[/C][C]Fitted[/C][C]Error[/C][/ROW]
[ROW][C]1[/C][C]0[/C][C]0.0849660756927395[/C][C]-0.0849660756927395[/C][/ROW]
[ROW][C]2[/C][C]0[/C][C]0.169299419915491[/C][C]-0.169299419915491[/C][/ROW]
[ROW][C]3[/C][C]0[/C][C]0.124993283807139[/C][C]-0.124993283807139[/C][/ROW]
[ROW][C]4[/C][C]0[/C][C]0.00166752686803773[/C][C]-0.00166752686803773[/C][/ROW]
[ROW][C]5[/C][C]0[/C][C]0.00571319037056952[/C][C]-0.00571319037056952[/C][/ROW]
[ROW][C]6[/C][C]0[/C][C]0.0159249407540364[/C][C]-0.0159249407540364[/C][/ROW]
[ROW][C]7[/C][C]1[/C][C]0.572283770804991[/C][C]0.427716229195009[/C][/ROW]
[ROW][C]8[/C][C]0[/C][C]0.505619059001614[/C][C]-0.505619059001614[/C][/ROW]
[ROW][C]9[/C][C]1[/C][C]0.773733312999764[/C][C]0.226266687000236[/C][/ROW]
[ROW][C]10[/C][C]0[/C][C]0.00790380451155001[/C][C]-0.00790380451155001[/C][/ROW]
[ROW][C]11[/C][C]0[/C][C]0.0118792176119567[/C][C]-0.0118792176119567[/C][/ROW]
[ROW][C]12[/C][C]0[/C][C]0.00435700096538085[/C][C]-0.00435700096538085[/C][/ROW]
[ROW][C]13[/C][C]0[/C][C]0.263954319613781[/C][C]-0.263954319613781[/C][/ROW]
[ROW][C]14[/C][C]0[/C][C]0.190484066999432[/C][C]-0.190484066999432[/C][/ROW]
[ROW][C]15[/C][C]0[/C][C]0.335074885792021[/C][C]-0.335074885792021[/C][/ROW]
[ROW][C]16[/C][C]0[/C][C]0.0525878137564888[/C][C]-0.0525878137564888[/C][/ROW]
[ROW][C]17[/C][C]0[/C][C]0.0276381261217597[/C][C]-0.0276381261217597[/C][/ROW]
[ROW][C]18[/C][C]0[/C][C]0.0361048140625357[/C][C]-0.0361048140625357[/C][/ROW]
[ROW][C]19[/C][C]1[/C][C]0.986734149403958[/C][C]0.0132658505960416[/C][/ROW]
[ROW][C]20[/C][C]1[/C][C]0.903072432761589[/C][C]0.0969275672384114[/C][/ROW]
[ROW][C]21[/C][C]1[/C][C]0.972840483622037[/C][C]0.0271595163779628[/C][/ROW]
[ROW][C]22[/C][C]0[/C][C]0.00882036899534707[/C][C]-0.00882036899534707[/C][/ROW]
[ROW][C]23[/C][C]0[/C][C]0.00157511096512351[/C][C]-0.00157511096512351[/C][/ROW]
[ROW][C]24[/C][C]0[/C][C]0.00626851385695364[/C][C]-0.00626851385695364[/C][/ROW]
[ROW][C]25[/C][C]0[/C][C]0.0947086323899808[/C][C]-0.0947086323899808[/C][/ROW]
[ROW][C]26[/C][C]1[/C][C]0.320858197915068[/C][C]0.679141802084932[/C][/ROW]
[ROW][C]27[/C][C]1[/C][C]0.556568322696787[/C][C]0.443431677303213[/C][/ROW]
[ROW][C]28[/C][C]0[/C][C]0.253628374597467[/C][C]-0.253628374597467[/C][/ROW]
[ROW][C]29[/C][C]0[/C][C]0.166627061548474[/C][C]-0.166627061548474[/C][/ROW]
[ROW][C]30[/C][C]0[/C][C]0.296250339366943[/C][C]-0.296250339366943[/C][/ROW]
[ROW][C]31[/C][C]1[/C][C]0.983368011472627[/C][C]0.0166319885273726[/C][/ROW]
[ROW][C]32[/C][C]1[/C][C]0.983368011472627[/C][C]0.0166319885273726[/C][/ROW]
[ROW][C]33[/C][C]1[/C][C]0.97916576880396[/C][C]0.02083423119604[/C][/ROW]
[ROW][C]34[/C][C]0[/C][C]0.0149362353228359[/C][C]-0.0149362353228359[/C][/ROW]
[ROW][C]35[/C][C]0[/C][C]0.00410150246652389[/C][C]-0.00410150246652389[/C][/ROW]
[ROW][C]36[/C][C]0[/C][C]0.00700034737359068[/C][C]-0.00700034737359068[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=211390&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=211390&T=3

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Fit of Logistic Regression
IndexActualFittedError
100.0849660756927395-0.0849660756927395
200.169299419915491-0.169299419915491
300.124993283807139-0.124993283807139
400.00166752686803773-0.00166752686803773
500.00571319037056952-0.00571319037056952
600.0159249407540364-0.0159249407540364
710.5722837708049910.427716229195009
800.505619059001614-0.505619059001614
910.7737333129997640.226266687000236
1000.00790380451155001-0.00790380451155001
1100.0118792176119567-0.0118792176119567
1200.00435700096538085-0.00435700096538085
1300.263954319613781-0.263954319613781
1400.190484066999432-0.190484066999432
1500.335074885792021-0.335074885792021
1600.0525878137564888-0.0525878137564888
1700.0276381261217597-0.0276381261217597
1800.0361048140625357-0.0361048140625357
1910.9867341494039580.0132658505960416
2010.9030724327615890.0969275672384114
2110.9728404836220370.0271595163779628
2200.00882036899534707-0.00882036899534707
2300.00157511096512351-0.00157511096512351
2400.00626851385695364-0.00626851385695364
2500.0947086323899808-0.0947086323899808
2610.3208581979150680.679141802084932
2710.5565683226967870.443431677303213
2800.253628374597467-0.253628374597467
2900.166627061548474-0.166627061548474
3000.296250339366943-0.296250339366943
3110.9833680114726270.0166319885273726
3210.9833680114726270.0166319885273726
3310.979165768803960.02083423119604
3400.0149362353228359-0.0149362353228359
3500.00410150246652389-0.00410150246652389
3600.00700034737359068-0.00700034737359068







Type I & II errors for various threshold values
ThresholdType IType II
0.0100.653846153846154
0.0200.538461538461538
0.0300.5
0.0400.461538461538462
0.0500.461538461538462
0.0600.423076923076923
0.0700.423076923076923
0.0800.423076923076923
0.0900.384615384615385
0.100.346153846153846
0.1100.346153846153846
0.1200.346153846153846
0.1300.307692307692308
0.1400.307692307692308
0.1500.307692307692308
0.1600.307692307692308
0.1700.230769230769231
0.1800.230769230769231
0.1900.230769230769231
0.200.192307692307692
0.2100.192307692307692
0.2200.192307692307692
0.2300.192307692307692
0.2400.192307692307692
0.2500.192307692307692
0.2600.153846153846154
0.2700.115384615384615
0.2800.115384615384615
0.2900.115384615384615
0.300.0769230769230769
0.3100.0769230769230769
0.3200.0769230769230769
0.330.10.0769230769230769
0.340.10.0384615384615385
0.350.10.0384615384615385
0.360.10.0384615384615385
0.370.10.0384615384615385
0.380.10.0384615384615385
0.390.10.0384615384615385
0.40.10.0384615384615385
0.410.10.0384615384615385
0.420.10.0384615384615385
0.430.10.0384615384615385
0.440.10.0384615384615385
0.450.10.0384615384615385
0.460.10.0384615384615385
0.470.10.0384615384615385
0.480.10.0384615384615385
0.490.10.0384615384615385
0.50.10.0384615384615385
0.510.10
0.520.10
0.530.10
0.540.10
0.550.10
0.560.20
0.570.20
0.580.30
0.590.30
0.60.30
0.610.30
0.620.30
0.630.30
0.640.30
0.650.30
0.660.30
0.670.30
0.680.30
0.690.30
0.70.30
0.710.30
0.720.30
0.730.30
0.740.30
0.750.30
0.760.30
0.770.30
0.780.40
0.790.40
0.80.40
0.810.40
0.820.40
0.830.40
0.840.40
0.850.40
0.860.40
0.870.40
0.880.40
0.890.40
0.90.40
0.910.50
0.920.50
0.930.50
0.940.50
0.950.50
0.960.50
0.970.50
0.980.70
0.9910

\begin{tabular}{lllllllll}
\hline
Type I & II errors for various threshold values \tabularnewline
Threshold & Type I & Type II \tabularnewline
0.01 & 0 & 0.653846153846154 \tabularnewline
0.02 & 0 & 0.538461538461538 \tabularnewline
0.03 & 0 & 0.5 \tabularnewline
0.04 & 0 & 0.461538461538462 \tabularnewline
0.05 & 0 & 0.461538461538462 \tabularnewline
0.06 & 0 & 0.423076923076923 \tabularnewline
0.07 & 0 & 0.423076923076923 \tabularnewline
0.08 & 0 & 0.423076923076923 \tabularnewline
0.09 & 0 & 0.384615384615385 \tabularnewline
0.1 & 0 & 0.346153846153846 \tabularnewline
0.11 & 0 & 0.346153846153846 \tabularnewline
0.12 & 0 & 0.346153846153846 \tabularnewline
0.13 & 0 & 0.307692307692308 \tabularnewline
0.14 & 0 & 0.307692307692308 \tabularnewline
0.15 & 0 & 0.307692307692308 \tabularnewline
0.16 & 0 & 0.307692307692308 \tabularnewline
0.17 & 0 & 0.230769230769231 \tabularnewline
0.18 & 0 & 0.230769230769231 \tabularnewline
0.19 & 0 & 0.230769230769231 \tabularnewline
0.2 & 0 & 0.192307692307692 \tabularnewline
0.21 & 0 & 0.192307692307692 \tabularnewline
0.22 & 0 & 0.192307692307692 \tabularnewline
0.23 & 0 & 0.192307692307692 \tabularnewline
0.24 & 0 & 0.192307692307692 \tabularnewline
0.25 & 0 & 0.192307692307692 \tabularnewline
0.26 & 0 & 0.153846153846154 \tabularnewline
0.27 & 0 & 0.115384615384615 \tabularnewline
0.28 & 0 & 0.115384615384615 \tabularnewline
0.29 & 0 & 0.115384615384615 \tabularnewline
0.3 & 0 & 0.0769230769230769 \tabularnewline
0.31 & 0 & 0.0769230769230769 \tabularnewline
0.32 & 0 & 0.0769230769230769 \tabularnewline
0.33 & 0.1 & 0.0769230769230769 \tabularnewline
0.34 & 0.1 & 0.0384615384615385 \tabularnewline
0.35 & 0.1 & 0.0384615384615385 \tabularnewline
0.36 & 0.1 & 0.0384615384615385 \tabularnewline
0.37 & 0.1 & 0.0384615384615385 \tabularnewline
0.38 & 0.1 & 0.0384615384615385 \tabularnewline
0.39 & 0.1 & 0.0384615384615385 \tabularnewline
0.4 & 0.1 & 0.0384615384615385 \tabularnewline
0.41 & 0.1 & 0.0384615384615385 \tabularnewline
0.42 & 0.1 & 0.0384615384615385 \tabularnewline
0.43 & 0.1 & 0.0384615384615385 \tabularnewline
0.44 & 0.1 & 0.0384615384615385 \tabularnewline
0.45 & 0.1 & 0.0384615384615385 \tabularnewline
0.46 & 0.1 & 0.0384615384615385 \tabularnewline
0.47 & 0.1 & 0.0384615384615385 \tabularnewline
0.48 & 0.1 & 0.0384615384615385 \tabularnewline
0.49 & 0.1 & 0.0384615384615385 \tabularnewline
0.5 & 0.1 & 0.0384615384615385 \tabularnewline
0.51 & 0.1 & 0 \tabularnewline
0.52 & 0.1 & 0 \tabularnewline
0.53 & 0.1 & 0 \tabularnewline
0.54 & 0.1 & 0 \tabularnewline
0.55 & 0.1 & 0 \tabularnewline
0.56 & 0.2 & 0 \tabularnewline
0.57 & 0.2 & 0 \tabularnewline
0.58 & 0.3 & 0 \tabularnewline
0.59 & 0.3 & 0 \tabularnewline
0.6 & 0.3 & 0 \tabularnewline
0.61 & 0.3 & 0 \tabularnewline
0.62 & 0.3 & 0 \tabularnewline
0.63 & 0.3 & 0 \tabularnewline
0.64 & 0.3 & 0 \tabularnewline
0.65 & 0.3 & 0 \tabularnewline
0.66 & 0.3 & 0 \tabularnewline
0.67 & 0.3 & 0 \tabularnewline
0.68 & 0.3 & 0 \tabularnewline
0.69 & 0.3 & 0 \tabularnewline
0.7 & 0.3 & 0 \tabularnewline
0.71 & 0.3 & 0 \tabularnewline
0.72 & 0.3 & 0 \tabularnewline
0.73 & 0.3 & 0 \tabularnewline
0.74 & 0.3 & 0 \tabularnewline
0.75 & 0.3 & 0 \tabularnewline
0.76 & 0.3 & 0 \tabularnewline
0.77 & 0.3 & 0 \tabularnewline
0.78 & 0.4 & 0 \tabularnewline
0.79 & 0.4 & 0 \tabularnewline
0.8 & 0.4 & 0 \tabularnewline
0.81 & 0.4 & 0 \tabularnewline
0.82 & 0.4 & 0 \tabularnewline
0.83 & 0.4 & 0 \tabularnewline
0.84 & 0.4 & 0 \tabularnewline
0.85 & 0.4 & 0 \tabularnewline
0.86 & 0.4 & 0 \tabularnewline
0.87 & 0.4 & 0 \tabularnewline
0.88 & 0.4 & 0 \tabularnewline
0.89 & 0.4 & 0 \tabularnewline
0.9 & 0.4 & 0 \tabularnewline
0.91 & 0.5 & 0 \tabularnewline
0.92 & 0.5 & 0 \tabularnewline
0.93 & 0.5 & 0 \tabularnewline
0.94 & 0.5 & 0 \tabularnewline
0.95 & 0.5 & 0 \tabularnewline
0.96 & 0.5 & 0 \tabularnewline
0.97 & 0.5 & 0 \tabularnewline
0.98 & 0.7 & 0 \tabularnewline
0.99 & 1 & 0 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=211390&T=4

[TABLE]
[ROW][C]Type I & II errors for various threshold values[/C][/ROW]
[ROW][C]Threshold[/C][C]Type I[/C][C]Type II[/C][/ROW]
[ROW][C]0.01[/C][C]0[/C][C]0.653846153846154[/C][/ROW]
[ROW][C]0.02[/C][C]0[/C][C]0.538461538461538[/C][/ROW]
[ROW][C]0.03[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]0.04[/C][C]0[/C][C]0.461538461538462[/C][/ROW]
[ROW][C]0.05[/C][C]0[/C][C]0.461538461538462[/C][/ROW]
[ROW][C]0.06[/C][C]0[/C][C]0.423076923076923[/C][/ROW]
[ROW][C]0.07[/C][C]0[/C][C]0.423076923076923[/C][/ROW]
[ROW][C]0.08[/C][C]0[/C][C]0.423076923076923[/C][/ROW]
[ROW][C]0.09[/C][C]0[/C][C]0.384615384615385[/C][/ROW]
[ROW][C]0.1[/C][C]0[/C][C]0.346153846153846[/C][/ROW]
[ROW][C]0.11[/C][C]0[/C][C]0.346153846153846[/C][/ROW]
[ROW][C]0.12[/C][C]0[/C][C]0.346153846153846[/C][/ROW]
[ROW][C]0.13[/C][C]0[/C][C]0.307692307692308[/C][/ROW]
[ROW][C]0.14[/C][C]0[/C][C]0.307692307692308[/C][/ROW]
[ROW][C]0.15[/C][C]0[/C][C]0.307692307692308[/C][/ROW]
[ROW][C]0.16[/C][C]0[/C][C]0.307692307692308[/C][/ROW]
[ROW][C]0.17[/C][C]0[/C][C]0.230769230769231[/C][/ROW]
[ROW][C]0.18[/C][C]0[/C][C]0.230769230769231[/C][/ROW]
[ROW][C]0.19[/C][C]0[/C][C]0.230769230769231[/C][/ROW]
[ROW][C]0.2[/C][C]0[/C][C]0.192307692307692[/C][/ROW]
[ROW][C]0.21[/C][C]0[/C][C]0.192307692307692[/C][/ROW]
[ROW][C]0.22[/C][C]0[/C][C]0.192307692307692[/C][/ROW]
[ROW][C]0.23[/C][C]0[/C][C]0.192307692307692[/C][/ROW]
[ROW][C]0.24[/C][C]0[/C][C]0.192307692307692[/C][/ROW]
[ROW][C]0.25[/C][C]0[/C][C]0.192307692307692[/C][/ROW]
[ROW][C]0.26[/C][C]0[/C][C]0.153846153846154[/C][/ROW]
[ROW][C]0.27[/C][C]0[/C][C]0.115384615384615[/C][/ROW]
[ROW][C]0.28[/C][C]0[/C][C]0.115384615384615[/C][/ROW]
[ROW][C]0.29[/C][C]0[/C][C]0.115384615384615[/C][/ROW]
[ROW][C]0.3[/C][C]0[/C][C]0.0769230769230769[/C][/ROW]
[ROW][C]0.31[/C][C]0[/C][C]0.0769230769230769[/C][/ROW]
[ROW][C]0.32[/C][C]0[/C][C]0.0769230769230769[/C][/ROW]
[ROW][C]0.33[/C][C]0.1[/C][C]0.0769230769230769[/C][/ROW]
[ROW][C]0.34[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.35[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.36[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.37[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.38[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.39[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.4[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.41[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.42[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.43[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.44[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.45[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.46[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.47[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.48[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.49[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.5[/C][C]0.1[/C][C]0.0384615384615385[/C][/ROW]
[ROW][C]0.51[/C][C]0.1[/C][C]0[/C][/ROW]
[ROW][C]0.52[/C][C]0.1[/C][C]0[/C][/ROW]
[ROW][C]0.53[/C][C]0.1[/C][C]0[/C][/ROW]
[ROW][C]0.54[/C][C]0.1[/C][C]0[/C][/ROW]
[ROW][C]0.55[/C][C]0.1[/C][C]0[/C][/ROW]
[ROW][C]0.56[/C][C]0.2[/C][C]0[/C][/ROW]
[ROW][C]0.57[/C][C]0.2[/C][C]0[/C][/ROW]
[ROW][C]0.58[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.59[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.6[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.61[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.62[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.63[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.64[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.65[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.66[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.67[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.68[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.69[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.7[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.71[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.72[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.73[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.74[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.75[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.76[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.77[/C][C]0.3[/C][C]0[/C][/ROW]
[ROW][C]0.78[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.79[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.8[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.81[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.82[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.83[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.84[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.85[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.86[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.87[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.88[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.89[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.9[/C][C]0.4[/C][C]0[/C][/ROW]
[ROW][C]0.91[/C][C]0.5[/C][C]0[/C][/ROW]
[ROW][C]0.92[/C][C]0.5[/C][C]0[/C][/ROW]
[ROW][C]0.93[/C][C]0.5[/C][C]0[/C][/ROW]
[ROW][C]0.94[/C][C]0.5[/C][C]0[/C][/ROW]
[ROW][C]0.95[/C][C]0.5[/C][C]0[/C][/ROW]
[ROW][C]0.96[/C][C]0.5[/C][C]0[/C][/ROW]
[ROW][C]0.97[/C][C]0.5[/C][C]0[/C][/ROW]
[ROW][C]0.98[/C][C]0.7[/C][C]0[/C][/ROW]
[ROW][C]0.99[/C][C]1[/C][C]0[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=211390&T=4

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=211390&T=4

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Type I & II errors for various threshold values
ThresholdType IType II
0.0100.653846153846154
0.0200.538461538461538
0.0300.5
0.0400.461538461538462
0.0500.461538461538462
0.0600.423076923076923
0.0700.423076923076923
0.0800.423076923076923
0.0900.384615384615385
0.100.346153846153846
0.1100.346153846153846
0.1200.346153846153846
0.1300.307692307692308
0.1400.307692307692308
0.1500.307692307692308
0.1600.307692307692308
0.1700.230769230769231
0.1800.230769230769231
0.1900.230769230769231
0.200.192307692307692
0.2100.192307692307692
0.2200.192307692307692
0.2300.192307692307692
0.2400.192307692307692
0.2500.192307692307692
0.2600.153846153846154
0.2700.115384615384615
0.2800.115384615384615
0.2900.115384615384615
0.300.0769230769230769
0.3100.0769230769230769
0.3200.0769230769230769
0.330.10.0769230769230769
0.340.10.0384615384615385
0.350.10.0384615384615385
0.360.10.0384615384615385
0.370.10.0384615384615385
0.380.10.0384615384615385
0.390.10.0384615384615385
0.40.10.0384615384615385
0.410.10.0384615384615385
0.420.10.0384615384615385
0.430.10.0384615384615385
0.440.10.0384615384615385
0.450.10.0384615384615385
0.460.10.0384615384615385
0.470.10.0384615384615385
0.480.10.0384615384615385
0.490.10.0384615384615385
0.50.10.0384615384615385
0.510.10
0.520.10
0.530.10
0.540.10
0.550.10
0.560.20
0.570.20
0.580.30
0.590.30
0.60.30
0.610.30
0.620.30
0.630.30
0.640.30
0.650.30
0.660.30
0.670.30
0.680.30
0.690.30
0.70.30
0.710.30
0.720.30
0.730.30
0.740.30
0.750.30
0.760.30
0.770.30
0.780.40
0.790.40
0.80.40
0.810.40
0.820.40
0.830.40
0.840.40
0.850.40
0.860.40
0.870.40
0.880.40
0.890.40
0.90.40
0.910.50
0.920.50
0.930.50
0.940.50
0.950.50
0.960.50
0.970.50
0.980.70
0.9910



Parameters (Session):
Parameters (R input):
R code (references can be found in the software module):
library(brglm)
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 <- brglm(x)
summary(r)
rc <- summary(r)$coeff
try(hm <- hosmerlem(y[1,],r$fitted.values),silent=T)
try(hm,silent=T)
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.row.start(a)
a<-table.element(a,'Hosmer–Lemeshow test',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Chi-square',1,TRUE)
phm <- array('NA',dim=3)
for (i in 1:3) { try(phm[i] <- hm[i],silent=T) }
a<-table.element(a,phm[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Degrees of Freedom',1,TRUE)
a<-table.element(a,phm[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'P(>Chi)',1,TRUE)
a<-table.element(a,phm[3])
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')