read.csv(“daten.csv”,header=TRUE,sep=”;”,stringsasfactors=FALSE)
Wie ließt man einen csv Datensatz in R ein
d0$id
In R bei dem Datensatz d0 auf die id Spalte zugreifen
d0[15,2]
In R bei d0 auf person in 15. Spalte und 2. Variable zugreifen
sum()
summe in R
length()
R länge des Datensatzes
mean()
R mittelwert
sd()
R Standertabweichung einer variable eines Datensatzes
var()
R Varianz einer Variable
cov(x,y)
R Kovarianz einer zweier variablen
cor(x,y)
R Korrelation nach pearson
median(x)
R median einer variable
quantile(x)
R quantile in 25% schritten
quantile (x,probs=seq(0,1,1/10))
R Dezile einer Variable in 10% schritten
IQR(x)
R Interquartilabstand
summary()
R Zusammenfassung von Variable mit min q1 median mittelwert q3 max
res=lm(y~x)
R linear model/lineare regression, wie kann ich durch x y hervorsagen
summary(res)
R Zusammenfassen von “res”
lm(x~y+z+……, data= dataname)
R multible regression bei der x durch andere variablen definiert werden soll
pcor.test(x,y,z)
R Partielle Korrelationen, z wird aus x und y raus gerechnet
res$coefficients
R Regressionscoeffizient
res$residuals
R Residuuen
hist(x, <parameter>,…..)
R Histogramm
breaks=10
R Anzahl klassenteilungen
barplot()
R Balkendiagramm
plot(x,y)
R Scatterplot x waagrecht y senkrecht
col=””
R farbdefinition
pch=
R Markierungssymbol, punkt stern etc
cex=
character expansion
xlab=
R x achsen beschriftung
ylab=
R y achsen beschriftung
main=
R Überschrift der Grafik
xaxt=
R x-achse entfernen
xlim=
R Wertebereich x achse
ylim=
Wertebereich y achse
text()
R Einer Grafik text hinzufügen
axis()
R x-Achse neu festlegen
Freq variable1 variable2.
execute.
S Häufigkeiten
graph hist variable.
execute.
S Histogramm
graph hist(normal) variable.
execute.
S Histogramm mit normalverteilung
graph/bar(simple)=count by variable.
execute.
S Balkendiagramm
Graph scatter variable with variable.
execute.
Scatterplot
Examine variables= kgr by sex.
/plot=Boxplot
/statistics=none
/Nototal.
execute.
Boxplot nach Gruppen geordnet
Graph scatter variable with variable.
execute.
Scatterplot
cor variable with variable.
execute
S korrelation Pearson
Nonpar cor variable with variable.
execute.
S spearman korrelation
partial corr
/variables=xy by z
/significance = twotail
/missing=listwise.
execute.
Regression
/missing listwise
/statistics coeff outs r anova
/criteria=pin(0.5) pout(.10)
/noorigin
/dependent variable
/method=enter variable
execute
S einfache lineare Regression
Regression
/missing listwise
/statistics coeff outs r anova
/citeria=pin(0.5) pout (.10)
/noorigin
/dependent variable
/method=enter variable variable.
execute.
S Multible lineare regression
data()
R in R gespeicherte Datensätze abrufen
str()
Struktur des Datensatzes anzeichnen
install.packages()
R pakete herunterladen
Freq variable/statistics=mean stddev median mode.
execute
S Mittelwert Median etc
library()
pakete aktivieren