开发者

Can I globally repair value/label pairs in SPSS

Sigh. I've got this fabulous data set with close to 15,000 valid cases. There is just one problem. My web survey was configured to automatically pass unique numeric values for each Likert variable. And, because the survey branched multiple times, I'm ending up with more than a hundred scalar variables such as the following:

SampleLikertVariable. Numeric. 10355 = "Strongly disagree." 10356 = "Somewhat disagree." 10357 = "Neutral." 10358 = "Somewhat agree." 10359 = "Strongly agree."

Sadly, each variable has a different numeric range associated with the five points of the scale. Before I can combine variables, I need to restore the data to 1,2,3,4,5. Ideally, I would like to keep the labels intact, though it's not the end of the world if I lose them. The process needs to be au开发者_开发知识库tomated through syntax scripts.

So far, the only way I can think of to do this is a block of IF statements such as these:

IF (MISSING(ywNfMotivationsPvp)=1) ywNfMotivationsPvp=0.
IF ywNfMotivationsPvp=10277 ywNfMotivationsPvp=1.
IF ywNfMotivationsPvp=10278 ywNfMotivationsPvp=2.
IF ywNfMotivationsPvp=10279 ywNfMotivationsPvp=3.
IF ywNfMotivationsPvp=10280 ywNfMotivationsPvp=4.
IF ywNfMotivationsPvp=10281 ywNfMotivationsPvp=5. 

But we're talking hundreds of variables that will need to get this same sort of treatment. There has got to be a better way.

I considered creating a basic FOR loop that would reduce some of the repetition, but this would still require me to manually jot down the unique starting number for each variable number. I've considered storing the variable names and unique starting numbers in a paired array, but before mining the documentation and figuring out how to do this in SPSS syntax, I figured I would ask one simple question:

Is there a better or easier way of doing this?


I think I have figured out how to do this with AUTO RECODE \INTO. It isn't completely painless, but much smoother than what I described above.


Good solution. This could also be done by calculating the minimum for ALL or V1 to v99 or something like that and subtracting that from each variable. DO REPEAT would work here. AGGREGATE or OMS could help you do this in bulk.

One thing to watch out for with autorecode: If any question has no answers that have a particular value, it will get collapsed out and higher values moved down. You can check by tabulating the maximums for all the variables after you do autorecode.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜