### Graphs

**How do I produce a bar chart of a nominal variable? **

Bar chart is the correct graph for a nominal variable. To produce the bar chart of a nominal variable called *Employment Category*. From the menu bar select **Graphs ->Legacy Dialogs -> Bar**…click on **Simple**, click on **Define**. From the variables list, select *Employment Category [jobcat]* click the arrow (** >**) to transfer it under

**Category Axis:**. Then click

**OK**to generate the graphic.

** How do I produce a histogram for a continuous variable?**

To produce a **Histogram of Current Salary with Normal Curve** - from the menu bar select **Graphs -> Legacy Dialogs -> Histogram…**

From the variables list, select *Current Salary [salary]* click the arrow (** >**) to transfer it under

**Variable:**. Select

**Display normal curve**by a single click on the check box. Then click

**OK**to generate the graphic.

**I have heard a lot about Scatterplot. What is this and how can I produce it in SPSS?**

The existence of a statistical association between two variables is most apparent in the appearance of a diagram called a scatterplot. A scatterplot is simply a cloud of points of the two variables under investigation.

To produce scatter plot of *variable1* against *variable2*, from the menu bar select **Graphs -> Legacy Dialogs -> Scatter/Dot…** -> click on **Simple**, click on **Define**. From the variables list, select *variable1* click the arrow (** >**) to transfer it under

**Y Axis:**. From the variable list again, select

*variable2*, click the arrow (

**) to transfer it under**

*>***X Axis:**. Then click

**OK**to generate the graphic.

**How do I produce and modify a 2D pie chart in SPSS of a nominal variable?**

Pie chart is another chart that is suitable for a nominal variable. To produce 2D Pie Chart for *variable1* made up of 3 levels from the menu bar select **Graphs -> Legacy Dialogs -> Pie**…Select **Summaries for groups of cases** by a single click on the radio button. Click on **Define**. From the variables list, select *variable1* click the arrow (** >**) to transfer it under

**Define Slices by:**. Then click

**OK**to generate the graphic. Double-Click on the Pie in quick succession to make it editable. (the pie will be displayed in the

**Chart Editor**window). In this Window select

**Elements -> Show Data Labels**. Select

**Percent (or Count)**from the displayed dialogue box. Click on the green arrow on the right. Still on the dialogue box, click

**Apply**and then

**Close**. You will now be back on the Chart Editor window, from the menu bar select

**File -> Close**.

**How can I produce a clustered bar chart of two nominal variables?**

From the menu bar select **Graphs ->Legacy Dialogs -> Bar -> Clustered -> Define**.** **From the variable list transfer *variable1* to **Category Axis:. **From the variable list again transfer *variable2* to** ****Define Clusters by: **Then click **OK** to generate the graphic.

**How to produce a boxplot for one continuous (interval) variable by one categorical variable? That is, for each level of the categorical variable I want to see a boxplot on the same plot.**

- From the menu bar select
**Graphs -> Legacy Dialogs -> Boxplot**… click on**Simple**, click on**Summaries for group of cases**, and click on**Define** - From the variables list, select the variable e.g.
*Current Salary [salary]*click the arrow () to transfer it under*>***Variable:**. - From the variable list again, select a categorical variable e.g.
*gender*, click the arrow () to transfer it under*>***Category Axis:**. - Then click
**OK**to generate the graphic.

**How to produce a boxplots for several variables on the same plot?**

- From the menu bar select
**Graphs -> Legacy Dialogs -> Boxplot**… click on**Simple**, click on**Summaries for separate variables**, and click on**Define** - From the variables list, select the variables e.g.
*Current Salary [salary]*click the arrow () to transfer it under*>***Variable:**. Select and transfer more variables as necessary. - Then click
**OK**to generate the graphic.

**How do I produce survival curves in SPSS? If your data is already in SPSS follow the instructions below to produce survival curves. Note that in the instruction below variable means your own variable in the data file. If you don't have any factor (grouping) variable for comparison ignore instructions 7-10.**

- To run a
**Kaplan-Meier Survival Analysis**, from the menus choose:**Analyze → Survival → Kaplan-Meier...** - Select
*variable*as the**Time**variable. - Select
*variable*as the**Status**variable. - Click
**Define Event**. - Under
**Value(s) Indicating Event Has Occurred**type*1*in the text area next to**Single value:**. - Click
**Continue**. - Select
*variable*as a**Factor**. - Click
**Compare Factor**. - Select
**Log rank**,**Breslow**, and**Tarone-Ware**. - Click
**Continue**. - Click
**Options**in the**Kaplan-Meier**dialog box. - Select
**Quartiles****Statistics**group and**Survival**in the**Plots**group. - Click
**Continue**. - Click
**OK**in the**Kaplan-Meier**dialog box.

**How to produce a stacked bar for several variables on the same plot?**

- From the menu bar select
**Graphs -> Legacy Dialogs -> Bar**… click on**Stacked**, click on**Summaries for separate variables**, and click on**Define** - From the variables list, select the variables e.g.
*var1*click the arrow () to transfer it under*>***Bars Represent:**. Select and transfer more variables as necessary. The default statistics is the**mean**. You can change to any statistic by clicking on**Change Statistics...**when it is active. If not active click on any variable under**Bars Represent:** - Note that you also need a variable under
**Category Axis**such as gender for example. - Then click
**OK**to generate the graphic.