* SPSS data sources. * (example from SAS Language Reference: Concepts). * In-line data. data list list /PatientID (a4) Week1 Week8 Week16. compute loss = week1 - week16. begin data 2477 195 177 163 2431 220 213 198 2456 173 166 155 2412 135 125 116 end data. descriptives variables=week1 to loss. * From a file. data list list file="y:\spss\data\input\weight.dat" /PatientID (a4) Week1 Week8 Week16. compute loss8 = week1 - week8. compute loss16 = week1 - week16. descriptives variables=loss8 loss16. * Using GET DATA (from a file only). * Note: I find documentation for this command to be incomplete. get data /type=txt /file="y:\spss\data\input\weight.dat" /delimiters=" " /* although data is DELIMITED by default, there is no default DELIMITER */ /variables = PatientID a Week1 f Week8 f Week16 f. /* " = " before variable list REQUIRED for delimited data */ compute loss8 = week1 - week8. compute loss16 = week1 - week16. compute avgloss = mean(loss8, loss16). descriptives variables = avgloss.