100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Samenvatting volledig script voor statistiek A $8.81   Add to cart

Summary

Samenvatting volledig script voor statistiek A

 3 views  0 purchase
  • Course
  • Institution

Met dit script behaalde ik 19/20 op het examen (samen met samenvatting leerstof)

Preview 2 out of 8  pages

  • September 11, 2024
  • 8
  • 2023/2024
  • Summary
avatar-seller
PDF-principe

#Packages laden

library(car)

library(moments)

#R-bestand inladen

load(file.choose())

#csv-bestand inladen

Naam <- read.csv2(file.choose())

#Functies inladen

source(file.choose())

#handmatige methode voor pakketten inladen => aanklikken

#handmatige methode R-bestand inladen => file → open file

#handmatige methode CSV-Data inladen => import Dataset → From tekst (base) → (settings ok?) → import

#handmatige methode functies inladen => file → open file → source


Data aanmaken

#Vector + variabele maken

Naam <- c("Amy", "Marlies", "Adinda")

#aanmaken nieuwe variabele en toevoegen aan Dataframe volgnummers 1 tot 5000

Data$Variabele <- seq(1,500)

#Variabele uit Dataframe selecteren

Data$Variabele

#bestaande Dataframe bewerken

fix(Data)

#Dataframe maken van losse vectoren

Data <- Data.frame(Variabele, ID, Leeftijd, Voornaam, Werkstudent, Namen)

#Herhalingen maken van gegevens bv. 1,1,1,2,2? Met opmerkingen [CD1]: Samenvatting p15

Naam <- c(rep(1,3),rep(2,2))

OF Naam <- rep(c(1,2),c(3,2))

#reeks cijfers

Naam <- rep(1:10)

#Reeks opeenvolgende cijfers maken bv. 1,2,3,4,5 in stappen van 0.5

seq(1,5,0.5) seq( a,b,c) met a = beginwaarde, b = eindwaarde, c = eventuele stapgrootte

#Deel van Databestand nemen

Data(1:10,c(9,15,16)) rij 1 tot en met 10 kolom 9, 15, 16

, #Kenmerken bekijken (levels, class) checken of factor geordend is

attributes( )

Factor versus numeriek

#checken of de variabele een factor/numeriek is

is.factor(Data$Variabele)

is.numeric(Data$Variabele)

#wijziging variabele in factor

Data$Variabele.f <- as.factor(Data$Variabele)

#wijziging variabele in numerieke

Data$Variabele.f <- as.numeric(Data$Variabele)




Hercoderen

#voor hercoderen: al juist?

table(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) Met opmerkingen [CD2]: " 'A'='hoog' ; 'B'='laag' "

#hercodeer je een variabele, maak je een ordening in de volgorde (bij factor) Met opmerkingen [CD3R2]: " T='waar' ; F = 'niet waar' "
Met opmerkingen [CD4R2]: " lo:6 = '0' ; 6:hi = '1' "
Data$Variabele.f <- recode(Data$Variabele, "0:6='Goed'; 6:10='Zeer goed'", as.factor=T)
Met opmerkingen [CD5]: Element 0 tot 6 noemen we
#Na hercoderen nakijken of juist gehercodeerd is!!! goed
Met opmerkingen [CD6R5]: Ondergrens zit er niet bij,
table(Data$Variabele,Data$Variabele.f) bovengrens wel

is.factor(Data$Variabele) #true?

#Nakijken ordening (en aanpassen)

levels(Data$Variabele.f)

Data$Variabele.fo <- factor(Data$Variabele.f, ordered = T, levels = c('Goed','Zeer goed')) Met opmerkingen [CD7]: Hier volgorde plaatsen die je
wilt


VERSCHILLENDE SOORTEN VOORSTELLINGEN
#absolute frequentie opvragen

table(Data$Variabele)

#Relatieve frequentie opvragen en omzetten in procent

prop.table(table(Data$Variabele))*100

#Frequentietabel opvragen

freqtabel(Data$Variabele)

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller StudentUantwerpenOOW. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $8.81. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75619 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$8.81
  • (0)
  Add to cart