Verkefnið skiptist í tvo hluta, annars vegar úr tölfræði, efni um gagnlíkur sem þið finnið á Canvas [Námsefni / Fyrirlestur 2 / lesefni]. Hins vegar tengist verkefnið hagnýtri framsetningu gagna, sér í lagi grunnatriði í umbreytingumarkinu Markdown.
A study published in Lancet (Stewart et al., 2021) on eating habits in the United Kingdom revealed that, in 2016-17, 62% of participants reported consuming fish, and 72% reported consuming red meat in the last four days before the survey.
The odds of an event occurring is defined as the ratio of the probability that the event will occur to the probability that it will not occur. If p is the probability of an event occurring, then the odds O are given by:
\[ O = \frac{p}{1-p} \]
Using the formula for odds:
\[ \text{Odds of consuming fish} = \frac{P\_fish}{Q\_fish} = \frac{0.62}{0.38} \approx 1.63 \]
Interpretation: The odds of consuming fish are approximately 1.63. This indicates that for every participant who did not consume fish, about 1.63 participants did consume fish.
Using the formula for odds:
\[ \text{Odds of consuming red meat} = \frac{P\_meat}{Q\_meat} = \frac{0.72}{0.28} \approx 2.57 \]
Interpretation: The odds of consuming red meat are approximately 2.57. This suggests that for every participant who did not consume red meat, about 2.57 participants did consume red meat.
The odds ratio (OR) is a measure of association between two probabilities. It compares the odds of two events:
\[ \text{Odds Ratio} = \frac{\text{Odds of Fish Consumption}}{\text{Odds of Red Meat Consumption}} \]
Substitute the values:
\[ \text{OR} = \frac{1.63}{2.57} \approx 0.63 \]
Interpretation: The odds ratio of 0.63 < 1 indicates that the odds of consuming fish are 0.63 times the odds of consuming red meat. This suggests that participants were less likely to consume fish compared to red meat in the 4 days before the survey.
Heimild: Statistical Methods for the Social Sciences (2023) by Alan Agresti, 6th edition, Pearson.
## consumption odds
## 1 Fish 1.631579
## 2 Red Meat 2.571429
The analysis shows that the odds of consuming red meat (2.57) are higher than the odds of consuming fish (1.63) among participants in the study. The calculated odds ratio of 0.63 indicates that participants were less likely to consume fish compared to red meat in the four days preceding the survey.
The bar plot visually reinforces this finding by displaying the relative heights of the bars corresponding to fish and red meat consumption, with the bar for red meat being higher, indicating greater odds.
To lighten the topic, here’s a funny illustration depicting the dilemma of choosing between fish and red meat:
Í þessum lið verkefnisins ætlum við að læra algengustu skipanir í Markdown. Markdown er ekki forritunarmál, heldur svokallað umbrotsmál, notað til að sníða og setja fram texta á læsilegan hátt. Á vefnum Markdown Tutorial erum við leidd í gegnum átta síður af stuttum æfingu, þar sem við kynnumst öllum helstu táknum og aðferðum Markdown við umbrot texta. Smellið einfaldlega á tengilinn hér að ofan og vinnið ykkur gegnum æfingarnar. Skilið þessum verkhluta frá ykkur á því formi sem lýst er hér í viðauka.
I have successfully completed the Markdown Tutorial and learned various Markdown skills. Throughout this tutorial, I explored key concepts such as:
Thanks to the knowledge gained from lectures, the tutorial website, and the book, along with a lot of practice, I was able to write Part 1 of this assignment in R Studio. It was a lot of fun learning these new skills, and the step-by-step approach made the process accessible and not overwhelming. Even someone like me, who has no prior knowledge of programming, can learn effectively.
Here’s a demonstration of some Markdown code I learned:
Markdown code:
# Example of Markdown Formatting
## Header Level 2
- _Italicized Text_
- **Bold Text**
- _**Bold and Italicized Text**_
### Links and Images
- [Visit Google](https://www.google.com)
- 
> This is a blockquote example.
1. Ordered list item
2. Another item
- Nested unordered item
3. Final item
This is a blockquote example.
The Markdown tutorial was an insightful journey, providing me with basic and useful skills in Markdown. I found the exercises engaging and practical, reinforcing the learning objectives. Using Markdown for writing this assignment in R Studio was a great way to apply what I’ve learned, making the text formatting intuitive and the overall document visually appealing.
The complete script from the Markdown tutorial, including all exercises and examples, is attached in PDF format for reference.