Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

15
Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen

Transcript of Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Page 1: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Example SPSS

Basic Medical Statistics CourseOctober 2010Wilma Heemsbergen

Page 2: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Windows in SPSS

For each data set: (>1 possible):- Data view- Variable view

Furthermore, a syntax window can be opened

Open windows are shown in the tab “Windows”New windows can be opened: file – new

Data, output, syntax can be saved in separate files

Page 3: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Import Data Sets in SPSS

(*.dbf, *.xls, *txt,/…)

Using the “paste” button, the corresponding syntax is pasted (ready to run).

Page 4: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Get data

GET FILE='U:\data_statcursus\trial_rt.sav'.DATASET NAME DataSet1 WINDOW=FRONT.

Menu: file – open - data

It is also possible to start with opening a syntax file, which will read / open the data (without using the menu). To run: (select and) hit the run button.

Use the “paste” button to get the syntax in the syntax window

Page 5: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Compute

DATASET ACTIVATE DataSet1.COMPUTE duur_rt=tend - tstart.EXECUTE.

Menu: transform - compute

Page 6: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Reports, describing data

Page 7: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Displaying data

Page 8: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Histogram

GRAPH /HISTOGRAM=duur_rt.

Menu: graphs - legacy dialogs - histogram

Page 9: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

DescriptivesMenu: analyse - descriptive statistics - descriptives

DESCRIPTIVES VARIABLES=age /STATISTICS=MEAN STDDEV MIN MAX.

Page 10: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Recode

Menu: transform - recode

RECODE age (45 thru 69.99=0) (70 thru 90=1) INTO age70.EXECUTE.

Page 11: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.
Page 12: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Split file / selection

Menu: data - split file data - select cases

Page 13: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

COMPUTE filter_$=(arm=1).VARIABLE LABEL filter_$ 'arm=1 (FILTER)'.VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.FORMAT filter_$ (f1.0).FILTER BY filter_$.EXECUTE.

SORT CASES BY arm.SPLIT FILE SEPARATE BY arm.

Page 14: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

There is a possibility to savea subset of the variables:“save as”, option “variables”

Page 15: Example SPSS Basic Medical Statistics Course October 2010 Wilma Heemsbergen.

Try the following to practice with SPSS:(data set and syntax file are available at website)

- Read the file “trial_rt”, using menu. Paste the syntax.- Compute a new variable (save the syntax).- Generate a frequency table, a pie chart, a cross tab,

using: the menu / the paste button / the syntax window.- Generate a frequency table for each rand arm seperately,

using the options “split file” and “select”.- Save file: trial_rt_extended as an SPSS file.- Save a subset of variables (trial_rt_subset)- Save output: output_trial_rt.- Save syntax: syntax_trial_rt_extended.- Open the database again, using your syntax- Save file as a *.txt file or an *.xls file and try to read it

again by importing the data set.