0
votes

I have a large CSV-datafile with data on sleep. The first four items of this dataset contains time-data of varying formats.

I want to import this datafile into SPSS, but as you can see from the CSV-example underneath, the data is not easy to read for SPSS and Excel. How can I make use of these data?

Example of data:

Time went to bed;Minutes to sleep;Got up time;Actual sleep time in hours
22;240;08,30;4    
24,00;60;09,00;8    
200;120;1200;8    
0;120;900;4,5    
01:30;30;06:30;5
1

1 Answers

0
votes

You can import it into SPSS as text (using ";" as delimiter) and then work on it. You can't use the current labels as variable names, so you should enter variable names and formats in the command. See examples below:

GET DATA  /TYPE=TXT
  /FILE="path\filename.txt"
  /DELCASE=LINE
  /DELIMITERS=";"
  /ARRANGEMENT=DELIMITED
  /FIRSTCASE=2
  /IMPORTCASE=ALL
  /VARIABLES=
  Time_went_to_bed A5
  Minutes_to_sleep F8.1
  Go_tup_time A5
  Actual_sleep_hrs F8.1.
CACHE.
EXECUTE.

Once you have this in a dataset you'll need to identify and correct each of the different shapes in which your time data appears.