-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
111 lines (98 loc) · 4.94 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Regression demonstration</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/frameworks/revealjs/css/reveal.min.css">
<link rel="stylesheet" href="C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/frameworks/revealjs/css/theme/default.css" id="theme">
<link rel="stylesheet" href="C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/highlighters/highlight.js/css/tomorrow.css" id="theme">
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]--> <link rel="stylesheet" href = "assets/css/ribbons.css">
</head>
<body>
<div class="reveal">
<div class="slides">
<section class='' data-state='' id='slide-1'>
<p>Regression demonstration</p>
</section>
<section class='' data-state='' id='slide-2'>
<h2>Outline</h2>
<ul>
<li>In this little project I wanted do demonstrate how can one manually fit the best linear regression line by changing its slope.</li>
<li>There are two main panels. A navigation panel, where you can customize the view of the plot and the main panel where the plot and a short summary are located.</li>
<li>Tick the <code>Documentation</code> box to see the detailed instructions on how to work with this application.</li>
</ul>
</section>
<section class='' data-state='' id='slide-3'>
<h2>Main panel</h2>
<ul>
<li>There is a plot on the main panel (the plot itself is on the next slide):</li>
</ul>
<pre><code class="r">library(ggplot2)
mpg <- mtcars$mpg - mean(mtcars$mpg)
disp <- mtcars$disp - mean(mtcars$disp)
l <- lm(mpg ~ disp)
d <- data.frame(mpg, disp)
g <- ggplot(d, aes(disp, mpg))
g <- g + geom_point(size = 3) + geom_abline(intercept = 0, slope = coef(l)[2],
col = 'red', size = 1)
g
</code></pre>
<ul>
<li>There is also a short summary which evaluates MSE based on the specified <code>beta</code>.</li>
</ul>
<pre><code class="r">mse <- mean((mpg - coef(l)[2] * disp)^2)
</code></pre>
</section>
<section class='' data-state='' id='slide-4'>
<h2>Main panel</h2>
<p><img src="assets/fig/unnamed-chunk-3-1.png" title="plot of chunk unnamed-chunk-3" alt="plot of chunk unnamed-chunk-3" style="display: block; margin: auto;" />
MSE of the fitted regression line is 9.911.</p>
</section>
<section class='' data-state='' id='slide-5'>
<h2>Navigation panel</h2>
<p>Here you can:</p>
<ul>
<li>Change the slope of the line using slider (this is the value which would substitute <code>coef(l)[2]</code> value in the code mentioned above).</li>
<li>Change the color of the line.</li>
<li>Set the title of the plot.</li>
<li>View documentation.</li>
</ul>
</section>
</div>
</div>
</body>
<script src="C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/frameworks/revealjs/lib/js/head.min.js"></script>
<script src="C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/frameworks/revealjs/js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme || 'default',
transition: Reveal.getQueryHash().transition || 'default',
dependencies: [
// Cross-browser shim that fully implements classList -
// https://github.com/eligrey/classList.js/
{ src: 'C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/frameworks/revealjs/lib/js/classList.js', condition: function() { return !document.body.classList;}},
// Zoom in and out with Alt+click
{ src: 'C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/frameworks/revealjs/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
// Speaker notes
{ src: 'C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/frameworks/revealjs/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
// Remote control your reveal.js presentation using a touch device
//{ src: 'C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/frameworks/revealjs/plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script> <!-- LOAD HIGHLIGHTER JS FILES -->
<script src="C:/Users/xelab_000/Documents/R/win-library/3.2/slidifyLibraries/libraries/highlighters/highlight.js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!-- DONE LOADING HIGHLIGHTER JS FILES -->
</html>