-
Notifications
You must be signed in to change notification settings - Fork 0
/
edible_Cities_AHP_Survey.tex
2376 lines (2070 loc) · 166 KB
/
edible_Cities_AHP_Survey.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass [oneside,10pt,a4paper,ngerman,BCOR10mm,headsepline,parindent,final]{scrartcl}
\usepackage[breakable]{tcolorbox}
\usepackage{parskip} % Stop auto-indenting (to mimic markdown behaviour)
% Basic figure setup, for now with no caption control since it's done
% automatically by Pandoc (which extracts ![](path) syntax from Markdown).
\usepackage{graphicx}
% Maintain compatibility with old templates. Remove in nbconvert 6.0
% \let\Oldincludegraphics\includegraphics
% Ensure that by default, figures have no caption (until we provide a
% proper Figure object with a Caption API and a way to capture that
% in the conversion process - todo).
% \usepackage{caption}
% \DeclareCaptionFormat{nocaption}{}
% \captionsetup{format=nocaption,aboveskip=0pt,belowskip=0pt}
\usepackage{float}
\floatplacement{figure}{H} % forces figures to be placed at the correct location
\usepackage{xcolor} % Allow colors to be defined
\usepackage{enumerate} % Needed for markdown enumerations to work
\usepackage{geometry} % Used to adjust the document margins
\usepackage{amsmath} % Equations
\usepackage{amssymb} % Equations
\usepackage{textcomp} % defines textquotesingle
% Hack from http://tex.stackexchange.com/a/47451/13684:
\AtBeginDocument{%
\def\PYZsq{\textquotesingle}% Upright quotes in Pygmentized code
}
\usepackage{upquote} % Upright quotes for verbatim code
\usepackage{eurosym} % defines \euro
\usepackage{iftex}
\ifPDFTeX
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% Without the 'lmodern' package, 'pdflatex' substitutes the Type 1 fonts
% against the bitmap based Type 3 fonts and you get a very pixelated typeface.
\usepackage{lmodern}
\else
\usepackage{fontspec}
\usepackage{unicode-math}
\fi
\usepackage{fancyvrb} % verbatim replacement that allows latex
\usepackage{grffile} % extends the file name processing of package graphics
% to support a larger range
\makeatletter % fix for old versions of grffile with XeLaTeX
\@ifpackagelater{grffile}{2019/11/01}
{
% Do nothing on new versions
}
{
\def\Gread@@xetex#1{%
\IfFileExists{"\Gin@base".bb}%
{\Gread@eps{\Gin@base.bb}}%
{\Gread@@xetex@aux#1}%
}
}
\makeatother
\usepackage[Export]{adjustbox} % Used to constrain images to a maximum size
\adjustboxset{max size={0.9\linewidth}{0.9\paperheight}}
% The hyperref package gives us a pdf with properly built
% internal navigation ('pdf bookmarks' for the table of contents,
% internal cross-reference links, web links for URLs, etc.)
\usepackage{hyperref}
% The default LaTeX title has an obnoxious amount of whitespace. By default,
% titling removes some of it. It also provides customization options.
\usepackage{titling}
\usepackage{longtable} % longtable support required by pandoc >1.10
\usepackage{booktabs} % table support for pandoc > 1.12.2
\usepackage{array} % table support for pandoc >= 2.11.3
\usepackage{calc} % table minipage width calculation for pandoc >= 2.11.1
\usepackage[inline]{enumitem} % IRkernel/repr support (it uses the enumerate* environment)
\usepackage[normalem]{ulem} % ulem is needed to support strikethroughs (\sout)
% normalem makes italics be italics, not underlines
\usepackage{mathrsfs}
% Using fancy headers and footers
\usepackage{fancyhdr}
% Used for entering author names and their affiliations
\usepackage[affil-it]{authblk}
% Use bibliography% and configure it
\usepackage[babel,german=quotes]{csquotes}
\usepackage[backend=biber,style=authoryear,backref=true]{biblatex}
\bibliography{literature/notebook.bib}
\usepackage{url} %Output of nicely formatted Internet addresses
\setcounter{biburllcpenalty}{7000} %Setting for counter to wrap URLs in literature references
\setcounter{biburlucpenalty}{8000} %ditto
% increase title page by shifting title and authors something upwards
\setlength{\droptitle}{-3em}
% Colors for the hyperref package
\definecolor{urlcolor}{rgb}{0,.145,.698}
\definecolor{linkcolor}{rgb}{.71,0.21,0.01}
\definecolor{citecolor}{rgb}{.12,.54,.11}
% ANSI colors
\definecolor{ansi-black}{HTML}{3E424D}
\definecolor{ansi-black-intense}{HTML}{282C36}
\definecolor{ansi-red}{HTML}{E75C58}
\definecolor{ansi-red-intense}{HTML}{B22B31}
\definecolor{ansi-green}{HTML}{00A250}
\definecolor{ansi-green-intense}{HTML}{007427}
\definecolor{ansi-yellow}{HTML}{DDB62B}
\definecolor{ansi-yellow-intense}{HTML}{B27D12}
\definecolor{ansi-blue}{HTML}{208FFB}
\definecolor{ansi-blue-intense}{HTML}{0065CA}
\definecolor{ansi-magenta}{HTML}{D160C4}
\definecolor{ansi-magenta-intense}{HTML}{A03196}
\definecolor{ansi-cyan}{HTML}{60C6C8}
\definecolor{ansi-cyan-intense}{HTML}{258F8F}
\definecolor{ansi-white}{HTML}{C5C1B4}
\definecolor{ansi-white-intense}{HTML}{A1A6B2}
\definecolor{ansi-default-inverse-fg}{HTML}{FFFFFF}
\definecolor{ansi-default-inverse-bg}{HTML}{000000}
% common color for the border for error outputs.
\definecolor{outerrorbackground}{HTML}{FFDFDF}
% commands and environments needed by pandoc snippets
% extracted from the output of `pandoc -s`
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\newenvironment{Shaded}{}{}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}}
\newcommand{\RegionMarkerTok}[1]{{#1}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\NormalTok}[1]{{#1}}
% Additional commands for more recent versions of Pandoc
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{{#1}}}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{{#1}}}
\newcommand{\ImportTok}[1]{{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{{#1}}}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{{#1}}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{{#1}}}
\newcommand{\BuiltInTok}[1]{{#1}}
\newcommand{\ExtensionTok}[1]{{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{{#1}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{{#1}}}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{{#1}}}}}
% Define a nice break command that doesn't care if a line doesn't already
% exist.
\def\br{\hspace*{\fill} \\* }
% Math Jax compatibility definitions
\def\gt{>}
\def\lt{<}
\let\Oldtex\TeX
\let\Oldlatex\LaTeX
\renewcommand{\TeX}{\textrm{\Oldtex}}
\renewcommand{\LaTeX}{\textrm{\Oldlatex}}
% Document parameters
% Document title
\title{\textbf{\textsf{Introducing a procedure to perform the Analytic Hierarchy Process with own survey data obtained from \emph{SoSci Survey} platform using R-package \emph{ahpsurvey}}}}\author[1]{Bj\"orn Kasper (\href{mailto:kasper.bjoern@bgetem.de}{kasper.bjoern@bgetem.de})}
\affil[1]{Test and Certification Body for Electrical Engineering at BG ETEM}\author[2]{Henriette John (\href{mailto:h.john@ioer.de}{h.john@ioer.de})}
\affil[2]{Leibniz Institute of Ecological Urban and Regional Development}\date{\today; version 0.5 (pre-release)}
% Pygments definitions
\makeatletter
\def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax%
\let\PY@ul=\relax \let\PY@tc=\relax%
\let\PY@bc=\relax \let\PY@ff=\relax}
\def\PY@tok#1{\csname PY@tok@#1\endcsname}
\def\PY@toks#1+{\ifx\relax#1\empty\else%
\PY@tok{#1}\expandafter\PY@toks\fi}
\def\PY@do#1{\PY@bc{\PY@tc{\PY@ul{%
\PY@it{\PY@bf{\PY@ff{#1}}}}}}}
\def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}}
\@namedef{PY@tok@w}{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
\@namedef{PY@tok@c}{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PY@tok@cp}{\def\PY@tc##1{\textcolor[rgb]{0.61,0.40,0.00}{##1}}}
\@namedef{PY@tok@k}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@kp}{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@kt}{\def\PY@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}
\@namedef{PY@tok@o}{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PY@tok@ow}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\@namedef{PY@tok@nb}{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@nf}{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\@namedef{PY@tok@nc}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\@namedef{PY@tok@nn}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\@namedef{PY@tok@ne}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.80,0.25,0.22}{##1}}}
\@namedef{PY@tok@nv}{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PY@tok@no}{\def\PY@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
\@namedef{PY@tok@nl}{\def\PY@tc##1{\textcolor[rgb]{0.46,0.46,0.00}{##1}}}
\@namedef{PY@tok@ni}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}}
\@namedef{PY@tok@na}{\def\PY@tc##1{\textcolor[rgb]{0.41,0.47,0.13}{##1}}}
\@namedef{PY@tok@nt}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@nd}{\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\@namedef{PY@tok@s}{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PY@tok@sd}{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PY@tok@si}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}}
\@namedef{PY@tok@se}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.67,0.36,0.12}{##1}}}
\@namedef{PY@tok@sr}{\def\PY@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}}
\@namedef{PY@tok@ss}{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PY@tok@sx}{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@m}{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PY@tok@gh}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\@namedef{PY@tok@gu}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
\@namedef{PY@tok@gd}{\def\PY@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
\@namedef{PY@tok@gi}{\def\PY@tc##1{\textcolor[rgb]{0.00,0.52,0.00}{##1}}}
\@namedef{PY@tok@gr}{\def\PY@tc##1{\textcolor[rgb]{0.89,0.00,0.00}{##1}}}
\@namedef{PY@tok@ge}{\let\PY@it=\textit}
\@namedef{PY@tok@gs}{\let\PY@bf=\textbf}
\@namedef{PY@tok@gp}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\@namedef{PY@tok@go}{\def\PY@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}}
\@namedef{PY@tok@gt}{\def\PY@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
\@namedef{PY@tok@err}{\def\PY@bc##1{{\setlength{\fboxsep}{\string -\fboxrule}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}}
\@namedef{PY@tok@kc}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@kd}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@kn}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@kr}{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@bp}{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PY@tok@fm}{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\@namedef{PY@tok@vc}{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PY@tok@vg}{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PY@tok@vi}{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PY@tok@vm}{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PY@tok@sa}{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PY@tok@sb}{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PY@tok@sc}{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PY@tok@dl}{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PY@tok@s2}{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PY@tok@sh}{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PY@tok@s1}{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PY@tok@mb}{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PY@tok@mf}{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PY@tok@mh}{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PY@tok@mi}{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PY@tok@il}{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PY@tok@mo}{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PY@tok@ch}{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PY@tok@cm}{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PY@tok@cpf}{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PY@tok@c1}{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PY@tok@cs}{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\def\PYZbs{\char`\\}
\def\PYZus{\char`\_}
\def\PYZob{\char`\{}
\def\PYZcb{\char`\}}
\def\PYZca{\char`\^}
\def\PYZam{\char`\&}
\def\PYZlt{\char`\<}
\def\PYZgt{\char`\>}
\def\PYZsh{\char`\#}
\def\PYZpc{\char`\%}
\def\PYZdl{\char`\$}
\def\PYZhy{\char`\-}
\def\PYZsq{\char`\'}
\def\PYZdq{\char`\"}
\def\PYZti{\char`\~}
% for compatibility with earlier versions
\def\PYZat{@}
\def\PYZlb{[}
\def\PYZrb{]}
\makeatother
% For linebreaks inside Verbatim environment from package fancyvrb.
\makeatletter
\newbox\Wrappedcontinuationbox
\newbox\Wrappedvisiblespacebox
\newcommand*\Wrappedvisiblespace {\textcolor{red}{\textvisiblespace}}
\newcommand*\Wrappedcontinuationsymbol {\textcolor{red}{\llap{\tiny$\m@th\hookrightarrow$}}}
\newcommand*\Wrappedcontinuationindent {3ex }
\newcommand*\Wrappedafterbreak {\kern\Wrappedcontinuationindent\copy\Wrappedcontinuationbox}
% Take advantage of the already applied Pygments mark-up to insert
% potential linebreaks for TeX processing.
% {, <, #, %, $, ' and ": go to next line.
% _, }, ^, &, >, - and ~: stay at end of broken line.
% Use of \textquotesingle for straight quote.
\newcommand*\Wrappedbreaksatspecials {%
\def\PYGZus{\discretionary{\char`\_}{\Wrappedafterbreak}{\char`\_}}%
\def\PYGZob{\discretionary{}{\Wrappedafterbreak\char`\{}{\char`\{}}%
\def\PYGZcb{\discretionary{\char`\}}{\Wrappedafterbreak}{\char`\}}}%
\def\PYGZca{\discretionary{\char`\^}{\Wrappedafterbreak}{\char`\^}}%
\def\PYGZam{\discretionary{\char`\&}{\Wrappedafterbreak}{\char`\&}}%
\def\PYGZlt{\discretionary{}{\Wrappedafterbreak\char`\<}{\char`\<}}%
\def\PYGZgt{\discretionary{\char`\>}{\Wrappedafterbreak}{\char`\>}}%
\def\PYGZsh{\discretionary{}{\Wrappedafterbreak\char`\#}{\char`\#}}%
\def\PYGZpc{\discretionary{}{\Wrappedafterbreak\char`\%}{\char`\%}}%
\def\PYGZdl{\discretionary{}{\Wrappedafterbreak\char`\$}{\char`\$}}%
\def\PYGZhy{\discretionary{\char`\-}{\Wrappedafterbreak}{\char`\-}}%
\def\PYGZsq{\discretionary{}{\Wrappedafterbreak\textquotesingle}{\textquotesingle}}%
\def\PYGZdq{\discretionary{}{\Wrappedafterbreak\char`\"}{\char`\"}}%
\def\PYGZti{\discretionary{\char`\~}{\Wrappedafterbreak}{\char`\~}}%
}
% Some characters . , ; ? ! / are not pygmentized.
% This macro makes them "active" and they will insert potential linebreaks
\newcommand*\Wrappedbreaksatpunct {%
\lccode`\~`\.\lowercase{\def~}{\discretionary{\hbox{\char`\.}}{\Wrappedafterbreak}{\hbox{\char`\.}}}%
\lccode`\~`\,\lowercase{\def~}{\discretionary{\hbox{\char`\,}}{\Wrappedafterbreak}{\hbox{\char`\,}}}%
\lccode`\~`\;\lowercase{\def~}{\discretionary{\hbox{\char`\;}}{\Wrappedafterbreak}{\hbox{\char`\;}}}%
\lccode`\~`\:\lowercase{\def~}{\discretionary{\hbox{\char`\:}}{\Wrappedafterbreak}{\hbox{\char`\:}}}%
\lccode`\~`\?\lowercase{\def~}{\discretionary{\hbox{\char`\?}}{\Wrappedafterbreak}{\hbox{\char`\?}}}%
\lccode`\~`\!\lowercase{\def~}{\discretionary{\hbox{\char`\!}}{\Wrappedafterbreak}{\hbox{\char`\!}}}%
\lccode`\~`\/\lowercase{\def~}{\discretionary{\hbox{\char`\/}}{\Wrappedafterbreak}{\hbox{\char`\/}}}%
\catcode`\.\active
\catcode`\,\active
\catcode`\;\active
\catcode`\:\active
\catcode`\?\active
\catcode`\!\active
\catcode`\/\active
\lccode`\~`\~
}
\makeatother
\let\OriginalVerbatim=\Verbatim
\makeatletter
\renewcommand{\Verbatim}[1][1]{%
%\parskip\z@skip
\sbox\Wrappedcontinuationbox {\Wrappedcontinuationsymbol}%
\sbox\Wrappedvisiblespacebox {\FV@SetupFont\Wrappedvisiblespace}%
\def\FancyVerbFormatLine ##1{\hsize\linewidth
\vtop{\raggedright\hyphenpenalty\z@\exhyphenpenalty\z@
\doublehyphendemerits\z@\finalhyphendemerits\z@
\strut ##1\strut}%
}%
% If the linebreak is at a space, the latter will be displayed as visible
% space at end of first line, and a continuation symbol starts next line.
% Stretch/shrink are however usually zero for typewriter font.
\def\FV@Space {%
\nobreak\hskip\z@ plus\fontdimen3\font minus\fontdimen4\font
\discretionary{\copy\Wrappedvisiblespacebox}{\Wrappedafterbreak}
{\kern\fontdimen2\font}%
}%
% Allow breaks at special characters using \PYG... macros.
\Wrappedbreaksatspecials
% Breaks at punctuation characters . , ; ? ! and / need catcode=\active
\OriginalVerbatim[#1,codes*=\Wrappedbreaksatpunct]%
}
\makeatother
% Exact colors from NB
\definecolor{incolor}{HTML}{303F9F}
\definecolor{outcolor}{HTML}{D84315}
\definecolor{cellborder}{HTML}{CFCFCF}
\definecolor{cellbackground}{HTML}{F7F7F7}
% prompt
\makeatletter
\newcommand{\boxspacing}{\kern\kvtcb@left@rule\kern\kvtcb@boxsep}
\makeatother
\newcommand{\prompt}[4]{
{\ttfamily\llap{{\color{#2}[#3]:\hspace{3pt}#4}}\vspace{-\baselineskip}}
}
% Prevent overflowing lines due to hard-to-break entities
\sloppy
% Setup hyperref package
\hypersetup{
breaklinks=true, % so long urls are correctly broken across lines
bookmarksnumbered=true,
pdfauthor=Bj\"orn Kasper,
pdftitle=Introducing a procedure to perform the Analytic Hierarchy Process with own survey data obtained from \emph{SoSci Survey} platform using R-package \emph{ahpsurvey},
colorlinks=true,
urlcolor=urlcolor,
linkcolor=linkcolor,
citecolor=citecolor,
pdfpagemode={UseOutlines},
pdfview = {XYZ},
pdfstartview = {XYZ},
pdfstartpage = {1},
pdfborder={0 0 0}
}
% Slightly bigger margins than the latex defaults
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
\begin{document}
% Without changing the numbering style,
% page numbers and column titles should be turned off.
\pagestyle{empty}
\maketitle\thispagestyle{empty}
\begin{center}
\includegraphics[width=0.9\textwidth]{images/Cover_image.pdf}
\end{center}
\vfill
\begin{abstract}
Anyone who wants to seriously deal with the emerging topic of our time ``Artificial Intelligence (AI)'' cannot avoid dealing with the basic mathematical models and algorithms from the field of ``Machine Learning (ML)'' as a subset of AI. However, someone who opens the door for the first time to this equally very exciting as well as arbitrarily complex and, at first glance, confusing world will very quickly be overwhelmed. Here, it is a good idea to consult introductory and systematic tutorials. Therefore, this Getting Started tutorial systematically demonstrates the typical ML work process step-by-step using the very powerful and performant ``Support Vector Classifier (SVC)'' and the widely known and exceptionally beginner-friendly ``Iris Dataset''. Furthermore, the selection of the ``correct'' SVC kernel and its parameters are described and their effects on the classification result are shown.
\end{abstract}
\vfill\noindent
\begin{center}
\begin{tabular}{>{\centering}m{0.2\textwidth}m{0.65\textwidth}}
\begin{minipage}{\linewidth}
\includegraphics{images/CC_BY-SA_40.png}
\end{minipage}
&
\begin{minipage}{\linewidth}
This work is licensed under a \href{https://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0)}.
\end{minipage}
\end{tabular}
\end{center}
\newpage
% Activate own page style
\pagestyle{fancy}
% Delete all fields
\fancyhf{}
% \fancyhead[EL,OL]{$header$}
% \fancyfoot[EL,OL]{$footer$}
% Header leftside: chapter/section
\fancyhead[ER,OR]{\leftmark}
% Footer rightside: page number
\fancyfoot[ER,OR]{Seite \thepage}
\renewcommand{\sectionmark}[1]{
\markboth{\thesection{} #1}{}
}
\tableofcontents
\hypertarget{introduction}{%
\section{Introduction}\label{introduction}}
The \textbf{Analytic Hierarchy Process (AHP)} is a common and now widely
used method to decide on an alternative based on several different
criteria (see \cite{Wikipedia_AHP}). Often the weighting of the
respective criteria is done by a small number of decision makers or even
a single decision maker. The AHP is then relatively easy to implement,
both organizationally and technically.
Much less often, the weighting of criteria used for decision-making is
done by a variety of different stakeholders. However, especially for
decision-making with high social relevance, the involvement of many
stakeholders is very important. At this point, the following questions
arise:
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
How do I collect the data?
\item
Which software or tool can perform an AHP with data from the survey of
a large number of stakeholders?
\item
How can data collection and processing be combined in a way that is
both organizationally and technically sensible and time-effective?
\end{enumerate}
As part of the DFG-funded project ``Edible Cities'', the objective was
to evaluate different forms of urban agriculture using AHP with regard
to their sustainability. The prerequisite for this was the involvement
of numerous stakeholders from various target groups in the weighting of
the previously selected criteria and sub-criteria. The pairwise
comparisons of criteria and sub-criteria required for weighting should
be performed by means of an online survey, which should ideally be
followed directly by the AHP calculation automatically. Since the
stakeholders interviewed here were predominantly people from the
non-scientific environment, the survey had to be structured to suit
these target groups.
To the authors' knowledge, the only online tool available for conducting
a survey in combination with a directly subsequent criteria weighting is
``AHP-OS'' from \href{https://bpmsg.com}{BPMSG (Business Performance
Management Singapore)}.
Reflecting the above requirements, especially with regard to the target
groups, ``AHP-OS'' appeared unsuitable, however, as it is too strongly
designed to generate consistent datasets. For this purpose, participants
are asked to reconsider their decisions several times, if necessary, and
to adjust them in the direction of consistency. This very scientific
approach would not have been appropriate for the intended target groups.
Therefore, the authors followed the approach of separating the
stakeholder survey and the subsequent weighting of the criteria in
organizational and technical terms.
This paper introduces, for the first time, a procedure in which data
collected using the online survey platform
\href{https://www.soscisurvey.de}{SoSci Survey} are subsequently
processed with the \texttt{ahpsurvey} package (see
\cite{Vignettes_ahpsurvey_2019}). This package is exclusively available
for the statistical programming language \textbf{R} and, to the authors'
knowledge, is the only tool that meets the requirements outlined in the
previous sections.
\begin{verbatim}
@TODO:
The following remains to be revised and adjusted.
\end{verbatim}
Why we use a
\href{https://en.wikipedia.org/wiki/Project_Jupyter}{Jupyter} notebook
to to publish the R program examples:
Jupyter is a new \textbf{open source} alternative to the proprietary
numerical software
\href{https://en.wikipedia.org/wiki/Wolfram_Mathematica}{Mathematica}
from \textbf{Wolfram Research} that is well on the way to become a
\textbf{standard for exchanging research results}
(\cite{Scientific_Paper_obsolete_2018};
\cite{Future_of_Research_Paper_2018}).
Originally Jupyter was intended as an IDE for the programming languages
\textbf{Julia} and \textbf{Python}. Besides that it is also possible to
install other interpreter kernels, such as the
\textbf{\href{https://irkernel.github.io/installation/}{IRkernel}} for
\textbf{R}. This can be interesting if the IDE \textbf{RStudio Desktop}
is not available on the target platform used. For example, it is very
difficult to install RStudio on the ARM-based embedded computer
\textbf{Raspberry Pi} due to many technical dependencies. In contrast,
using the R kernel in JupyterLab on the Raspberry Pi works very well and
performant.
\hypertarget{loading-of-used-r-packages-and-definition-of-global-functions}{%
\section{Loading of used R packages and definition of global
functions}\label{loading-of-used-r-packages-and-definition-of-global-functions}}
\hypertarget{install-missing-packages-if-not-present-yet}{%
\subsection{Install missing packages if not present
yet}\label{install-missing-packages-if-not-present-yet}}
In order to load the R packages used in the next sections, they must be
installed in the R environment. The following function checks for the
presence of the packages and installs the missing ones.
\textbf{Attention:} For some R packages, several dependencies have to be
installed first using the package manager of the operating system,
e.g.~\texttt{apt\ install\ \textless{}package\ name\textgreater{}}.
In general, the use of R version \(\geq\) 4.0 is strongly recommended.
In particular, the \texttt{ahpsurvey} package, which is essential for
calculating the AHP, depends on the \texttt{randomNames} package.
However, this is only available starting with R version \(\geq\) 4.0
(refer to
\href{https://cran.r-project.org/web/packages/randomNames/index.html}{randomNames:
Generate Random Given and Surnames}).
This can be problematic especially with slightly older systems, e.g.~on
the operating system \textbf{Raspbian buster} for the very well-known
\textbf{Raspberry Pi}, R is only available in version 3.5.2. Upgrading R
in Raspbian following the instructions on
\url{https://cran.rstudio.com/bin/linux/debian/\#debian-buster-stable}
has not succeeded for the authors so far.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{1}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{c+c1}{\PYZsh{} List of R packages that are used in this script}
\PY{n}{list.of.packages}\PY{+w}{ }\PY{o}{\PYZlt{}\PYZhy{}}\PY{+w}{ }\PY{n+nf}{c}\PY{p}{(}\PY{l+s}{\PYZdq{}}\PY{l+s}{data.table\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{ggplot2\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{tidyr\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{dplyr\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{magrittr\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{ahpsurvey\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{knitr\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{IRdisplay\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{forcats\PYZdq{}}\PY{p}{)}
\PY{c+c1}{\PYZsh{} Query the already installed packages and save the missing ones in a new list}
\PY{n}{missing.packages}\PY{+w}{ }\PY{o}{\PYZlt{}\PYZhy{}}\PY{+w}{ }\PY{n}{list.of.packages}\PY{p}{[}\PY{o}{!}\PY{p}{(}\PY{n}{list.of.packages}\PY{+w}{ }
\PY{+w}{ }\PY{o}{\PYZpc{}in\PYZpc{}}\PY{+w}{ }\PY{n+nf}{installed.packages}\PY{p}{(}\PY{p}{)}\PY{p}{[}\PY{p}{,}\PY{l+s}{\PYZdq{}}\PY{l+s}{Package\PYZdq{}}\PY{p}{]}\PY{p}{)}\PY{p}{]}
\PY{c+c1}{\PYZsh{} Install missing packages}
\PY{n+nf}{if}\PY{p}{(}\PY{n+nf}{length}\PY{p}{(}\PY{n}{missing.packages}\PY{p}{)}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}}
\PY{+w}{ }\PY{n+nf}{install.packages}\PY{p}{(}\PY{n}{missing.packages}\PY{p}{)}
\PY{p}{\PYZcb{}}\PY{+w}{ }\PY{n}{else}\PY{+w}{ }\PY{p}{\PYZob{}}
\PY{+w}{ }\PY{n+nf}{print}\PY{p}{(}\PY{l+s}{\PYZdq{}}\PY{l+s}{All required packages are installed.\PYZdq{}}\PY{p}{)}
\PY{p}{\PYZcb{}}
\end{Verbatim}
\end{tcolorbox}
\begin{Verbatim}[commandchars=\\\{\}]
[1] "All required packages are installed."
\end{Verbatim}
\hypertarget{load-r-packages}{%
\subsection{Load R packages}\label{load-r-packages}}
After proving in the previous section that all required R packages are
installed, they can be loaded in the following subsections.
\hypertarget{load-package-data.table}{%
\subsubsection{\texorpdfstring{Load package
\texttt{data.table}}{Load package data.table}}\label{load-package-data.table}}
The \texttt{data.table} package is used for \textbf{reading and editing
tables}.
\textbf{Note:} This package inherits from \texttt{data.frame}.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{2}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n+nf}{library}\PY{p}{(}\PY{n}{data.table}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{load-package-ggplot2}{%
\subsubsection{\texorpdfstring{Load package
\texttt{ggplot2}}{Load package ggplot2}}\label{load-package-ggplot2}}
The package \texttt{ggplot2} is used to \textbf{plot beautiful
diagrams}.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{3}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n+nf}{library}\PY{p}{(}\PY{n}{ggplot2}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{load-packages-knitr-and-irdisplay}{%
\subsubsection{\texorpdfstring{Load packages \texttt{knitr} and
\texttt{IRdisplay}}{Load packages knitr and IRdisplay}}\label{load-packages-knitr-and-irdisplay}}
The \texttt{kable()} function from the package \texttt{knitr} is used to
output dataframes as markdown tables.
The \texttt{display\_markdown()} function from the package
\texttt{IRdisplay} is used to \textbf{render markdown tables} in the
notebook as well as in the compiled PDF output.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{4}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n+nf}{library}\PY{p}{(}\PY{n}{knitr}\PY{p}{)}
\PY{n+nf}{library}\PY{p}{(}\PY{n}{IRdisplay}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{load-package-tidyr}{%
\subsubsection{\texorpdfstring{Load package
\texttt{tidyr}}{Load package tidyr}}\label{load-package-tidyr}}
The package \texttt{tidyr} is used to \textbf{reshape dataframes} and
provides functions like \texttt{gather()} or \texttt{spread()}. Some
examples for the application can be found here:
\href{https://uc-r.github.io/tidyr}{Reshaping your data with tidyr}.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{5}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n+nf}{library}\PY{p}{(}\PY{n}{tidyr}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{load-package-dplyr}{%
\subsubsection{\texorpdfstring{Load package
\texttt{dplyr}}{Load package dplyr}}\label{load-package-dplyr}}
The package \texttt{dplyr} is necessary to \textbf{manipulate
dataframes} using functions like \texttt{select()}, \texttt{mutate()}
and \texttt{left\_join()}.
\textbf{Hint:} Annoying messages on package loading regarding masked
functions can be suppressed by setting the parameter
\texttt{warn.conflicts=FALSE} when calling the \texttt{library()}
function.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{6}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n+nf}{library}\PY{p}{(}\PY{n}{dplyr}\PY{p}{,}\PY{+w}{ }\PY{n}{warn.conflicts}\PY{o}{=}\PY{k+kc}{FALSE}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{load-package-magrittr}{%
\subsubsection{\texorpdfstring{Load package
\texttt{magrittr}}{Load package magrittr}}\label{load-package-magrittr}}
The package \texttt{magrittr} provides the \textbf{pipe functionality}
and can be used to create more effective code for processing large
datasets. What pipes of the form like \texttt{\%\textgreater{}\%} are
and how to use them is described here:
\href{https://statistik-dresden.de/archives/15679}{R-Programmierung: Was
ist \texttt{\%\textgreater{}\%}?}.
\textbf{HINT:} The pipe functionality is already available by loading
the library \texttt{tidyr} - so you don't have to load it explicitly.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{7}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n+nf}{library}\PY{p}{(}\PY{n}{magrittr}\PY{p}{,}\PY{+w}{ }\PY{n}{warn.conflicts}\PY{o}{=}\PY{k+kc}{FALSE}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{load-package-forcats}{%
\subsubsection{\texorpdfstring{Load package
\texttt{forcats}}{Load package forcats}}\label{load-package-forcats}}
The \texttt{fct\_inorder()} function from the package \texttt{forcats}
is used to \textbf{reorder the discrete levels of diagram axes}
according to the intended order of attributes.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{8}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n+nf}{library}\PY{p}{(}\PY{n}{forcats}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{load-package-ahpsurvey}{%
\subsubsection{\texorpdfstring{Load package
\texttt{ahpsurvey}}{Load package ahpsurvey}}\label{load-package-ahpsurvey}}
The package \texttt{ahpsurvey} contains all the necessary mathematical
and statistical methods to run the \textbf{analytical hierarchy process
(AHP)}.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{9}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n+nf}{library}\PY{p}{(}\PY{n}{ahpsurvey}\PY{p}{)}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{function-to-format-dataframes-as-markdown-tables}{%
\subsection{Function to format dataframes as markdown
tables}\label{function-to-format-dataframes-as-markdown-tables}}
Following function \textbf{formats given dataframes as markdown tables}
using the \texttt{kable()} function from the \texttt{knitr} package.
The \texttt{display\_markdown()} function from the package
\texttt{IRdisplay} is used to \textbf{render markdown tables} in the
notebook as well as in the compiled PDF output.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{10}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n}{func\PYZus{}render\PYZus{}md\PYZus{}tables}\PY{+w}{ }\PY{o}{\PYZlt{}\PYZhy{}}\PY{+w}{ }\PY{n+nf}{function}\PY{p}{(}\PY{n}{df\PYZus{}table}\PY{p}{,}\PY{+w}{ }\PY{n}{str\PYZus{}table\PYZus{}header}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}}
\PY{+w}{ }\PY{c+c1}{\PYZsh{} Format the dataframe as a markdown table using }
\PY{+w}{ }\PY{c+c1}{\PYZsh{} the \PYZsq{}kable()\PYZsq{} function from the \PYZsq{}knitr\PYZsq{} package.}
\PY{+w}{ }\PY{n}{table\PYZus{}out}\PY{+w}{ }\PY{o}{\PYZlt{}\PYZhy{}}\PY{+w}{ }\PY{n+nf}{kable}\PY{p}{(}
\PY{+w}{ }\PY{n}{df\PYZus{}table}\PY{p}{,}
\PY{+w}{ }\PY{n}{format}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{markdown\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{c+c1}{\PYZsh{} digits = 2,}
\PY{+w}{ }\PY{n}{caption}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{n}{str\PYZus{}table\PYZus{}header}\PY{p}{)}
\PY{+w}{ }\PY{c+c1}{\PYZsh{} print(table\PYZus{}out)}
\PY{+w}{ }\PY{n+nf}{display\PYZus{}markdown}\PY{p}{(}\PY{n+nf}{as.character}\PY{p}{(}\PY{n}{table\PYZus{}out}\PY{p}{)}\PY{p}{)}
\PY{p}{\PYZcb{}}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{prepare-raw-csv-input-data-from-sosci-survey-for-analytical-hierarchy-process-ahp}{%
\section{Prepare raw CSV input data from SoSci Survey for analytical
hierarchy process
(AHP)}\label{prepare-raw-csv-input-data-from-sosci-survey-for-analytical-hierarchy-process-ahp}}
The survey was conducted on the \href{https://www.soscisurvey.de/}{SoSci
Survey} platform and the results were exported as CSV files.
In this main section the CSV files are prepared in such a way that in
the following main section the AHP can be carried out using the R
package \texttt{ahpsurvey}.
\hypertarget{set-globally-used-input-and-output-folders-for-preparing-raw-csv-data}{%
\subsection{Set globally used input and output folders for preparing raw
CSV
data}\label{set-globally-used-input-and-output-folders-for-preparing-raw-csv-data}}
The following global variables are used to store the input and output
folders for CSV file preparation.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{11}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n}{str\PYZus{}input\PYZus{}path\PYZus{}prep}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{./input\PYZus{}data\PYZus{}from\PYZus{}survey\PYZdq{}}
\PY{n}{str\PYZus{}output\PYZus{}path\PYZus{}prep}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{./output\PYZus{}data\PYZus{}manipulated\PYZdq{}}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{define-functions-to-prepare-the-survey-data-for-further-analysis}{%
\subsection{Define functions to prepare the survey data for further
analysis}\label{define-functions-to-prepare-the-survey-data-for-further-analysis}}
The following functions are used to read the survey data from the input
CSV files, to prepare the data structure for further analysis with the R
package \texttt{ahpsurvey} and to store the results in the output CSV
files.
\hypertarget{function-to-read-the-survey-data-from-csv-files-to-dataframe-objects}{%
\subsubsection{Function to read the survey data from CSV files to
dataframe
objects}\label{function-to-read-the-survey-data-from-csv-files-to-dataframe-objects}}
This function reads a CSV file and stores the data in four different
dataframes by selecting different columns for each. The four dataframes
contain the \textbf{main criteria}, the \textbf{environmental}, the
\textbf{social}, or the \textbf{economic sub-criteria}.
\begin{tcolorbox}[breakable, size=fbox, boxrule=1pt, pad at break*=1mm,colback=cellbackground, colframe=cellborder]
\prompt{In}{incolor}{12}{\boxspacing}
\begin{Verbatim}[commandchars=\\\{\}]
\PY{n}{func\PYZus{}readCSVdata\PYZus{}to\PYZus{}dataframes}\PY{+w}{ }\PY{o}{\PYZlt{}\PYZhy{}}\PY{+w}{ }\PY{n+nf}{function}\PY{p}{(}\PY{n}{str\PYZus{}CSVfilename}\PY{p}{)}\PY{+w}{ }\PY{p}{\PYZob{}}
\PY{+w}{ }
\PY{+w}{ }\PY{c+c1}{\PYZsh{} Criteria (main criteria)}
\PY{+w}{ }\PY{n}{df\PYZus{}mySurvey\PYZus{}1}\PY{+w}{ }\PY{o}{\PYZlt{}\PYZhy{}}\PY{+w}{ }\PY{n+nf}{fread}\PY{p}{(}
\PY{+w}{ }\PY{n}{file}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{n}{str\PYZus{}CSVfilename}\PY{p}{,}\PY{+w}{ }\PY{n}{encoding}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{UTF\PYZhy{}8\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{n}{header}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{k+kc}{TRUE}\PY{p}{,}\PY{+w}{ }\PY{n}{sep}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{\PYZbs{}t\PYZdq{}}\PY{p}{,}\PY{+w}{ }\PY{n}{quote}\PY{+w}{ }\PY{o}{=}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{\PYZbs{}\PYZdq{}\PYZdq{}}\PY{p}{,}
\PY{+w}{ }\PY{c+c1}{\PYZsh{} dec = \PYZdq{}.\PYZdq{}, row.var = \PYZdq{}CASE\PYZdq{},}
\PY{+w}{ }\PY{n}{select}\PY{+w}{ }\PY{o}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+w}{ }\PY{n}{df\PYZus{}mySurvey\PYZus{}3}\PY{p}{,}\PY{+w}{ }\PY{n}{df\PYZus{}mySurvey\PYZus{}4}\PY{p}{)}
\PY{+w}{ }
\PY{+w}{ }\PY{n+nf}{return}\PY{p}{(}\PY{n}{output}\PY{p}{)}
\PY{p}{\PYZcb{}}
\end{Verbatim}
\end{tcolorbox}
\hypertarget{function-to-adapt-the-exported-survey-data-to-saaty-scale}{%
\subsubsection{Function to adapt the exported survey data to Saaty
scale}\label{function-to-adapt-the-exported-survey-data-to-saaty-scale}}
For the \textbf{comparison of two attributes}, Saaty introduced a scale
of nine rating items shown in the following table (see
\cite{Saaty_AHP_1987}):
\begin{longtable}[]{@{}rl@{}}
\caption{Nine rating items according to Saaty (adapted from source:
\cite{Vignettes_ahpsurvey_2019})}\tabularnewline
\toprule()
Rating & Definition \\
\midrule()
\endfirsthead
\toprule()
Rating & Definition \\
\midrule()
\endhead
1 & Two attributes are equally important \\
2 & Between 1 and 3 \\
3 & The preferred attribute is slightly more important \\
4 & Between 3 and 5 \\
5 & The preferred attribute is moderately more important \\
6 & Between 5 and 7 \\
7 & The preferred attribute is strongly more important \\
8 & Between 7 and 9 \\
9 & The preferred attribute is absolutely more important \\
\bottomrule()
\end{longtable}
To be able to describe the comparison of two attributes uniquely,
negative values as well as positive values are introduced for the rating
items. \textbf{Negative} values prefer the \(Attribute\;X\) and
\textbf{positive} values the \(Attribute\;Y\). A value of \textbf{\(1\)}
means that both attributes are \textbf{equally weighted}, i.e.~equally
important. Note that the values \(0\) and \(\text{-}1\) \textbf{do not}
exist. Thus, Saaty's 17-step scale will result as follows:
\[Attribute\;X\;\;\;\;\text{-}9\;\text{-}8\;\text{-}7\;\ldots\;\text{-}3\;\text{-}2\;\;\;\textbf{1}\;\;\;2\;3\;\ldots\;7\;8\;9\;\;\;\;Attribute\;Y\]
The package \texttt{ahpsurvey} employs the 17-step scale according to
Saaty (see \cite{Vignettes_ahpsurvey_2019}).
On the one hand, Saaty's 17-step scale was not technically well
implementable on the survey platform used
\href{https://www.soscisurvey.de/}{SoSci Survey}. On the other hand, it
had been too fine-granular for the mostly non-scientific target groups
of participants.
Therefore, a \textbf{2-stage query} was chosen as an alternative
approach. In \textbf{stage 1}, it was first asked whether, and if so,
which of the two attributes was preferred and thus given a higher
weighting. Stage 1 resulted in the following encoding:
\begin{itemize}
\tightlist
\item
\(\text{-}1\): \(Attribute\;X\) and \(Attribute\;Y\) \textbf{equally
important}
\item
\(\;1\): \(Attribute\;X\) \textbf{more important} than
\(Attribute\;Y\)
\item
\(\;2\): \(Attribute\;X\) \textbf{less important} than
\(Attribute\;Y\)
\end{itemize}
With different weightings, the respondents in \textbf{stage 2} had to
decide how much more important the respective attribute was to them on a
scale of 1 to 8. Thereby, 1 corresponds to 2, 2 to 3, etc. of the rating
items according to Saaty. See the following figure:
\begin{figure}
\centering
\includegraphics{images/Saaty_scale_to_SoSciSurvey.png}
\caption{Transformation from the Saaty's 17-step scale to the encoded
scale applied by a 2-stage query (source: Kasper, license: CC BY-SA
4.0)}
\end{figure}
The survey results were exported from \emph{SoSci Survey} in the form of
an \textbf{encoded scale} as a CSV file. With the following function
\texttt{func\_adaptData2SaatyScale} this now has to be converted back to
the Saaty scale in order to run AHP with the R package
\texttt{ahpsurvey}.
The values of the encoding and those of the weighting have to be taken
from the CSV file from three different columns per pairwise attribute
comparison. For example, when comparing the two attributes
``Microclimate and Hydrology (Clim)'' and ``Biodiversity (BDiv)'', the
column \texttt{AU01} contains the encoding and the columns
\texttt{RU01\_01} or \texttt{RU02\_01} the respective weighting.
The following example shows the three possible cases and the conversion
to the Saaty scale.
\textbf{Case 1:}
\begin{itemize}
\tightlist
\item
if \texttt{AU01} \(= \text{-}1\), then set weighting \(= 1\)
\item
attributes \texttt{Clim} and \texttt{BDiv} are equally important
\item
values in columns \texttt{RU01\_01} or \texttt{RU02\_01} are ignored
\end{itemize}
\textbf{Case 2:}