Rédigé par des étudiants ayant réussi Disponible immédiatement après paiement Lire en ligne ou en PDF Mauvais document ? Échangez-le gratuitement 4,6 TrustPilot
logo-home
Document preview thumbnail
Aperçu 2 sur 5 pages
Resume

Samenvatting R-code - Statistiek en data analyse (J000497A)

Document preview thumbnail
Aperçu 2 sur 5 pages

Dit document geeft een overzicht van alle R-codes die gebruikt werden in de werkcolleges en als voorbeeld dienden in het boek. Zeer handig voor het open-boek examen!

Aperçu du contenu

STATISTIEK: R-CODES
1. INLEIDING: Wat is medische statistiek?
2. STUDIEDESIGN: Wat maakt een empirische studie kwalitatief?
3. DATA-VISUALISATIE: Hoe gegevens visualiseren?
- Staafdiagram maken:
Ggplot(vanhouw5, aes(x=sexe)) + geom_bar() + labs(x=”geslacht”, y=”aantal”)
 Bindwith instellen (geom_bar(bindwith = 20))

- Histogram maken:
Ggplot(vanhouw5, aes(x=OPP) + geom_histogram(aes(y=..density..)) +
geom_density(aes(y=..density..)) + labs(x=”oppervlakte lever”, y=”dichtheid”)

- Twee figuren samen in 1 grafisch venster plaatsen (bv 2 kolommen en 1 rij)
Grid.arrange(p1,p2,ncol=2,nrow=1)

- Spreidingsdiagram:
Index <- seq(1,154)
Datnmm <- mutate(datnmm, index)
Datnmm1 <- datnmm[trt==1,]
Ggplot(datnmm1, aes(x=index,y=dbp3,ymin=80,ymax=120)) + geom_point() +
labs(x=”index”,y=”Diast bloeddruk 3 (begin)”)

- Dotplot:
Ggplot(vanhouw5, aes(x=sexe,y=OPP)) + geom_histogram(bindwidth=30) + facet_grid(sexe ~ .)
+ labs(x=”oppervlakte lever”, y=”aantal”)

- Boxplot/box-en-whisker plot:
ggplot(vanhouw5,aes(x=sexe,y=OPP)) + geom_boxplot() + labs(x=”geslacht”,y=”oppervlakte
lever”)

OF voor outliers:
Ggplot(vanhouw5,aes(x=sexe,y=OPP)) + geom_boxplot(outlier.shape=NA) +
geom_point(position=”jitter”) + labs(x=”geslacht”,y=”oppervlakte lever”)

- Profielplot: (nog eens op pag. 150)
Crossover0 <- subset(crossover, crossover$FIRSTTTRT==0)
Crossover0$individu <- 1:3
Crossover.wide <- data.frame(crossover0[c(“ TIME1”,”TIME2”,”individu”)])
Head(crossover.wide)
Crossover.long <- melt(crossover.wide, id.vars=c(“individu”))
Head(crossover.long)
Ggplot(crossover.long,aes(x=variable,y=value,group=individu

, - Puntenwolk + niet-parametrische regressielijn:
Ggplot(subset(datnmm,trt==1),aes(y=dbpdif,x=compjb,xmin=0,xmax=1.25,ymin=-
45,ymax=25)) + geom_point()
+ geom_smooth(aes(x=compjb,y=dbpdif),method=’loess’,formula=y~x)
+ labs(x=”% ingenomen pillen”,y=”wijziging diast bloeddruk”) + ggtitle(“arm 1)



4. DATA-ANALYSE: Hoe een behandelingseffect kwantificeren?
- Kans berekenen P:
Pnorm(x,mu,sd)

- QQ-plot:
X <- rnorm(1000)
Ggplot(data.frame(x),aes(sample=x)) + geom_qq() + geom_qq_line()

- Puntenwolk + lineaire regressive:
Ggplot(prothrombin, aes(x=DOSIS,y=TIJD)) + geom_point()
+ geom_smooth(aes(x=DOSIS,y=TIJD), method=’lm’,formula=y~x)
+ labs(x=”dosis”,y=”prohtrombine tijd”)

- Kruistabel opstellen:
Data <- matrix(c(3,14,17,12,,15),ncol=3,byrow=TRUE)
Rownames(data) <- c(“Controle”, “Test”)
Colnames(data) <- c(“Succes”,”Failing”,”Totaal”)
Tabel <- as.table(data)
Tabel

5. DATA-ANALYSE: Hoe nauwkeurig is een data-analyse?
- Betrouwbaarheidsintervallen: stel voor 95% en 25 observaties
Y <- rnorm(25,7,2)
Mean(y)
Sd(y)
Mean(y) – qt(0.975,df=24)*sd(y)/5
Mean(y) + qt(0.975,df=24)*sd(y)/5

- 100 keer het betrouwbaarheidsinterval herhalen: zie pagina 127

6. DATA-ANALYSE: Hoe beslissen of een behandeling effectief is?
- Boxplot maken met op de x-as een variabele:
Library(speff2$trial)
ACTG175$treat <- as.factor(ACTG175$treat)
Ggplot(ACTG175,aes(x=treat,y=cd420)) + geom_boxplot() + labs(x=”Behandelingsarm”,y=”CD4
T cel telling na 20 weken”)

Infos sur le Document

Publié le
8 avril 2026
Nombre de pages
5
Écrit en
2023/2024
Type
Resume
€4,36

Mauvais document ? Échangez-le gratuitement Dans les 14 jours suivant votre achat et avant le téléchargement, vous pouvez choisir un autre document. Vous pouvez simplement dépenser le montant à nouveau.
Rédigé par des étudiants ayant réussi
Disponible immédiatement après paiement
Lire en ligne ou en PDF

Vendu
4
Abonnés
3
Éléments
10
Dernière vente
3 jours de cela




Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions