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
Summary

Samenvatting Script MOB schakelprogramma opleidings- en onderwijswetenschappen

Rating
-
Sold
2
Pages
9
Uploaded on
11-09-2024
Written in
2023/2024

Script ter aanvulling van samenvatting MOB, met behulp van beide samenvattingen behaalde ik 17/20

Institution
Course

Content preview

PDF-principe
#Packages laden
library(car)
library(moments)
#handmatige methode voor pakketten inladen => aanklikken
#R-bestand inladen
load(file.choose())
#handmatige methode R-bestand inladen => file → open file
#csv-bestand inladen
Naam <- read.csv2(file.choose())
#handmatige methode CSV-Data inladen => import Dataset → From tekst (base) → (settings ok?) → import
#Excell-bestand inladen
Import Dataset → From Excel → Browse → open → (settings aanpassen… Naam, character/numeric, NA…) → import
#Functies inladen
source(file.choose())
#handmatige methode functies inladen => file → open file → source



#dataset aanmaken
Variabele <- c(“A”, “B”, …)
Data <- data.frame(Variabele1, Variabele2,…)
#Dataset aanpassen naar enkel variabelen met Onderzoekersgegevens, zonder randinformatie
Data <- data.frame(Dataset$Variabele1, Dataset$Variabele2, …)
#aanmaken nieuwe variabele en toevoegen aan Dataframe volgnummers 1 tot 5000
Data$Variabele <- seq(1,500)

, #controleer dataset!!
str(Data)
summary(Data)
#herstructurering data
## STAP1 - Maak een dataset per filmpje
DataA <- data.frame(Data$Cluster, Data$Code, Data$Tijdsslot, Data$Variabele1A, Data$Variabele2A, …)
DataB <- data.frame(Data$Cluster, Data$Code, Data$Tijdsslot, Data$Variabele1B, Data$Variabele2B, …)
## STAP 2 - Geef de variabelen in beide datasets dezelfde namen
names(DataA) <- c("Cluster", "Code", "Tijdsslot", "Variabele1", "Variabele2", …)
names(DataB) <- c("Cluster", "Code", "Tijdsslot", "Variabele1", "Variabele2", …)
## STAP 3 - Voeg data van beide filmpjes samen (1 kolom/per observator)
Data_OV1 <- rbind(DataA, DataB)
## STAP 4 - Verwijder NA's (geen observatiemateriaal) uit de dataset
Data_OV1_Compleet <- Data_OV1[complete.cases(Data_OV1), ]
#juiste rijen en kolommen selecteren in dataset => voor komma rijen, na komma kolommen
Data_Nieuw <- Data[ (1:10) , (1:5) ]
#enkel kolommen en alle rijen
Data_Nieuw <- Data[ , (1:5) ]
#enkel rijen en alle kolommen
Data_Nieuw <- Data[ (1:10) , ]
#enkel kolommen selecteren met data variabelen => achter komma
ClusterA <- Data[ , c(2, 4, 6 )]
#enkel rijen selecteren van een bepaald tijdsslot => voor komma
#manier 1 (kan bij kleine dataset)
Tijdslot1 <- Data[ c(1:3), ]
#manier 2
Tijdslot_1_2 <- Data[which(Data$Variabele == “t1” | Data$Variabele == “t2”), ]
#Controle
table(Data$Tijdslot_1_2)
#specifieke kolommen verwijderen
Data_bewerkt <- Data[ , -c(1)]
#controleer of ze inderdaad uit dataset zijn
str(Data_bewerkt)
#EXTRA - hercoderen

Hercoderen naar factor /numeriek
is.factor(Data$Variabele) #true?
Data$VariabeleF <- as.factor(Data$Variabele)
Data$VariabeleN <- as.numeric(Data$Variabele)
#hercodeer je een (factor) variabele (en toevoegt aan het Databestand)
Data$Variabele.f <- recode(Data$Variabele, "1='Vlaanderen';2='Nederland'", as.factor = T)
#hercodeer je een variabele, maak je een ordening in de volgorde (bij factor)
Data$Variabele.f <- recode(Data$Variabele, "0:6='Goed'; 6:10='Zeer goed'", as.factor=T)
#Na hercoderen nakijken of juist gehercodeerd is!!!
table(Data$Variabele,Data$Variabele.f)
#Nakijken ordening (en aanpassen)
levels(Data$Variabele.f)
Data$Variabele.fo <- factor(Data$Variabele.f, ordered = T, levels = c('Goed','Zeer goed'))

Written for

Institution
Study
Course

Document information

Uploaded on
September 11, 2024
Number of pages
9
Written in
2023/2024
Type
SUMMARY

Subjects

$7.83
Get access to the full document:

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


Also available in package deal

Get to know the seller

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.
StudentUantwerpenOOW Universiteit Antwerpen
Follow You need to be logged in order to follow users or courses
Sold
127
Member since
1 year
Number of followers
2
Documents
20
Last sold
1 month ago

4.4

14 reviews

5
11
4
1
3
0
2
0
1
2

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