100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
Biostatistics 2 €9,39
In winkelwagen

College aantekeningen

Biostatistics 2

 5 keer bekeken  0 keer verkocht

A complete description of all the lectures with examples and written program in R studio of Biostatistics 2, with some of the exercises.

Voorbeeld 4 van de 54  pagina's

  • 23 januari 2024
  • 54
  • 2021/2022
  • College aantekeningen
  • Ido pen
  • Alle colleges
Alle documenten voor dit vak (1)
avatar-seller
lisannevandervijgh
Biostatistics 2 2022 Lecture 1 Feb 7 2022

Chechk residuals

Nominal data -> no order in data (aka no factors in R)
e.g. sex

Ordinal data -> ordered but diffs between values important
e.g. hotel rating

interval data -> ordered, zero point arbitrary
differences make sense but ratios do not
e.g. temperature in degrees

ratio -> ordered, natural zero point
e.g. height

discrete -> can only take certain values, e.g. dead/alive, species, number of cells
continuous -> can take any value (within certain range), e.g. weight speed, concentration

Discrete data -> use a bar plot, with frequencies and relative frequencies (added all frequencies must
be 1)
Continuous data -> make different categories and use a histogram with the different ranges next to
each other. Bin/class width means the size of the group ranges.

Population -> e.g. all students at RUG, whole population
Sample -> e.g. 200 randomly selected students at RUG, a part of the population

Population size N, sample size n




population mean -> sum of all the values divided by N
sample mean -> sum of the sample of the population divided by n, this is the estimate for the
population mean. If the sample size is large enough it comes pretty close to the population mean

mode -> most frequently occurring value (or class)
median -> central value when data are ranked (n+1)/2. First rank the values, when there are even
numbers take the two central numbers and divide them by 2

The median is less sensitive to outliers than the (arithmetic) mean. Because the mean is influenced
by a long tail, then the mean is not useful.

,0.5 quantile or 50th percentile = Q2 or median
q quantile or 100qth percentile: a proportion q of data has smaller value
0.7 quantile or 70th percentile: 0.7 (70%) of data has smaller value

Measures of variation, small variation -> small deviation from the mean. Large variation -> large
deviation from the mean.




Unit of the variance is kg^2
Unit of the standard deviation
Coefficient of variation has no unit, unitless. You can compare this value easily between different
studies, because you can compare studies with different units, because the coefficient of variation
has no unit.

Range -> highest minus lowest values
Inter-quartile range (IQR) = Q3-Q1




Box is the middle part of the plot, the inter-quartile range. The whiskers indicate the lower quartile
and the upper quartile, except when there are numbers that are more than 1.5 box away from the
median (indicated with stars). These are outliers far away from the median.

Discrete probability distributions
- Random variable Y can only take discrete values (i.e. integers, in practice usually larger or
equal to 0)
- Each possible value k of Y has a probability Pr(Y=k)
- The probabilities of all possible values sum to 1

,Uniform distribution
- All possible values of Y equally likely
- Throw of a coin for example

Binomial distribution
- Nr of “successes” in n independent “Bernoulli” trials each with same probability of success p
- Has two parameters
- Expected number of successes is n*p
- Variance is n*p(1-n)

Poisson distribution
- Non-negative counts: nr of “random” events per fixed amount of time or space
- E.g. number of trees struck by lightning per acre of forest
- Single parameter

Goodness of fit tests
Test whether our data is reasonable
See how well observed frequencies match expected frequencies
How well do our observed data fit to a hypothetical (discrete) probability distribution?
 Hypothesis testing

Test procedure
1. Formulate H0 and Ha
2. Choose test
3. Calculate test statistic and compare value to its probability distribution
4. Determine P-value associated with value of test statistic or one more extreme (given H0 true)
5. Reject H0 if P< α ; retain H0 otherwise
P-value: probability of observed data (or more extreme result) given H0 is true

Chi-square GOF test
- If observed similar to expected, X^2 small
- If observed very different from expected, X^2 large
- If H0 true, X^2 approximately follows X^2 distribution for K-1 degrees of freedom, but most
of the time K-2 degrees of freedom
- Look up p-value in X^2 tables for K-1 d.f.
- Reject H0 if p<0.05; otherwise retain H0
- Important requirements; raw counts, not percentages
- No more than 20% expected counts < 5, and none < 1
- Fisher’s exact test for 2x2 tables
- Otherwise combine (pool) categories
R gives exact p-values
Chisq.test(c(189,91), p=c(3/4, ¼)

Continuous probability distributions
- Random variable Y take continuous real values
- Y has a probability density, probability that the value is between an interval
- The probability densities integrate to 1

, Uniform distribution
- All outcomes equally likely (between limits)

Normal distribution
- Standard normal distribution, mean of 0 and variance of 1
- For any normal distribution, there is a 95% probability that a random draw from that
distribution is within 2 standard deviations from the mean. Within 1 standard deviation from
the mean is about 69% and 3 standard deviation is about 99%
- Test whether a sample is drawn from a normal distribution
- Use Q-Q plots
y <- rnorm(n=100,mean=0,sd=1) #100 normal random numbers
hist(y) #histogram
qqnorm(y) #draw QQ plot without line
qqline(y) # add line
If the points are sufficiently close to the line, the assumption that the data is from a normal
distribution is reasonable.

Chi-squared distribution
y <- rchisq(n=100, df=1) #100 chisq random numbers
hist(y) #histogram
qqnorm(y, pch=16,main=””) #draw QQ plot without line
qqline(y) # add line

t-distribution
y <- rt(n=100,mean=0,df=2) #100 t random numbers
hist(y) #histogram
qqnorm(y) #draw QQ plot without line
qqline(y) # add line
- Has further tails

Test for normality: Shapiro- Wilk
y <- rnorm(n=100, mean=0, sd=1) #100 normal random numbers
shapiro.test(y)
Big p-value means that the H0, that the data is drawn from a normal distribution, should not be
rejected.

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

Verzekerd van kwaliteit door reviews

Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper lisannevandervijgh. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €9,39. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 52510 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€9,39
  • (0)
In winkelwagen
Toegevoegd