SPSS 中的 3 路交叉表
我在 SPSS 中有一些数据,我想以特定方式格式化,但我似乎无法在文档中找到实现此目的的方法。
我的数据由 10 个问题回答(Q1 到 Q10)组成,其中 Q1 到 Q10 对应变量 SESSION 中变量 SPEAKER 的每个值。例如,每个会话最多可以有五个发言者,对于会话 1,我可能在 Q1 到 Q10 中拥有发言者 1 和 2 的数据,但没有其他发言者的数据。原始数据看起来像这样:
001A0123012301B0123012301C D E
这是对话者 A 到 E 的会话 001,其中 A 和 B 有数据(Q1 到 Q10,各一列),其余的没有。请注意,Q1 到 Q10 上只有四个可能的响应,下面我将标记这些 R1、R2、R3 和 R4。希望这比您需要的更详细。
我想为每个会话生成一个表,如下所示:
Session 001 Question | Speaker 1 | Speaker 2 | Speaker 3 | Speaker 4 | Speaker 5 R1 10 15 0 0 0 Q1 R2 9 4 0 0 0 R3 0 1 0 0 0 R4 2 0 0 0 0 --------------------------------------------------------------------- R1 ... Q2 R2 ... R3 ... R4 ...
文档似乎表明它将
CROSSTABS Q1 TO Q10 BY SPEAKER BY SESSION
执行我想要的操作,但事实并非如此。关于如何获得想要的结果有什么想法吗?
预计到达时间:对于任何可能有帮助的人,这是我使用的实际语法,更改了一些细节以删除我们客户的识别信息。
set printback=no. set width = 80 / highres = off. TITLE 'Speaker Evaluations'. INPUT PROGRAM. FILE HANDLE IN /NAME='C:\Documents and Settings\gworley\Desktop\Surveys\hrfse\hrfse.sdf' . DATA LIST FILE=IN FIXED RECORDS=1 /1 BATCH 1-3. REPEATING DATA STARTS=4 / OCCURS=5 /DATA= SPEAKER 1 (A) Q1 TO Q10 2-11. END INPUT PROGRAM. VARIABLE LABLES SPEAKER "Speaker" / Q1 "Speaker's knowledge of the subject" / Q2 "Speaker's effectiveness in communicating information"/ Q3 'The usefulness of the information presented'/ Q4 "Speaker's response to audience questions"/ Q5 'The pace of this course or panel'/ Q6 'Clarity and organization'/ Q7 'Focus on up-to-date issues'/ Q8 'Overall session rating'/ Q9 "Would you recommend this speaker for next year's conference"/ Q10 'Did this speaker try to sell their services'/. Missing values Q1 to Q8 (4 thru high)/ Q9 to Q10 (2 thru high). VALUE LABELS SPEAKER 'A' 'Speaker 1' 'B' 'Speaker 2' 'C' 'Speaker 3' 'D' 'Speaker 4' 'E' 'Speaker 5' / Q1 to Q8 0 'Poor' 1 'Fair' 2 'Good' 3 'Excellent' / Q9 to Q10 0 'No' 1 'Yes'. FREQUENCIES VARIABLES=Q1 to Q10 / STATISTICS=ALL. CROSSTABS /TABLES=Q1 to Q10 BY SPEAKER BY BATCH /CELLS= COUNT COLUMN .
I have some data in SPSS that I would like to format in a particular way, but I can't seem to find a way to do it in the documentation.
I have data that consists of 10 question responses, Q1 to Q10, with a Q1 to Q10 for each value of a variable SPEAKER within a variable SESSION. For example, each session can have up to five speakers, for for session 1 I might have data in Q1 to Q10 for speaker 1 and 2, but nothing for the others. The raw data looks something like this:
001A0123012301B0123012301C D E
So that's session 001 with speakers A through E where A and B have data (Q1 to Q10, one column each) and the rest don't. Notice that only four responses are possible on Q1 to Q10, and below I'll label these R1, R2, R3, and R4. Hopefully that's more detail than you're going to need.
I want to generate one table per session that looks something like this:
Session 001 Question | Speaker 1 | Speaker 2 | Speaker 3 | Speaker 4 | Speaker 5 R1 10 15 0 0 0 Q1 R2 9 4 0 0 0 R3 0 1 0 0 0 R4 2 0 0 0 0 --------------------------------------------------------------------- R1 ... Q2 R2 ... R3 ... R4 ...
The documentation seems to suggest that
CROSSTABS Q1 TO Q10 BY SPEAKER BY SESSION
will do what I want, but it doesn't. Any ideas on how I can get the desired result?
ETA: For anyone it might help, here is the actual syntax I used, with a few details changed to remove identifying information of our client.
set printback=no. set width = 80 / highres = off. TITLE 'Speaker Evaluations'. INPUT PROGRAM. FILE HANDLE IN /NAME='C:\Documents and Settings\gworley\Desktop\Surveys\hrfse\hrfse.sdf' . DATA LIST FILE=IN FIXED RECORDS=1 /1 BATCH 1-3. REPEATING DATA STARTS=4 / OCCURS=5 /DATA= SPEAKER 1 (A) Q1 TO Q10 2-11. END INPUT PROGRAM. VARIABLE LABLES SPEAKER "Speaker" / Q1 "Speaker's knowledge of the subject" / Q2 "Speaker's effectiveness in communicating information"/ Q3 'The usefulness of the information presented'/ Q4 "Speaker's response to audience questions"/ Q5 'The pace of this course or panel'/ Q6 'Clarity and organization'/ Q7 'Focus on up-to-date issues'/ Q8 'Overall session rating'/ Q9 "Would you recommend this speaker for next year's conference"/ Q10 'Did this speaker try to sell their services'/. Missing values Q1 to Q8 (4 thru high)/ Q9 to Q10 (2 thru high). VALUE LABELS SPEAKER 'A' 'Speaker 1' 'B' 'Speaker 2' 'C' 'Speaker 3' 'D' 'Speaker 4' 'E' 'Speaker 5' / Q1 to Q8 0 'Poor' 1 'Fair' 2 'Good' 3 'Excellent' / Q9 to Q10 0 'No' 1 'Yes'. FREQUENCIES VARIABLES=Q1 to Q10 / STATISTICS=ALL. CROSSTABS /TABLES=Q1 to Q10 BY SPEAKER BY BATCH /CELLS= COUNT COLUMN .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,我认为您的原始数据结构不适合 SPSS 读取。为了阅读它,我在每个发言者之前添加了会话编号。
我尝试了以下语法文件:
我得到了这个:
first I think your raw data is not well strutured to be read by SPSS. To read it I added session n° before each speaker.
I Tried the following syntax file:
I got this: