문제

I want to read the following data in SPSS :

 ID Age Sex GPA
 ----------------
 1  17  M   5
 2  16  F   5
 3  17  F   4.75
 4  18  M   5
 5  19  M   4.5

My attempt:

DATA LIST / ID 1 AGE 2-3 SEX 4(A) GPA 5-8.

BEGIN DATA
117M5
216F5
317F4.75
418M5
519M4.5
END DATA.
LIST.

But the output is

ID AGE SEX  GPA 
--------------- 
1  17 M      5 
2  16 F      5 
3  17 F      5 
4  18 M      5 
5  19 M      5 

How can I get the decimals?

도움이 되었습니까?

해결책

You data is as expected, it is just the format of the GPA variable was incorrectly set to not have any decimals. You can simply use whats below to set it to show the decimals.

FORMATS GPA (F3.2).

다른 팁

Alternatively you can also try this

DATA LIST / ID 1 AGE 2-3 SEX 4(A) GPA 5-7(F,2).

BEGIN DATA
117M500
317F475
END DATA.
LIST.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top