-
Notifications
You must be signed in to change notification settings - Fork 256
/
examples.html
1238 lines (1148 loc) · 54.2 KB
/
examples.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="author" content="Andrew Gelman, Jennifer Hill, Aki Vehtari" />
<title>Regression and Other Stories - Examples</title>
<script src="site_libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/readable.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="site_libs/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<link href="site_libs/highlightjs-9.12.0/default.css" rel="stylesheet" />
<script src="site_libs/highlightjs-9.12.0/highlight.js"></script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">code{white-space: pre;}</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}
</script>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
details > summary > p:only-child {
display: inline;
}
pre code {
padding: 0;
}
</style>
<style type="text/css">
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #adb5bd;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
border-radius: 6px 0 6px 6px;
}
</style>
<script type="text/javascript">
// manage active state of menu based on current page
$(document).ready(function () {
// active menu anchor
href = window.location.pathname
href = href.substr(href.lastIndexOf('/') + 1)
if (href === "")
href = "index.html";
var menuAnchor = $('a[href="' + href + '"]');
// mark it active
menuAnchor.tab('show');
// if it's got a parent navbar menu mark it active as well
menuAnchor.closest('li.dropdown').addClass('active');
// Navbar adjustments
var navHeight = $(".navbar").first().height() + 15;
var style = document.createElement('style');
var pt = "padding-top: " + navHeight + "px; ";
var mt = "margin-top: -" + navHeight + "px; ";
var css = "";
// offset scroll position for anchor links (for fixed navbar)
for (var i = 1; i <= 6; i++) {
css += ".section h" + i + "{ " + pt + mt + "}\n";
}
style.innerHTML = "body {" + pt + "padding-bottom: 40px; }\n" + css;
document.head.appendChild(style);
});
</script>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
@media print {
.toc-content {
/* see https://github.com/w3c/csswg-drafts/issues/4434 */
float: right;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
}
.tocify .list-group-item {
border-radius: 0px;
}
</style>
</head>
<body>
<div class="container-fluid main-container">
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-bs-toggle="collapse" data-target="#navbar" data-bs-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Regression and Other Stories</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">Book information</a>
</li>
<li>
<a href="examples.html">Examples</a>
</li>
<li>
<a href="errata.html">Errata</a>
</li>
<li>
<a href="R_visualization.html">R and visualization</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<div id="header">
<h1 class="title toc-ignore">Regression and Other Stories - Examples</h1>
<h4 class="author">Andrew Gelman, Jennifer Hill, Aki Vehtari</h4>
<h4 class="date">Page updated: 2022-02-24</h4>
</div>
<hr />
<div id="introduction" class="section level2">
<h2>Introduction</h2>
<ul>
<li>The code and data are provided to fully reproduce the examples and figures in the book. They can be a good way to see what the code does. Different people have different styles of code. The code here is not supposed to be a model. The statistical analyses and graphs in the book are intended to be models for good practice, but the code here is meant to be simple with minimal dependencies.</li>
<li><p>For R programming basics see Appendix A of Regression and Other Stories. If you want to learn more, see our recommendations for <a href="R_visualizaton.html">R programming and visualization with R</a>.</p></li>
<li>The folders below (ending /) point to the code (.R and .Rmd) and <code>data</code> folders (.csv or .txt) in github, and .html -files point to knitted notebooks.</li>
<li>Most examples have cleaned data in .csv file in <code>data</code> subfolder for easy experimenting. For completeness and reproducibility, the data subfolders have also the raw data and <code>*_setup.R</code> file showing how the data pre-processing has been done (to do the exercises and follow along with the examples, you don’t need to worry about the setup code).</li>
<li><p>For easy access to data sets, there is an R package <code>rosdata</code>. You can install it with a command <code>remotes::install_github("avehtari/ROS-Examples",subdir = "rpackage")</code>. Then you can access data, for example, as <code>library(rosdata)</code>, <code>data(wells)</code>, <code>head(wells)</code>. You can get the list of data sets with <code>?rosdata</code>.</p></li>
<li>When running the notebooks, to avoid need to switch the working directory, <code>rprojroot</code> package is used to set the project root directory. The downloaded git repository can be placed anywhere you like and you can rename the ROS-Examples directory if you wish. When running the code, it is sufficient that the working directory is any directory in the ROS-Examples (or renamed). Running</li>
</ul>
<pre><code>library("rprojroot")
root<-has_file(".ROS-Examples-root")$make_fix_file()</code></pre>
<p>will find the file <code>.ROS-Examples-root</code> which is in the <code>ROS-Examples</code> directory, and will set the full path according to that. Then, for example,</p>
<pre><code>wells <- read.csv(root("Arsenic/data","wells.csv"))</code></pre>
<p>finds the <code>wells.csv</code> file, no matter where you have placed or renamed the <code>ROS-Examples</code> directory. When you switch to another example, there is no need to switch the working directory.</p>
<hr />
</div>
<div id="examples-by-chapters" class="section level2">
<h2>Examples by chapters</h2>
<div id="introduction-1" class="section level3">
<h3>1 Introduction</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectionsEconomy/">ElectionsEconomy/</a>
<ul>
<li><a href="ElectionsEconomy/hibbs.html">hibbs.html</a> - Predicting presidential vote share from the economy</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectricCompany/">ElectricCompany/</a>
<ul>
<li><a href="ElectricCompany/electric.html">electric.html</a> - Analysis of “Electric company” data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Peacekeeping/">Peacekeeping/</a>
<ul>
<li><a href="Peacekeeping/peace.html">peace.html</a> - Outcomes after civil war in countries with and without United Nations peacekeeping</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/SimpleCausal/">SimpleCausal/</a>
<ul>
<li><a href="SimpleCausal/causal.html">causal.html</a> - Simple graphs illustrating regression for causal inference</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Helicopters/">Helicopters/</a>
<ul>
<li><a href="Helicopters/helicopters.html">helicopters.html</a> - Example data file for helicopter flying time exercise</li>
</ul></li>
</ul>
</div>
<div id="data-and-measurement" class="section level3">
<h3>2 Data and measurement</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/HDI/">HDI/</a>
<ul>
<li><a href="HDI/hdi.html">hdi.html</a> - Human Development Index - Looking at data in different ways</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Pew/">Pew/</a>
<ul>
<li><a href="Pew/pew.html">pew.html</a> - Miscellaneous analyses using raw Pew data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/HealthExpenditure/">HealthExpenditure/</a>
<ul>
<li><a href="HealthExpenditure/healthexpenditure.html">healthexpenditure.html</a> - Discovery through graphs of data and models</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Names/">Names/</a>
<ul>
<li><a href="Names/names.html">names.html</a> - Names - Distributions of names of American babies</li>
<li><a href="Names/lastletters.html">lastletters.html</a> - Last letters - Distributions of last letters of names of American babies</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/AgePeriodCohort/">AgePeriodCohort/</a>
<ul>
<li><a href="AgePeriodCohort/births.html">births.html</a> - Age adjustment</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Congress/">Congress/</a>
<ul>
<li><a href="Congress/congress_plots.html">congress_plots.html</a> - Predictive uncertainty for congressional elections</li>
</ul></li>
</ul>
</div>
<div id="some-basic-methods-in-mathematics-and-probability" class="section level3">
<h3>3 Some basic methods in mathematics and probability</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Mile/">Mile/</a>
<ul>
<li><a href="Mile/mile.html">mile.html</a> - Trend of record times in the mile run</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Metabolic/">Metabolic/</a>
<ul>
<li><a href="Metabolic/metabolic.html">metabolic.html</a> - How to interpret a power law or log-log regression</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Earnings/">Earnings/</a>
<ul>
<li><a href="Earnings/height_and_weight.html">height_and_weight.html</a> - Predict weight</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/CentralLimitTheorem/">CentralLimitTheorem/</a>
<ul>
<li><a href="CentralLimitTheorem/heightweight.html">heightweight.html</a> - Illustrate central limit theorem and normal distribution</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Stents/">Stents/</a>
<ul>
<li><a href="Stents/stents.html">stents.html</a> - Stents - comparing distributions</li>
</ul></li>
</ul>
</div>
<div id="generative-models-and-statistical-inference" class="section level3">
<h3>4 Generative models and statistical inference</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Coverage/">Coverage/</a>
<ul>
<li><a href="Coverage/coverage.html">coverage.html</a> - Example of coverage</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Death/">Death/</a>
<ul>
<li><a href="Death/polls.html">polls.html</a> - Proportion of American adults supporting the death penalty</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Coop/">Coop/</a>
<ul>
<li><a href="Coop/riverbay.html">riverbay.html</a> - Example of hypothesis testing</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Girls/">Girls/</a></li>
</ul>
</div>
<div id="simulation" class="section level3">
<h3>5 Simulation</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ProbabilitySimulation/">ProbabilitySimulation/</a>
<ul>
<li><a href="ProbabilitySimulation/probsim.html">probsim.html</a> - Simulation of probability models</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Earnings/">Earnings/</a>
<ul>
<li><a href="Earnings/earnings_bootstrap.html">earnings_bootstrap.html</a> - Bootstrapping to simulate the sampling distribution</li>
</ul></li>
</ul>
</div>
<div id="background-on-regression-modeling" class="section level3">
<h3>6 Background on regression modeling</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Simplest/">Simplest/</a>
<ul>
<li><a href="Simplest/simplest.html">simplest.html</a> - Linear regression with a single predictor</li>
<li><a href="Simplest/simplest_lm.html">simplest_lm.html</a> - Linear least squares regression with a single predictor</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Earnings/">Earnings/</a>
<ul>
<li><a href="Earnings/earnings_regression.html">earnings_regression.html</a> - Predict respondents’ yearly earnings using survey data from 1990.</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/PearsonLee/">PearsonLee/</a>
<ul>
<li><a href="PearsonLee/heights.html">heights.html</a> - The heredity of height. Published in 1903 by Karl Pearson and Alice Lee.</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/FakeMidtermFinal/">FakeMidtermFinal/</a>
<ul>
<li><a href="FakeMidtermFinal/simulation.html">simulation.html</a> - Fake dataset of 1000 students’ scores on a midterm and final exam</li>
</ul></li>
</ul>
</div>
<div id="linear-regression-with-a-single-predictor" class="section level3">
<h3>7 Linear regression with a single predictor</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectionsEconomy/">ElectionsEconomy/</a>
<ul>
<li><a href="ElectionsEconomy/hibbs.html">hibbs.html</a> - Predicting presidential vote share from the economy</li>
<li><a href="ElectionsEconomy/hills.html">hills.html</a> - Present uncertainty in parameter estimates</li>
<li><a href="ElectionsEconomy/hibbs_coverage.html">hibbs_coverage.html</a> - Checking the coverage of intervals</li>
<li><a href="Simplest/">Simplest/</a></li>
<li><a href="Simplest/simplest.html">simplest.html</a> - Linear regression with a single predictor</li>
<li><a href="Simplest/simplest_lm.html">simplest_lm.html</a> - Linear least squares regression with a single predictor</li>
</ul></li>
</ul>
</div>
<div id="fitting-regression-models" class="section level3">
<h3>8 Fitting regression models</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectionsEconomy/">ElectionsEconomy/</a>
<ul>
<li><a href="ElectionsEconomy/hibbs.html">hibbs.html</a> - Predicting presidential vote share from the economy</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Influence/">Influence/</a>
<ul>
<li><a href="Influence/influence.html">influence.html</a> - Influence of individual points in a fitted regression</li>
</ul></li>
</ul>
</div>
<div id="prediction-and-bayesian-inference" class="section level3">
<h3>9 Prediction and Bayesian inference</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectionsEconomy/">ElectionsEconomy/</a>
<ul>
<li><a href="ElectionsEconomy/hibbs.html">hibbs.html</a> - Predicting presidential vote share from the economy</li>
<li><a href="ElectionsEconomy/bayes.html">bayes.html</a> - Demonstration of Bayesian information aggregation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/SexRatio/">SexRatio/</a>
<ul>
<li><a href="SexRatio/sexratio.html">sexratio.html</a> - Example where an informative prior makes a difference</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Earnings/">Earnings/</a>
<ul>
<li><a href="Earnings/height_and_weight.html">height_and_weight.html</a> - Predict weight</li>
<li><a href="Earnings/earnings_regression.html">earnings_regression.html</a> - Predict respondents’ yearly earnings using survey data from 1990.</li>
</ul></li>
</ul>
</div>
<div id="linear-regression-with-multiple-predictors" class="section level3">
<h3>10 Linear regression with multiple predictors</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/KidIQ/">KidIQ/</a>
<ul>
<li><a href="KidIQ/kidiq.html">kidiq.html</a> - Linear regression with multiple predictors</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Earnings/">Earnings/</a>
<ul>
<li><a href="Earnings/height_and_weight.html">height_and_weight.html</a> - Predict weight</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Congress/">Congress/</a>
<ul>
<li><a href="Congress/congress.html">congress.html</a> - Predictive uncertainty for congressional elections</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/NES/">NES/</a>
<ul>
<li><a href="NES/nes_linear.html">nes_linear.html</a> - Fitting the same regression to many datasets</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Beauty/">Beauty/</a>
<ul>
<li><a href="Beauty/beauty.html">beauty.html</a> - Student evaluations of instructors’ beauty and teaching quality</li>
</ul></li>
</ul>
</div>
<div id="assumptions-diagnostics-and-model-evaluation" class="section level3">
<h3>11 Assumptions, diagnostics, and model evaluation</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/KidIQ/">KidIQ/</a>
<ul>
<li><a href="KidIQ/kidiq.html">kidiq.html</a> - Linear regression with multiple predictors</li>
<li><a href="KidIQ/kidiq_loo.html">kidiq_loo.html</a> - Linear regression and leave-one-out cross-validation</li>
<li><a href="KidIQ/kidiq_R2.html">kidiq_R2.html</a> - Linear regression and Bayes-R2 and LOO-R2</li>
<li><a href="KidIQ/kidiq_kcv.html">kidiq_kcv.html</a> - Linear regression and K-fold cross-validation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Residuals/">Residuals/</a>
<ul>
<li><a href="Residuals/residuals.html">residuals.html</a> - Plotting the data and fitted model</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Introclass/">Introclass/</a>
<ul>
<li><a href="Introclass/residual_plots.html">residual_plots.html</a> - Plot residuals vs. predicted values, or residuals vs. observed values?</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Newcomb/">Newcomb/</a>
<ul>
<li><a href="Newcomb/newcomb.html">newcomb.html</a> - Posterior predictive checking of Normal model for Newcomb’s speed of light data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Unemployment/">Unemployment/</a>
<ul>
<li><a href="Unemployment/unemployment.html">unemployment.html</a> - Time series fit and posterior predictive model checking for unemployment series</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Rsquared/">Rsquared/</a>
<ul>
<li><a href="Rsquared/rsquared.html">rsquared.html</a> - Bayesian R^2</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/CrossValidation/">CrossValidation/</a>
<ul>
<li><a href="CrossValidation/crossvalidation.html">crossvalidation.html</a> - Demonstration of cross validation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/FakeKCV/">FakeKCV/</a>
<ul>
<li><a href="FakeKCV/fake_kcv.html">fake_kcv.html</a> - Demonstration of <span class="math inline">\(K\)</span>-fold cross-validation using simulated data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Pyth/">Pyth/</a></li>
</ul>
</div>
<div id="transformations" class="section level3">
<h3>12 Transformations</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/KidIQ/">KidIQ/</a>
<ul>
<li><a href="KidIQ/kidiq.html">kidiq.html</a> - Linear regression with multiple predictors</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Earnings/">Earnings/</a>
<ul>
<li><a href="Earnings/earnings_regression.html">earnings_regression.html</a> - Predict respondents’ yearly earnings using survey data from 1990.</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Gay/">Gay/</a>
<ul>
<li><a href="Gay/gay_simple.html">gay_simple.html</a> - Simple models (linear and discretized age) and political attitudes as a function of age</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Mesquite/">Mesquite/</a>
<ul>
<li><a href="Mesquite/mesquite.html">mesquite.html</a> - Predicting the yields of mesquite bushes</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Student/">Student/</a>
<ul>
<li><a href="Student/student.html">student.html</a> - Models for regression coefficients</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Pollution/">Pollution/</a>
<ul>
<li><a href="Pollution/pollution.html">pollution.html</a> - Pollution data.</li>
</ul></li>
</ul>
</div>
<div id="logistic-regression" class="section level3">
<h3>13 Logistic regression</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/NES/">NES/</a>
<ul>
<li><a href="NES/nes_logistic.html">nes_logistic.html</a> - Logistic regression, identifiability, and separation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/LogisticPriors/">LogisticPriors/</a>
<ul>
<li><a href="LogisticPriors/logistic_priors.html">logistic_priors.html</a> - Effect of priors in logistic regression</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Arsenic/">Arsenic/</a>
<ul>
<li><a href="Arsenic/arsenic_logistic_building.html">arsenic_logistic_building.html</a> - Building a logistic regression model: wells in Bangladesh</li>
</ul></li>
</ul>
</div>
<div id="working-with-logistic-regression" class="section level3">
<h3>14 Working with logistic regression</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/LogitGraphs/">LogitGraphs/</a>
<ul>
<li><a href="LogitGraphs/logitgraphs.html">logitgraphs.html</a> - Different ways of displaying logistic regression</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/NES/">NES/</a>
<ul>
<li><a href="NES/nes_logistic.html">nes_logistic.html</a> - Logistic regression, identifiability, and separation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Rodents/">Rodents/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Arsenic/">Arsenic/</a>
<ul>
<li><a href="Arsenic/arsenic_logistic_residuals.html">arsenic_logistic_residuals.html</a> - Residual plots for a logistic regression model: wells in Bangladesh</li>
<li><a href="Arsenic/arsenic_logistic_apc.html">arsenic_logistic_apc.html</a> - Average predictice comparisons for a logistic regression model: wells in Bangladesh</li>
</ul></li>
</ul>
</div>
<div id="other-generalized-linear-models" class="section level3">
<h3>15 Other generalized linear models</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/PoissonExample/">PoissonExample/</a>
<ul>
<li><a href="PoissonExample/poisson_regression.html">PoissonExample.html</a> - Demonstrate Poisson regression with simulated data.</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Roaches/">Roaches/</a>
<ul>
<li><a href="Roaches/roaches.html">roaches.html</a> - Analyse the effect of integrated pest management on reducing cockroach levels in urban apartments</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Storable/">Storable/</a>
<ul>
<li><a href="Storable/storable.html">storable.html</a> - Ordered categorical data analysis with a study from experimental economics, on the topic of ``storable votes.’’</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Robit/">Robit/</a>
<ul>
<li><a href="Robit/robit.html">robit.html</a> - Comparison of robit and logit models for binary data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Earnings/">Earnings/</a>
<ul>
<li><a href="Earnings/earnings_compound.html">earnings_compound.html</a> - Compound discrete-continuos model</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/RiskyBehavior/">RiskyBehavior/</a>
<ul>
<li><a href="RiskyBehavior/risky.html">risky.html</a> Risky behavior data.</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/NES/">NES/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Lalonde/">Lalonde/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Congress/">Congress/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/AcademyAwards/">AcademyAwards/</a></li>
</ul>
</div>
<div id="design-and-sample-size-decisions" class="section level3">
<h3>16 Design and sample size decisions</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectricCompany/">ElectricCompany/</a>
<ul>
<li><a href="ElectricCompany/electric.html">electric.html</a> - Analysis of “Electric company” data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/SampleSize/">SampleSize/</a>
<ul>
<li><a href="DataCollection/simulation.html">simulation.html</a> - Sample size simulation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/FakeMidtermFinal/">FakeMidtermFinal/</a>
<ul>
<li><a href="FakeMidtermFinal/simulation_based_design.html">simulation_based_design.html</a> - Fake dataset of a randomized experiment on student grades</li>
</ul></li>
</ul>
</div>
<div id="poststratification-and-missing-data-imputation" class="section level3">
<h3>17 Poststratification and missing-data imputation</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Poststrat/">Poststrat/</a>
<ul>
<li><a href="Poststrat/poststrat.html">poststrat.html</a> - Poststratification after estimation</li>
<li><a href="Poststrat/poststrat2.html">poststrat2.html</a> - Poststratification after estimation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Imputation/">Imputation/</a>
<ul>
<li><a href="Imputation/imputation.html">imputation.html</a> - Regression-based imputation for the Social Indicators Survey</li>
<li><a href="Imputation/imputation_gg.html">imputation_gg.html</a> - Regression-based imputation for the Social Indicators Survey, dplyr/ggplot version</li>
</ul></li>
</ul>
</div>
<div id="causal-inference-basics-and-randomized-experiments" class="section level3">
<h3>18 Causal inference basics and randomized experiments</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Sesame/">Sesame/</a>
<ul>
<li><a href="Sesame/sesame.html">sesame.html</a> - Causal analysis of Sesame Street experiment</li>
</ul></li>
</ul>
</div>
<div id="causal-inference-using-regression-on-the-treatment-variable" class="section level3">
<h3>19 Causal inference using regression on the treatment variable</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectricCompany/">ElectricCompany/</a>
<ul>
<li><a href="ElectricCompany/electric.html">electric.html</a> - Analysis of “Electric company” data</li>
</ul></li>
<li><a href="(https://github.com/avehtari/ROS-Examples/tree/master/Incentives/)">Incentives/</a>
<ul>
<li><a href="Incentives/incentives.html">incentives.html</a> - Simple analysis of incentives data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Cows/">Cows/</a></li>
</ul>
</div>
<div id="observational-studies-with-all-confounders-assumed-to-be-measured" class="section level3">
<h3>20 Observational studies with all confounders assumed to be measured</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectricCompany/">ElectricCompany/</a>
<ul>
<li><a href="ElectricCompany/electric.html">electric.html</a> - Analysis of “Electric company” data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Childcare/">Childcare/</a>
<ul>
<li><a href="Childcare/childcare.html">childcare.html</a> - Infant Health and Development Program (IHDP) example.</li>
</ul></li>
</ul>
</div>
<div id="more-advanced-topics-in-causal-inference" class="section level3">
<h3>21 More advanced topics in causal inference</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Sesame/">Sesame/</a>
<ul>
<li><a href="Sesame/sesame.html">sesame.html</a> - Causal analysis of Sesame Street experiment</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Pypass/">Bypass/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ChileSchools/">ChileSchools/</a>
<ul>
<li><a href="ChileSchools/chile_schools.html">chile_schools.html</a> - ChileSchools example.</li>
</ul></li>
</ul>
</div>
<div id="advanced-regression-and-multilevel-models" class="section level3">
<h3>22 Advanced regression and multilevel models</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Golf/">Golf/</a>
<ul>
<li><a href="Golf/golf.html">golf.html</a> - Gold putting accuracy: Fitting a nonlinear model using Stan</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Gay/">Gay/</a>
<ul>
<li><a href="Gay/gay.html">gay.html</a> - Nonlinear models (Loess, B-spline, GP-spline, and BART) and political attitudes as a function of age</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectionsEconomy/">ElectionsEconomy/</a>
<ul>
<li><a href="ElectionsEconomy/hibbs.html">hibbs.html</a> - Predicting presidential vote share from the economy</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Scalability/">Scalability/</a>
<ul>
<li><a href="Scalability/scalability.html">scalability.html</a> - Demonstrate computation speed with 100 000 observations.</li>
</ul></li>
</ul>
</div>
<div id="appendix-a" class="section level3">
<h3>Appendix A</h3>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Coins/">Coins/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Mile/">Mile/</a>
<ul>
<li><a href="Mile/mile.html">mile.html</a> - Trend of record times in the mile run</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Parabola/">Parabola/</a>
<ul>
<li><a href="Parabola/parabola.html">parabola.html</a> - Demonstration of using Stan for optimization</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Restaurant/">Restaurant/</a>
<ul>
<li><a href="Restaurant/restaurant.html">restaurant.html</a> - Demonstration of using Stan for optimization</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/DifferentSoftware/">DifferentSoftware/</a>
<ul>
<li><a href="DifferentSoftware/linear.html">linear.html</a> - Linear regression using different software options</li>
</ul></li>
</ul>
<hr />
</div>
</div>
<div id="examples-alphabetically" class="section level2">
<h2>Examples alphabetically</h2>
<ul>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/AcademyAwards/">AcademyAwards/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/AgePeriodCohort/">AgePeriodCohort/</a>
<ul>
<li><a href="AgePeriodCohort/births.html">births.html</a> - Age adjustment</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Arsenic/">Arsenic/</a>
<ul>
<li><a href="Arsenic/arsenic_logistic_building.html">arsenic_logistic_building.html</a> - Building a logistic regression model: wells in Bangladesh</li>
<li><a href="Arsenic/arsenic_logistic_residuals.html">arsenic_logistic_residuals.html</a> - Residual plots for a logistic regression model: wells in Bangladesh</li>
<li><a href="Arsenic/arsenic_logistic_apc.html">arsenic_logistic_apc.html</a> - Average predictice comparisons for a logistic regression model: wells in Bangladesh</li>
<li><a href="Arsenic/arsenic_logistic_building_optimizing.html">arsenic_logistic_building_optimizing.html</a> - Building a logistic regression model: wells in Bangladesh. A version with normal approximation at the mode.</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Balance/">Balance/</a>
<ul>
<li><a href="Balance/treatcontrol.html">treatcontrol.html</a></li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Beauty/">Beauty/</a>
<ul>
<li><a href="Beauty/beauty.html">beauty.html</a> - Student evaluations of instructors’ beauty and teaching quality</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Bypass/">Bypass/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/CausalDiagram/">CausalDiagram/</a>
<ul>
<li><a href="CausalDiagram/diagrams.html">diagrams.html</a> - Plot causal diagram</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/CentralLimitTheorem/">CentralLimitTheorem/</a>
<ul>
<li><a href="CentralLimitTheorem/heightweight.html">heightweight.html</a> - Illustrate central limit theorem and normal distribution</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Childcare/">Childcare/</a>
<ul>
<li><a href="Childcare/childcare.html">childcare.html</a> - Infant Health and Development Program (IHDP) example.</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ChileSchools/">ChileSchools/</a>
<ul>
<li><a href="ChileSchools/chile_schools.html">chile_schools.html</a> - ChileSchools example.</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Coins/">Coins/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Congress/">Congress/</a>
<ul>
<li><a href="Congress/congress.html">congress.html</a> - Predictive uncertainty for congressional elections</li>
<li><a href="Congress/congress_plots.html">congress_plots.html</a> - Predictive uncertainty for congressional elections</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Coop/">Coop/</a>
<ul>
<li><a href="Coop/riverbay.html">riverbay.html</a> - Example of hypothesis testing</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Coverage/">Coverage/</a>
<ul>
<li><a href="Coverage/coverage.html">coverage.html</a> - Example of coverage</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Cows/">Cows/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/CrossValidation/">CrossValidation/</a>
<ul>
<li><a href="CrossValidation/crossvalidation.html">crossvalidation.html</a> - Demonstration of cross validation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/SampleSize/">SampleSize/</a>
<ul>
<li><a href="DataCollection/simulation.html">simulation.html</a> - Sample size simulation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Death/">Death/</a>
<ul>
<li><a href="Death/polls.html">polls.html</a> - Proportion of American adults supporting the death penalty</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/DifferentSoftware/">DifferentSoftware/</a>
<ul>
<li><a href="DifferentSoftware/linear.html">linear.html</a> - Linear regression using different software options</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Earnings/">Earnings/</a>
<ul>
<li><a href="Earnings/earnings_regression.html">earnings_regression.html</a> - Predict respondents’ yearly earnings using survey data from 1990.</li>
<li><a href="Earnings/earnings_bootstrap.html">earnings_bootstrap.html</a> - Bootstrapping to simulate the sampling distribution</li>
<li><a href="Earnings/earnings_compound.html">earnings_compound.html</a> - Compound discrete-continuos model</li>
<li><a href="Earnings/height_and_weight.html">height_and_weight.html</a> - Predict weight</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectionsEconomy/">ElectionsEconomy/</a>
<ul>
<li><a href="ElectionsEconomy/bayes.html">bayes.html</a> - Demonstration of Bayesian information aggregation</li>
<li><a href="ElectionsEconomy/hibbs.html">hibbs.html</a> - Predicting presidential vote share from the economy</li>
<li><a href="ElectionsEconomy/hills.html">hills.html</a> - Present uncertainty in parameter estimates</li>
<li><a href="ElectionsEconomy/hibbs_coverage.html">hibbs_coverage.html</a> - Checking the model-fitting procedure using fake-data simulation.</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/ElectricCompany/">ElectricCompany/</a>
<ul>
<li><a href="ElectricCompany/electric.html">electric.html</a> - Analysis of “Electric company” data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/FakeKCV/">FakeKCV/</a>
<ul>
<li><a href="FakeKCV/fake_kcv.html">fake_kcv.html</a> - Demonstration of <span class="math inline">\(K\)</span>-fold cross-validation using simulated data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/FakeMidtermFinal/">FakeMidtermFinal/</a>
<ul>
<li><a href="FakeMidtermFinal/simulation.html">simulation.html</a> - Fake dataset of 1000 students’ scores on a midterm and final exam</li>
<li><a href="FakeMidtermFinal/simulation_based_design.html">simulation_based_design.html</a> - Fake dataset of a randomized experiment on student grades</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/FrenchElection/">FrenchElection/</a>
<ul>
<li><a href="FrenchElection/ps_primaire.html">ps_primaire.html</a> - French Election data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Gay/">Gay/</a>
<ul>
<li><a href="Gay/gay_simple.html">gay_simple.html</a> - Simple models (linear and discretized age) and political attitudes as a function of age</li>
<li><a href="Gay/gay.html">gay.html</a> - Nonlinear models (Loess, B-spline, GP-spline, and BART) and political attitudes as a function of age</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Girls/">Girls/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Golf/">Golf/</a>
<ul>
<li><a href="Golf/golf.html">golf.html</a> - Gold putting accuracy: Fitting a nonlinear model using Stan</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/HDI/">HDI/</a>
<ul>
<li><a href="HDI/hdi.html">hdi.html</a> - Human Development Index - Looking at data in different ways</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/HealthExpenditure/">HealthExpenditure/</a>
<ul>
<li><a href="HealthExpenditure/healthexpenditure.html">healthexpenditure.html</a> - Discovery through graphs of data and models</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Helicopters/">Helicopters/</a>
<ul>
<li><a href="Helicopters/helicopters.html">helicopters.html</a> - Example data file for helicopter flying time exercise</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Imputation/">Imputation/</a>
<ul>
<li><a href="Imputation/imputation.html">imputation.html</a> - Regression-based imputation for the Social Indicators Survey</li>
<li><a href="Imputation/imputation_gg.html">imputation_gg.html</a> - Regression-based imputation for the Social Indicators Survey, dplyr/ggplot version</li>
</ul></li>
<li><a href="(https://github.com/avehtari/ROS-Examples/tree/master/Incentives/)">Incentives/</a>
<ul>
<li><a href="Incentives/incentives.html">incentives.html</a> - Simple analysis of incentives data</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Influence/">Influence/</a>
<ul>
<li><a href="Influence/influence.html">influence.html</a> - Influence of individual points in a fitted regression</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Interactions/">Interactions/</a>
<ul>
<li><a href="Interactions/interactions.html">interactions.html</a> - Plot interaction example figure</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Introclass/">Introclass/</a>
<ul>
<li><a href="Introclass/residual_plots.html">residual_plots.html</a> - Plot residuals vs. predicted values, or residuals vs. observed values?</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/KidIQ/">KidIQ/</a>
<ul>
<li><a href="KidIQ/kidiq.html">kidiq.html</a> - Linear regression with multiple predictors</li>
<li><a href="KidIQ/kidiq_loo.html">kidiq_loo.html</a> - Linear regression and leave-one-out cross-validation</li>
<li><a href="KidIQ/kidiq_R2.html">kidiq_R2.html</a> - Linear regression and Bayes-R2 and LOO-R2</li>
<li><a href="KidIQ/kidiq_kcv.html">kidiq_kcv.html</a> - Linear regression and K-fold cross-validation</li>
</ul></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/Lalonde/">Lalonde/</a></li>
<li><a href="https://github.com/avehtari/ROS-Examples/tree/master/LogisticPriors/">LogisticPriors/</a>
<ul>
<li><a href="LogisticPriors/logistic_priors.html">logistic_priors.html</a> - Effect of priors in logistic regression</li>