Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_boxcoxnorm.wasp
Title produced by softwareBox-Cox Normality Plot
Date of computationMon, 27 Sep 2021 16:47:06 +0200
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2021/Sep/27/t1632754187cn2lw8t62ic6h2s.htm/, Retrieved Mon, 29 Apr 2024 05:47:41 +0200
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=, Retrieved Mon, 29 Apr 2024 05:47:41 +0200
QR Codes:

Original text written by user:
IsPrivate?This computation is private
User-defined keywords
Estimated Impact0
Dataseries X:
295
1
10
865
1370
49
10
248
36
2
492
15
70
6
4
375
39
90
569
112
52
57
152
10
375
63
23
1
46
9
4
34
63
42
2
325
1181
867
878
35
92
12
688
822
76
53
1
17
6
459
61
20
60
1
257
188
1179
14
104
87
363
29
1504
11
98
10
89
33
69
56
28
164
292
2
140
31
261
680
10
21
186
215
11
45
249
16
47
5
18
130
783
67
6
175
22
109
831
112
1180
13
158
8
1
297
26
163
121
416
31
44
460
80
16
365
144
463
193
24
32
791
23
264
40
53
808
25
2
10
223
83
69
2
43
5
117
225
117
42
67
1203
10
187
5
97
299
200
18
36
1
200
4
194
69
2293
161
128
9
75
163
494
25
377
58
6
155
449
53
253
61
47
1537
251
311
7
55
1377
360
74
69
79
1765
1
138
8
129
383
2
252
39
101
455
247
30
135
1175
1
2
112
2
17
75
2
418
7
1
93
69
92
328
550
200
113
13
35
212
790
371
164
7
579
39
55
82
4
89
1
9
429
26
834
220
31
356
4
3
97
1325
282
203
10
2
14
11
10
61
3
167
99
85
102
17
80
701
101
29
24
58
47
27
25
816
4
263
203
371
132
53
2
37
14
733
969
3
84
215
24
1013
63
64
37
70
17
34
194
674
2
7
99
206
3
142
81
414
147
1
137
92
1152
20
58
33
1077
18
596
20
17
47
216
99
638
434
68
19
216
7
81
120
1
95
47
1597
885
42
29
226
1788
386
9
49
186
18
336
106
94
1
338
1445
207
19
483
44
159
4
289
63
486
1
2
653
84
26
98
13
30
79
177
54
194
439
275
210
43
7
439
382
240
27
73
171
5
15
49
4
234
2
252
698
1071
141
221
85
90
1551
1
88
16
8
8
14
20
44
7
343
661
290
342
184
2
491
10
42
92
536
116
558
159
201
382
40
40
446
14
128
419
138
6
72
4
138
22
778
10
356
31
537
895
39
5
108
243
102
28
137
1
16
4
80
93
308
2
237
291
71
155
144
134
163
53
35
44
763
94
1943
96
3
30
511
79
126
69
39
61
139
382
55
32
70
139
1218
575
78
162
37
42
1
74
528
1
393
196
365
1208
359
1201
116
531
28
30
157
494
2
255
33
17
23
697
4
48
781
15
103
92
11
202
141
64
23
136
1541
24
120
27
357
364
36
76
4
402
29
827
213
56
604
28
49
1400
138
262
24
102
21
2
25
67
53
326
309
227
139
71
8
4
71
99
8
328
264
127
165
539
25
568
210
121
987
19
244
581
1
1
359
335
22
122
2
53
335
29
118
68
109
540
664
31
26
164
423
827
26
1
2
16
224
3
19
230
189
305
134
1184
2
151
41
4
51
268
43
436
74
42
84
191
101
9
504
33
2
339
74
1596
97
1031
33
47
1554
432
19
201
59
36
239
13
182
2
240
32
1625
775
36
70
354
20
693
58
33
1058
262
252
2
10
129
82
160
14
518
433
1023
349
15
705
1
275
1
37
58
57
752
43
569
81
109
990
206
864
93
38
23
16
35
65
455
283
815
56
363
14
97
639
31
120
204
89
83
56
38
546
12
1
370
5
20
119
90
52
136
41
239
470
217
575
504
75
542
52
137
339
114
7
17
10
9
124
219
95
324
134
1113
221
994
786
74
260
86
467
91
1
229
448
273
4
94
654
86
132
123
127
124
25
28
7
233
166
342
97
170
1178
46
476
2733
215
1
208
181
505
79
482
74
25
2
919
71
565
149
448
105
153
29
144
25
761
1194
122
237
7
42
9
57
59
35
4
202
732
35
595
69
1676
124
116
77
67
31
61
313
499
67
827
153
1
1
370
97
78
525
717
656
242
24
523
460
67
91
522
12
20
147
56
179
13
4
113
348
622
697
12
153
79
263
155
459
9
280
36
20
2
70
284
148
140
64
1205
12
7
128
92
97
151
18
947
53
698
57
2
133
115
20
808
6
3
60
34
265
1029
844
36
52
108
1551
240
101
85
2
116
780
152
193
131
13
19
16
1312
837
382
493
37
586
67
506
52
476
24
28
3
72
246
50
704
613
453
2
476
283
77
331
1
13
40
63
24
631
62
18
527
614
557
86
1427
9
337
272
61
57
27
77
3
90
129
467
57
203
4
166
568
805
40
205
21
146
77
792
20
92
14
254
41
58
7
67
29
1
4
50
737
120
240
54
89
221
935
259
45
42
108
132
44
225
162
457
9
39
109
2
193
810
77
365
94
327
248
228
301
41
2
778
143
53
1305
44
23
65
70
1133
120
66
90
212
5
1
2
386
176
38
180
129
38
1109
430
1007
531
169
37
240
50
10
1066
51
51
688
77
120
2
6
41
78
91
243
199
508
324
371
85
41
304
41
124
1
11
7
49
22
595
242
199
2
68
1437
123
71
76
12
27
13
94
60
113
283
34
144
3
26
2
4
585
128
30
113
546
768
14
321
69
92
504
32
125
15
235
38
100
104
61
1
3
103
74
2
497
340
197
58
104
474
156
2
2
2
221
157
356
160
78
952
124
100
806
1044
8
740
92
506
76
1
3
3
175
2187
24
1
1
67
292
422
239
896
50
84
140
194
76
39
103
32
79
78
38
125
1
4
65
373
165
1213
217
9
2033
189
120
547
1
9
1
32
51
445
128
92
117
1
2
333
1
116
203
381
664
253
36
409
294
43
162
291
9
955
1
14
39
2
15
26
1
23
28
777
172
629
1
110
1611
139
8
42
29
3
256
277
174
7
1
1
72
8
155
475
137
555
385
340
1061
128
360
1
8
7
42
59
6
145
165
173
337
511
89
107
527
961
37
129
227
690
37
135
12
2
389
3
5
169
234
73
345
296
452
12
190
92
113
282
150
50
163
11
857
1
10
225
25
101
97
795
1235
61
65
545
193
158
31
4
3
270
272
137
1
449
499
1318
77
551
20
1816
96
75
1
702
3
960
20
54
2
397
135
78
16
2
20
159
31
745
292
173
653
40
176
255
1
110
2
11
19
4
1
4
80
535
122
841
206
38
199
1740
275
1153
3
1
1070
50
35
4
176
130
417
132
11
36
2
68
799
659
50
369
2
1
299
30
166
5
499
1
458
1
188
1
44
119
666
710
20
170
206
1189
73
172
289
1
296
48
10
1220
4
16
14
168
119
257
205
160
772
21
212
12
125
309
127
121
15
272
92
69
757
26
138
659
2
108
54
113
2121
248
26
124
1488
135
390
176
72
10
61
7
1
262
232
35
327
1
55
400
1063
443
4
342
137
109
400
70
631
23
40
2
337
439
400
3
92
1
36
337
370
665
28
530
1133
77
153
117
197
69
1
30
128
6
191
98
270
745
257
45
138
676
142
818
115
186
20
2
1
137
30
3
312
294
462
56
23
16
353
221
68
812
741
638
128
52
35
5
37
199
5
139
13
80
2
1
186
101
132
932
405
69
121
305
11
2
10
8
39
5
211
122
182
89
69
684
2
8
106
118
742
135
491
102
280
80
457
7
20
32
194
503
86
31
139
323
894
809
129
50
196
275
69
16
17
40
242
1
12
72
10
91
395
1
199
3
1320
438
224
1477
333
98
474
1394
32
40
9
535
436
85
158
137
123
362
43
359
203
1107
787
79
241
267
5
16
38
35
74
27
1
113
841
182
1579
90
264
666
43
8
80
350
799
23
39
3
469
240
405
119
10
328
43
722
475
1
99
55
427
8
70
108
42
75
9
39
1
234
153
44
327
481
48
21
53
85
1004
2
2
42
8
70
41
4
122
652
300
361
230
2197
14
17
590
533
484
147
57
581
284
28
305
407
66
80
123
80
958
780
47
153
46
1
35
252
227
109
222
1726
687
1826
261
358
670
70
5
2
366
49
299
118
308
306
330
15
645
1217
22
440
4
16
415
182
602
1
215
228
988
124
168
172
980
179
594
339
39
142
293
270
205
159
30
591
387
42
215
528
90
166
65
157
550
471
54
463
39
280
229
153
169
393
26
178
996
339
756
29
42
12
21
171
590
1331
231
68
115
119
190
20
525
40
1093
592
46
2121
243
132
972
1
15
50
41
13
119
1
125
286
96
74
576
414
486
925
482
138
230
16
53
6
1009
3
88
213
829
438
1007
453
274
317
1
296
2
34
36
3
92
454
120
20
32
695
509
518
280
871
1067
112
5
83
70
2
100
635
60
1780
110
654
58
947
155
139
875
3
93
5
15
1
151
243
251
159
320
294
237
27
776
842
206
161
26
36
624
8
496
27
53
177
72
815
842
157
2335
432
1
20
69
23
4
192
100
243
76
421
1146
123
469
638
182
548
127
343
38
56
2
669
118
253
45
122
94
281
128
970
37
620
1676
367
477
9
48
99
34
19
68
2
491
284
346
200
987
523
261
774
2
311
1
24
49
3
403
205
249
280
50
718
890
117
1047
248
194
11
45
14
32
104
482
27
144
652
41
108
513
287
1174
36
37
15
40
254
76
181
410
184
239
498
6
38
978
749
863
13
921
96
101
108
48
66
652
227
254
291
825
495
44
2
119
59
190
33
17
310
119
40
1252
1249
255
478
964
8
110
29
383
1
11
1067
152
184
345
14
67
314
251
2567
278
894
1294
102
26
875
37
286
21
184
51
227
3
1447
463
226
1063
452
425
335
1208
1
111
291
11
23
43
54
2
108
380
190
227
8
4
2
166
715
562
38
1067
1337
107
69
422
13
144
14
92
32
7
6
30
271
745
90
529
722
227
840
1
37
29
65
41
8
141
181
111
616
539
121
73
58
48
53
257
872
20
944
4
265
185
33
135
136
34
19
238
101
1205
34
770
10
84
31
11
172
233
235
462
125
29
1398
145
1612
629
3
1084
104
10
195
606
57
66
4
1301
164
88
418
51
3
154
168
87
1213
1757
446
204
61
212
50
66
33
12
192
4
1090
8
544
144
858
440
1217
397
1187
3
87
125
20
3
53
22
90
2
158
200
337
146
12
1
30
187
77
133
651
372
944
1
534
260
652
462
253
36
109
5
241
571
45
54
202
789
224
68
785
220
952
1363
12
11
11
287
532
64
168
895
1074
7
887
98
143
390
20
141
70
177
95
107
111
1256
515
1847
999
15
4
6
13
549
138
109
314
574
1562
414
47
885
1093
31
90
44
12
49
803
112
15
498
124
657
633
166
1681
815
362
40
34
6
220
947
314
1454
263
993
366
897
926
39
309
231
29
180
17
65
5
196
5
88
359
243
701
36
495
2
961
609
8
121
719
152
68
37
3
196
1147
486
176
163
629
713
139
546
1092
265
42
34
5
290
330
309
469
654
90
71
158
45
1277
349
863
863
214
101
1438
164
34
111
135
156
28
87
566
186
5
17
6
208
141
419
91
318
52
1320
603
1751
692
753
46
661
12
883
81
362
153
507
182
502
1385
501
22
60
21
5
643
3
900
706
1111
307
480
1108
959
256
673
1659
190
41
91
17
2
201
420
5
194
488
765
523
397
168
767
3
143
796
3
202
57
95
3
99
663
92
322
168
2
378
807
200
593
21
235
928
913
402
11
61
287
373
366
163
1175
73
233
52
93
1570
81
498
1028
880
99
458
53
116
147
122
1611
42
225
841
10
16
18
146
71
5
275
393
1
196
1333
625
772
469
948
3
525
1
8
21
734
3
326
354
3
174
230
853
5
54
607
416
1489
485
458
53
28
51
374
1508
1030
3
177
1565
122
2140
45
234
1029
1529
37
208
36
81
10
248
503
32
51
710
189
772
60
1
777
1
892
31
68
62
134
381
49
76
47
4
177
871
658
85
100
28
255
1129
211
16
17
96
9
350
76
364
729
13
81
282
135
1671
51
788
735
67
113
288
5
51
135
27
941
86
236
85
93
9
8
5
240
2
195
314
171
214
1270
631
106
587
1269
56
112
23
8
606
71
38
583
3
607
352
861
294
357
690
96
36
1021
437
489
240
42
1020
218
478
159
1633
719
64
625
1438
1133
9
72
64
15
8
157
82
39
281
536
167
709
808
1011
1
165
96
35
9
176
643
120
813
89
142
73
642
1039
143
34
129
53
21
4
223
157
540
743
8
65
53
56
1117
21
1212
696
223
103
106
17
21
542
149
50
1661
46
577
33
98
142
23
192
83
9
31
339
491
873
116
460
1558
280
332
578
58
49
13
49
745
47
108
16
3
50
183
314
815
16
663
1197
21
1342
46
86
12
2
115
413
217
607
216
7
150
901
444
871
777
53
26
57
2
154
131
436
95
510
102
321
663
339
682
953
2
524
128
128
22
56
3
93
9
918
271
457
803
535
664
1
34
179
933
24
71
20
8
206
344
327
114
34
172
233
74
1432
631
79
185
718
670
79
272
216
134
325
55
25
33
292
78
46
698
1
7
218
25
655
266
214
1
296
1239
121
137
33
102
199
982
33
3
593
39
4
428
1317
584
287
107
36
767
1401
109
778
20
838
149
25
66
17
598
453
500
482
147
831
759
184
42
381
1044
2
129
27
44
150
408
458
135
20
1054
190
670
763
656
543
351
370
438
2
2
13
117
182
13
73
4
30
64
564
5
178
476
822
815
99
162
630
797
13
60
2
756
356
691
444
169
270
63
124
1088
941
13
47
448
458
7
142
161
64
158
1601
175
1753
514
2
117
30
4
543
121
61
829
108
430
233
1327
401
638
46
72
344
58
685
1461
1
48
15
2
612
141
39
31
520
543
168
360
533
530
36
88
18
3
20
877
403
509
152
335
787
194
25
121
1647
251
1219
767
50
75
93
20
4
216
545
480
693
734
364
52
677
384
577
6
256
2
144
723
5
585
63
19
4
85
282
28
28
193
973
292
135
545
634
83
14
3
231
209
233
178
469
92
572
826
169
321
46
740
510
49
1737
104
377
8
505
431
2
15
160
506
54
307
5
27
379
121
26
684
30
103
741
695
1248
521
191
103
1724
624
59
1168
1357
1
51
14
59
1228
822
35
42
2
30
145
359
205
67
478
233
1
38
61
6
107
106
929
531
70
172
185
1073
290
75
1554
139
1017
1171
69
795
303
15
63
6
169
189
241
212
281
199
683
211
613
9
154
10
92
28
153
352
92
694
200
21
140
853
674
468
35
79
44
129
3
371
319
917
56
14
12
275
99
315
596
110
73
35
223
51
56
846
341
8
7
95
491
204
43
340
160
53
53
181
1781
802
147
131
686
1
1
90
7
55
313
327
363
74
1112
590
162
690
756
177
1902
30
57
5
1002
233
465
1
34
169
185
796
808
522
30
83
9
3
416
638
65
198
541
840
885
1213
159
39
79
42
8
147
108
463
510
633
502
310
1953
838
84
205
93
23
54
267
351
78
665
312
407
165
443
272
1003
81
105
232
357
36
414
320
703
56
786
371
343
194
324
84
30
95
140
261
1718
81
2032
527
2
31
16
90
215
2
1083
447
201
494
1489
116
18
10
131
721
1007
2
674
361
962
591
978
2
179
18
92
33
8
664
38
228
800
847
205
1459
293
1031
365
6
219
20
46
11
11
140
105
668
102
804
461
707
763
615
77
23
51
255
69
30
34
182
1490
81
62
708
293
378
36
4
377
442
168
412
590
249
459
30
249
78
1368
507
156
1535
596
6
13
92
178
136
30
81
319
221
2083
248
187
482
971
1675
42
9
505
690
192
30
216
377
296
10
424
182
6
777
27
136
79
4
11
1004
869
466
1415
256
27
494
290
4
1108
523
90
51
73
4
194
236
574
299
571
30
731
826
327
319
956
856
1025
107
15
14
24
709
294
34
32
30
138
789
781
344
60
292
53
8
77
6
170
108
119
43
404
24
447
198
84
245
51
920
565
178
726
140
18
90
1146
455
239
2655
993
10
10
52
10
724
213
19
30
1705
95
637
295
61
333
288
1
1235
18
28
68
2
708
259
30
189
77
456
542
252
337
1467
150
434
479
146
80
9
11
845
405
85
637
451
30
460
93
112
654
225
887
750
480
654
300
46
4
3
180
64
338
129
30
2
1340
498
1713
223
91
326
1981
1227
67
50
721
240
850
250
49
241
858
74
3
512
78
105
830
190
1
76
333
279
127
316
78
1501
1738
25
53
409
873
43
212
34
184
681
88
56
330
39
9
721
141
122
126
560
1451
154
353
35
1827
256
655
2
21
53
10
35
391
71
144
92
641
241
57
596
1327
598
593
796
79
10
42
6
87
190
493
41
553
54
865
511
617
210
930
994
680
69
9
7
104
186
531
34
802
668
75
540
438
265
74
950
1145
114
11
43
255
518
44
101
763
1062
163
65
3
1168
1136
1
123
76
3
374
418
181
137
28
263
293
75
397
86
197
1575




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center







Box-Cox Normality Plot
# observations x3586
maximum correlation0.993131723210846
optimal lambda0.2
transformation formulafor all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda

\begin{tabular}{lllllllll}
\hline
Box-Cox Normality Plot \tabularnewline
# observations x & 3586 \tabularnewline
maximum correlation & 0.993131723210846 \tabularnewline
optimal lambda & 0.2 \tabularnewline
transformation formula & for all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&T=1

[TABLE]
[ROW][C]Box-Cox Normality Plot[/C][/ROW]
[ROW][C]# observations x[/C][C]3586[/C][/ROW]
[ROW][C]maximum correlation[/C][C]0.993131723210846[/C][/ROW]
[ROW][C]optimal lambda[/C][C]0.2[/C][/ROW]
[ROW][C]transformation formula[/C][C]for all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=&T=1

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

As an alternative you can also use a QR Code:  

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

Box-Cox Normality Plot
# observations x3586
maximum correlation0.993131723210846
optimal lambda0.2
transformation formulafor all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda







Maximum Likelihood Estimation of Lambda
> summary(mypT)
bcPower Transformation to Normality 
  Est Power Rounded Pwr Wald Lwr Bnd Wald Upr Bnd
x    0.1772        0.18       0.1592       0.1951
Likelihood ratio test that transformation parameter is equal to 0
 (log transformation)
                           LRT df       pval
LR test, lambda = (0) 399.6451  1 < 2.22e-16
Likelihood ratio test that no transformation is needed
                           LRT df       pval
LR test, lambda = (1) 5654.984  1 < 2.22e-16

\begin{tabular}{lllllllll}
\hline
Maximum Likelihood Estimation of Lambda \tabularnewline
> summary(mypT)
bcPower Transformation to Normality 
  Est Power Rounded Pwr Wald Lwr Bnd Wald Upr Bnd
x    0.1772        0.18       0.1592       0.1951
Likelihood ratio test that transformation parameter is equal to 0
 (log transformation)
                           LRT df       pval
LR test, lambda = (0) 399.6451  1 < 2.22e-16
Likelihood ratio test that no transformation is needed
                           LRT df       pval
LR test, lambda = (1) 5654.984  1 < 2.22e-16
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=&T=2

[TABLE]
[ROW][C]Maximum Likelihood Estimation of Lambda[/C][/ROW]
[ROW][C]
> summary(mypT)
bcPower Transformation to Normality 
  Est Power Rounded Pwr Wald Lwr Bnd Wald Upr Bnd
x    0.1772        0.18       0.1592       0.1951
Likelihood ratio test that transformation parameter is equal to 0
 (log transformation)
                           LRT df       pval
LR test, lambda = (0) 399.6451  1 < 2.22e-16
Likelihood ratio test that no transformation is needed
                           LRT df       pval
LR test, lambda = (1) 5654.984  1 < 2.22e-16
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=&T=2

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

As an alternative you can also use a QR Code:  

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

Maximum Likelihood Estimation of Lambda
> summary(mypT)
bcPower Transformation to Normality 
  Est Power Rounded Pwr Wald Lwr Bnd Wald Upr Bnd
x    0.1772        0.18       0.1592       0.1951
Likelihood ratio test that transformation parameter is equal to 0
 (log transformation)
                           LRT df       pval
LR test, lambda = (0) 399.6451  1 < 2.22e-16
Likelihood ratio test that no transformation is needed
                           LRT df       pval
LR test, lambda = (1) 5654.984  1 < 2.22e-16



Parameters (Session):
par1 = Full Box-Cox transform ; par2 = -2 ; par3 = 2 ; par4 = 0 ; par5 = No ;
Parameters (R input):
par1 = Full Box-Cox transform ; par2 = -2 ; par3 = 2 ; par4 = 0 ; par5 = No ;
R code (references can be found in the software module):
library(car)
par2 <- abs(as.numeric(par2)*100)
par3 <- as.numeric(par3)*100
if(par4=='') par4 <- 0
par4 <- as.numeric(par4)
numlam <- par2 + par3 + 1
x <- x + par4
n <- length(x)
c <- array(NA,dim=c(numlam))
l <- array(NA,dim=c(numlam))
mx <- -1
mxli <- -999
for (i in 1:numlam)
{
l[i] <- (i-par2-1)/100
if (l[i] != 0)
{
if (par1 == 'Full Box-Cox transform') x1 <- (x^l[i] - 1) / l[i]
if (par1 == 'Simple Box-Cox transform') x1 <- x^l[i]
} else {
x1 <- log(x)
}
c[i] <- cor(qnorm(ppoints(x), mean=0, sd=1),sort(x1))
if (mx < c[i])
{
mx <- c[i]
mxli <- l[i]
x1.best <- x1
}
}
print(c)
print(mx)
print(mxli)
print(x1.best)
if (mxli != 0)
{
if (par1 == 'Full Box-Cox transform') x1 <- (x^mxli - 1) / mxli
if (par1 == 'Simple Box-Cox transform') x1 <- x^mxli
} else {
x1 <- log(x)
}
mypT <- powerTransform(x)
summary(mypT)
bitmap(file='test1.png')
plot(l,c,main='Box-Cox Normality Plot', xlab='Lambda',ylab='correlation')
mtext(paste('Optimal Lambda =',mxli))
grid()
dev.off()
bitmap(file='test2.png')
hist(x,main='Histogram of Original Data',xlab='X',ylab='frequency')
grid()
dev.off()
bitmap(file='test3.png')
hist(x1,main='Histogram of Transformed Data', xlab='X',ylab='frequency')
grid()
dev.off()
bitmap(file='test4.png')
qqPlot(x)
grid()
mtext('Original Data')
dev.off()
bitmap(file='test5.png')
qqPlot(x1)
grid()
mtext('Transformed Data')
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Box-Cox Normality Plot',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'# observations x',header=TRUE)
a<-table.element(a,n)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'maximum correlation',header=TRUE)
a<-table.element(a,mx)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'optimal lambda',header=TRUE)
a<-table.element(a,mxli)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'transformation formula',header=TRUE)
if (par1 == 'Full Box-Cox transform') {
a<-table.element(a,'for all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda')
} else {
a<-table.element(a,'for all lambda <> 0 : T(Y) = Y^lambda')
}
a<-table.row.end(a)
if(mx<0) {
a<-table.row.start(a)
a<-table.element(a,'Warning: maximum correlation is negative! The Box-Cox transformation must not be used.',2)
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
if(par5=='Yes') {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Obs.',header=T)
a<-table.element(a,'Original',header=T)
a<-table.element(a,'Transformed',header=T)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i)
a<-table.element(a,x[i])
a<-table.element(a,x1.best[i])
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,'Maximum Likelihood Estimation of Lambda',1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,paste('
',RC.texteval('summary(mypT)'),'
',sep=''))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')