Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 21 pages
Summary

Practical 2: Advanced Data Analysis: full summary + explanations

Document preview thumbnail
Preview 1 out of 21 pages

A detailed description of each step of practical 2, including screenshots and explanations of the steps taken in R. This document includes everything that is seen in class, and all the exercises that are needed to be made for practical 2 of Advanced Data Analysis of the first master of Biomedical Sciences. Only includes practical 2. Does not include the take home assignment.

Content preview

Practical 2 : Statistical analysis is R
Before you start :
- Create a folder / directory on your PC where you put all files related to this practical
- Turn this folder into your working directory

setwd ( "C:/wherever your files are")



1. Demo : the independent sample t-test

Data in long format : ozoneLong.txt
Read in the dataset ozoneLong.txt. This small dataset contains measurements of ozone (O3) in
two gardens, labelled A and B.




White format: concentrations in the gardens in two separate columns: no paired data. Independent
observations.

In the long format, there is the same data but arranged differently: one column which tells you which
garden and one column which gives the value of the ozone.

Here we want to know if there is a difference in ozone concentrations between the 2 gardens. The
null hypothesis is there is no difference in ozone between the gardens.

- Parametric tests: e.g. T-test
o Only allowed if you have enough observations and the data has +- a normal
distribution
- If the conditions for parametric testing are not fulfilled, you do Mann-Withney U test

Use the formula interface: t.test(continuantVar~groupingVar,data=myData)

Comes back quite often: this is usually the first argument of some function about a statistical test.
Generally it is y~x with y being the dependent variable (in t.test= continuous variable, here ozone),
and x that defines the groups (which group an observation comes from). The third argument is the
data frame.

First explore the data :
- How are the data organized? Check the environment in RStudio, or the str() function.
What do the two variables mean?
- Generate a plot to visualize the ozone concentration in the two gardens

Plot(myData$garden,myData$ozone)
Gives automatically a boxplot.
Looks like the ozone concentrations are higher in garden B than in garden A.




1

Document information

Study
Uploaded on
March 19, 2022
Number of pages
21
Written in
2021/2022
Type
Summary
$7.12

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Bi0med
4.2
(61)
Sold
566
Followers
201
Items
90
Last sold
1 month ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions