<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/data-science-for-doctors-part-3-distributions/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://r-exercises.com/2017/02/13/data-science-for-doctors-part-3-distributions/?utm_source=rss&utm_medium=rss&utm_campaign=data-science-for-doctors-part-3-distributions"> R-exercises</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a target="_blank" rel="nofollow" href="http://r-exercises.com/wp-content/uploads/2017/01/Selection_047.png?x61433"><img sizes="(max-width: 300px) 100vw, 300px" alt="" class="wp-image-4312" src="https://i0.wp.com/r-exercises.com/wp-content/uploads/2017/01/Selection_047-300x147.png?resize=300%2C147" data-recalc-dims="1"></a>Data science enhances people’s decision making. Doctors and researchers are making critical decisions every day. Therefore, it is absolutely necessary for those people to have some basic knowledge of data science. This series aims to help people that are around medical field to enhance their data science skills.</p>
<p>This is the third part of the series, it will contain the main distributions that you will use most of the time. This part is created in order to make sure that you have (or will have after solving this set of exercises) the knowledge for the next parts to come. The distributions that we will see are:</p>
<p>1)<a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Binomial_distribution">Binomial Distribution</a>: The binomial distribution fits to repeated trials each with a dichotomous outcome such as success-failure, healthy-disease, heads-tails.</p>
<p>2)<a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Normal_distribution">Normal Distribution</a>: It is the most famous distribution, it is also assumed for many gene expression values.</p>
<p>3)<a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Student%27s_t-distribution">T-Distribution</a>: The T-distribution has many useful applications for testing hypotheses when the sample size is lower than thirty.</p>
<p>4)<a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Chi-squared_distribution">Chi-squared Distribution</a>: The chi-squared distribution plays an important role in testing hypotheses about frequencies.</p>
<p>5)<a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/F-distribution">F-Distribution</a>: The F-distribution is important for testing the equality of two variances. </p>
<p>Before proceeding, it might be helpful to look over the help pages for the <code> choose</code>, <code>dbinom</code>, <code>pbinom</code> , <code>rbinom</code>, <code>qbinom</code>,<code>pnorm</code>, <code>qnorm</code>, <code>rnorm</code>, <code>dnorm</code>,<code>pchisq</code>, <code>qchisq</code>, <code>dchisq</code>, <code>df</code>, <code>pf</code>, <code>df</code>.</p>
<p>Answers to the exercises are available <a target="_blank" rel="nofollow" href="http://r-exercises.com/2017/02/13/data-science-for-doctors-part-3-distributions-solutions">here</a>.</p>
<p>If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page.</p>
<p><strong>Exercise 1</strong></p>
<p>Let X be binomially distributed with n = 100 and p = 0.3.Compute the following:<br>
a) P(X = 34), P(X ≥ 34), and P(X ≤ 34)<br>
b) P(30 ≤ X ≤ 60)<br>
c) The quantiles x<sub>0.025</sub>, and x<sub>0.975</sub></p>
<p><strong>Exercise 2</strong></p>
<p>Let X be normally distributed with mean = 3 and standard deviation = 1.Compute the following:<br>
a) P(X 2),P(2 ≤ X ≤ 4)<br>
b) The quantiles x<sub>0.025</sub>, x<sub>0.5</sub>and x<sub>0.975</sub>.</p>
<p><strong>Exercise 3</strong></p>
<p>Let T<sub>8</sub> distribution.Compute the following:<br>
a)P(T<sub>8</sub> &lt; 1), P(T<sub>8</sub> > 2), P(-1 &lt; T<sub>8</sub> &lt; 1).<br>
b)The quantiles t<sub>0.025</sub>, t<sub>0.5</sub>, and t<sub>0.975</sub>. Can you justify the values of the quantiles?</p>
<p><strong>Exercise 4</strong></p>
<p>Compute the following for the chi-squared distribution with 5 degrees of freedom:<br>
a) P(X<sup>2</sup><sub>5</sub>&lt;2), P(X<sup>2</sup><sub>5</sub>>4),P(4&lt;X<sup>2</sup><sub>5</sub>&lt;6).<br>
b) The quantiles g<sub>0.025</sub>, g<sub>0.5</sub>, and g<sub>0.975</sub>.</p>
<p><strong>Exercise 5</strong></p>
<p>Compute the following for the F<sub>6,3</sub> distribution:<br>
a)P(F<sub>6,3</sub> &lt; 2), P(F<sub>6,3</sub> > 3), P(1 &lt; F<sub>6,3</sub> &lt; 4).<br>
b)The quantiles f<sub>0.025</sub>, f<sub>0.5</sub>, and f<sub>0.975</sub>.</p>
<p><strong>Exercise 6</strong></p>
<p>Generate 100 observations following binomial distribution and plot them(if possible at the same plot):<br>
a) n = 20, p = 0.3<br>
b) n = 20, p = 0.5<br>
c) n = 20, p = 0.7</p>
<p><strong>Exercise 7</strong></p>
<p>Generate 100 observations following normal distribution and plot them(if possible at the same plot):<br>
a) standard normal distribution ( N(0,1) )<br>
b) mean = 0, s = 3<br>
c) mean = 0, s = 7</p>
<p><strong>Exercise 8</strong></p>
<p>Generate 100 observations following T distribution and plot them(if possible at the same plot):<br>
a) df = 5<br>
b) df = 10<br>
c) df = 25</p>
<p><strong>Exercise 9</strong></p>
<p>Generate 100 observations following chi-squared distribution and plot them(if possible at the same plot):<br>
a) df = 5<br>
b) df = 10<br>
c) df = 25</p>
<p><strong>Exercise 10</strong></p>
<p>Generate 100 observations following F distribution and plot them(if possible at the same plot):<br>
a) df<sub>1</sub> = 3, df<sub>2</sub> = 9<br>
b) df<sub>1</sub> = 9, df<sub>2</sub> = 3<br>
c) df<sub>1</sub> = 15, df<sub>2</sub> = 15</p>
<div>
<h3>Related exercise sets:</h3>
<ol>
<li><a title="Data Science for Doctors – Part 1 : Data Display" target="_blank" rel="nofollow" href="http://r-exercises.com/2017/01/29/data-science-for-doctors-part-1-data-display/">Data Science for Doctors – Part 1 : Data Display </a></li>
<li><a title="Data Science for Doctors – Part 2 : Descriptive Statistics" target="_blank" rel="nofollow" href="http://r-exercises.com/2017/02/05/data-science-for-doctors-part-2-descriptive-statistics/">Data Science for Doctors – Part 2 : Descriptive Statistics </a></li>
<li><a title="Generating Data Exercises" target="_blank" rel="nofollow" href="http://r-exercises.com/2016/11/17/generating-data-exercises/">Generating Data Exercises </a></li>
<li><a target="_blank" rel="nofollow" href="http://r-exercises.com/start-here-to-learn-r/">Explore all our (>1000) R exercises</a></li>
<li><a target="_blank" rel="nofollow" href="http://r-exercises.com/r-courses/">Find an R course using our R Course Finder</a> directory</li>
</ol>
</div>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://r-exercises.com/2017/02/13/data-science-for-doctors-part-3-distributions/?utm_source=rss&utm_medium=rss&utm_campaign=data-science-for-doctors-part-3-distributions"> R-exercises</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/NxaHp1YzavQ"></a></div>