Then you need to express clearly what is the data you get from SPSS.
- There is a data frame
dt
that you get withdt = spssdata.GetDataFromSPSS()
and that does look like your example, with columnsAA
andBB
- There is a variable
varcut
ory
that you get from SPSS? What is the class and content ofy
after that command:y <- spssdictionary.GetMultiResponseSet(mrsetName = "$varcut")
? Doesy
only containlist("tot","CA","AM")
, or does it also containc("g","f")
andc("a","h","s","d")
? - If it's not part of
y
, how do you determinec("g","f")
andc("a","h","s","d")
? Where do these values come from?
And you also need to express clearly what is the result you want. If you just want to count the values in BB
, then you can get that result with table(dt$BB)
. If you want to "cut" the values in BB
and then count them, you have to explain what varcut
or y
looks like. If you want to use AA
to count BB
, you have to explain how.
You can find advice here on how to create a reproducible example.