Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyh09 committed Sep 4, 2023
1 parent 2df87a2 commit 581d7d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
17 changes: 13 additions & 4 deletions docs/introR.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="BIOF1001 teaching team" />


<meta name="date" content="2023-09-01" />
<meta name="date" content="2023-09-04" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -352,6 +352,15 @@ <h1><span class="header-section-number">Chapter 1</span> Introduction to R progr
Introduction to R (1 hour teaching). You can get this Rmd file on Moodle or
<a href="https://github.com/StatBiomed/BMDatSci-book/blob/main/notebooks/chapter1-R/01-introR.Rmd">here</a>
(right-click and “save link as” to download).</p>
<p>R is a programming language, particularly popular for its power in statistical
computing, elegant graphics, and also genomic data analysis. It is a free and
open-source software, with active support and development from the community.
Additionally, R is relatively easy to get started for scientific computing.</p>
<blockquote>
<p><strong>Note</strong> To learn and practice R programming, you need to install <code>R</code> and <code>RStudio</code> on
your computer. You can follow the instructions for installation in the
<a href="https://statbiomed.github.io/BMDS-book/install.html">Appendix A</a> chapter.</p>
</blockquote>
<div id="data-types" class="section level2 hasAnchor" number="1.1">
<h2><span class="header-section-number">1.1</span> Data types<a href="introR.html#data-types" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>In R language setting (similar to some other programming languages), there are
Expand Down Expand Up @@ -704,7 +713,7 @@ <h3><span class="header-section-number">1.3.1</span> Read file<a href="introR.ht
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb24-1"><a href="introR.html#cb24-1" tabindex="-1"></a><span class="fu">help</span>(<span class="st">&quot;read.table&quot;</span>)</span>
<span id="cb24-2"><a href="introR.html#cb24-2" tabindex="-1"></a></span>
<span id="cb24-3"><a href="introR.html#cb24-3" tabindex="-1"></a>?read.table</span></code></pre></div>
<p>Here, let read an example file. Data is available on Moodle and on the
<p>Here, let’s read an example file. Data is available on Moodle and on the
<a href="https://github.com/StatBiomed/BMDatSci-book/blob/main/notebooks/chapter1-R">github repository</a></p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb25-1"><a href="introR.html#cb25-1" tabindex="-1"></a>df <span class="ot">=</span> <span class="fu">read.table</span>(<span class="st">&quot;./SRP029880.colData.tsv&quot;</span>, <span class="at">sep=</span><span class="st">&quot;</span><span class="sc">\t</span><span class="st">&quot;</span>)</span>
<span id="cb25-2"><a href="introR.html#cb25-2" tabindex="-1"></a>df</span>
Expand Down Expand Up @@ -991,8 +1000,8 @@ <h3><span class="header-section-number">1.6.5</span> Regression<a href="introR.h
<span id="cb47-21"><a href="introR.html#cb47-21" tabindex="-1"></a><span class="co">#&gt; Residual standard error: 0.3145 on 146 degrees of freedom</span></span>
<span id="cb47-22"><a href="introR.html#cb47-22" tabindex="-1"></a><span class="co">#&gt; Multiple R-squared: 0.8586, Adjusted R-squared: 0.8557 </span></span>
<span id="cb47-23"><a href="introR.html#cb47-23" tabindex="-1"></a><span class="co">#&gt; F-statistic: 295.5 on 3 and 146 DF, p-value: &lt; 2.2e-16</span></span></code></pre></div>
<p>This means the fitted regression is:
<code>Sepal.Length ~ 1.856 + 0.65*Sepal.Width + 0.709*Petal.Length - 0.556*Petal.Width</code></p>
<p>This means the fitted regression is:</p>
<p><code>Sepal.Length ~ 1.856 + 0.65*Sepal.Width + 0.709*Petal.Length - 0.556*Petal.Width</code></p>
<p>We can check how good the regression is by plotting it out</p>
<div class="sourceCode" id="cb48"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb48-1"><a href="introR.html#cb48-1" tabindex="-1"></a>y_pred <span class="ot">&lt;-</span> fit<span class="sc">$</span>coefficients[<span class="dv">1</span>] <span class="sc">+</span> </span>
<span id="cb48-2"><a href="introR.html#cb48-2" tabindex="-1"></a> fit<span class="sc">$</span>coefficients[<span class="dv">2</span>] <span class="sc">*</span> iris<span class="sc">$</span>Sepal.Width <span class="sc">+</span></span>
Expand Down
17 changes: 10 additions & 7 deletions docs/preface.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="BIOF1001 teaching team" />


<meta name="date" content="2023-09-01" />
<meta name="date" content="2023-09-04" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -359,18 +359,18 @@ <h2>Introduction for readers<a href="preface.html#introduction-for-readers" clas
<div id="what-you-will-learn-from-this-coursebook" class="section level3 unnumbered hasAnchor">
<h3>What you will learn from this course/book<a href="preface.html#what-you-will-learn-from-this-coursebook" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>In part I, you will find a general introduction to data science (by Dr YH Huang):</p>
<ol style="list-style-type: decimal">
<ol start="2" style="list-style-type: decimal">
<li>Basic programming and visualisation skills: R scripts for the quantitative
methods and data visualisation.</li>
<li>Quantitative methods: t-test, correlation analysis, clustering, linear
regression, linear classification.</li>
<li>Basic programming and visualisation skills: R scripts for the above methods
and data visualisation.</li>
<li>Gain familiarity with common databases in the biomedical domain.</li>
<li>Introduce ethical, legal, social and technological issues related to
biomedical data sciences.</li>
<li>Introduce good practice in managing a data science project and communicate
results to key stakeholders.</li>
</ol>
<p>In part II, you will experience data types in five different biomedical topics,
<p>In part II, you will experience data types in four different biomedical topics,
which will be illustrated with both introduction and cases that are suitable for
problem-based learning format:</p>
<ol style="list-style-type: decimal">
Expand All @@ -392,15 +392,18 @@ <h3>What we recommend you do while reading this book<a href="preface.html#what-w
</div>
<div id="other-reference-books" class="section level2 unnumbered hasAnchor">
<h2>Other reference books<a href="preface.html#other-reference-books" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>Besides this online book as a collection of R materials for the teaching contents, we also recommend the following online books as reference:</p>
<p>Besides this online book as a collection of R materials for the teaching
contents, we also recommend the following online books as reference:</p>
<ol style="list-style-type: decimal">
<li><a href="http://rafalab.dfci.harvard.edu/dsbook-part-1/">Introduction to Data Science: Data Wrangling and Visualization with R</a> by Rafeal A. Irizarry</li>
<li><a href="http://rafalab.dfci.harvard.edu/dsbook-part-2/">Advanced Data Science: Statistics and Prediction Algorithms Through Case Studies</a> by Rafeal A. Irizarry</li>
</ol>
</div>
<div id="acknowledgements" class="section level2 unnumbered hasAnchor">
<h2>Acknowledgements<a href="preface.html#acknowledgements" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>We thank all teachers contributing to this course from all years, including Dr Lequan Yu (2022-23) and Dr Carlos Wong (2022-23) and student helpers serving as demonstrators, including Mr Mingze Gao and Ms Fangxin Cai.</p>
<p>We thank all teachers contributing to this course across all years, including
Dr Lequan Yu (2022-23) and Dr Carlos Wong (2022-23) and student helpers serving
as demonstrators, including Mr Mingze Gao and Ms Fangxin Cai.</p>
<!-- ## Last notes {-} -->
<!-- # About the authors {-} -->
<!-- The authors are the teaching team for the BIOF1001 course (ordered by teaching -->
Expand Down

0 comments on commit 581d7d6

Please sign in to comment.