i'm trying to create an index in R and i have no idea where to start. I've been looking around but i just can't seem to find a way to do what i want to.
I have several dummy-variables (1,0) and they refer to whether someone is a member in an organization (1) or not (0). I would like to create an index indicating to how many organizations a person is a member of.
That means, i should somehow be able to filter and add this information to create such an index. I've never done anything like it. I've heard there are some easy ways to do it in SPSS but i want to learn how to do it in R.
Does anyone have a tip, how can i do this?
If it is of any use, here is an example of my data:
dput(SK[1:10,])
structure(list(Woeltaetigkeit = c(0, 0, 0, 0, 0, 0, 0, 0, 0,
0), Menschenrechte = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), Naturschutz = c(0,
0, 0, 0, 0, 1, 0, 0, 0, 0), Buergerinitiative = c(0, 0, 0, 0,
0, 0, 0, 0, 0, 0), Gewerkschaft = c(0, 0, 0, 0, 0, 0, 0, 0, 0,
0), ehem.Gewerkschaft = c(0, 1, 0, 1, 1, 0, 0, 0, 0, 1), Partei = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 0), Sport = c(1, 0, 0, 1, 0, 1, 0, 0,
1, 1), Hobby = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0), Gesundheit = c(0,
1, 0, 0, 0, 0, 0, 0, 0, 0), Eltern = c(0, 0, 0, 0, 0, 1, 1, 0,
1, 0), Senioren = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), row.names = c(NA,
10L), class = "data.frame")
Aucun commentaire:
Enregistrer un commentaire