Tutorial 2
Tutorial 2
Select the variables you are interested in and click the triangle button to move the variables place. To view the available descriptive statistics, click on the button labeled Options. This will show the following dialog box:
After selecting the statistics you would like, click Continue. Output can be generated by clicking on the OK button in the Descriptives dialog box. Statistics will be in the Output Viewer.
Descriptive Statistics N Current Salary Beginning Salary Valid N (listwise) 474 474 474 Minimum $15,750 $9,000 Maximum $135,000 $79,980 Mean $34,419.57 $17,016.09 Std. Deviation $17,075.661 $7,870.638
Click on the Statistics button to see what descriptive statistics are available. Note that percentiles and descriptive statistics can be calculated in the Frequencies menu.
The example in the above dialog box would produce the following output:
Gender Frequency 216 258 474 Percent 45.6 54.4 100.0 Valid Percent 45.6 54.4 100.0 Cumulative Percent 45.6 100.0
Valid
Employment Category Frequency 363 27 84 474 Percent 76.6 5.7 17.7 100.0 Valid Percent 76.6 5.7 17.7 100.0 Cumulative Percent 76.6 82.3 100.0
Valid
To create contingency tables, you can use the Crosstabs menu. Analyze > Descriptive Statistics > Frequencies... Contingency tables will be used later in the tutorial.
Histogram
Histograms are commonly used with larger data sets. Histograms can help an analyst quickly determine if data is normally distributed or if the data are skewed. Lets create a histogram of the Beginning Salary of the employees. Graphs > Legacy Dialogs > Histogram
Input Beginning Salary into the Variable box using the Triangle button. To see if the data are normal, lets also check the box next to Display Normal Curve. Click OK.
Compute Variables
New variables can be created using the Compute option available from the menu in the Data Editor: Transform > Compute Variables... To create a new variable, type its name in the box labeled Target Variable. The expression defining the variable being computed will appear in the box labeled Numeric Expression.
This new variable, salchange, will appear in the rightmost column of the working dataset.
Recode Variables
Often, it may be necessary to take a continuous variable and turn it into a categorical variable. For example, lets say that we want to take the salary variable and define a new variable as follows: 1 = Employees whose salaries are less than $25,000 2 = Employees whose salaries are between $25,000 and $75,000 3 = Employees whose salaries are greater than $75,000 To do this, we need to go to the Recode into Different Variables menu.
5
NMK SPSS Tutorial
Transform > Recode into Different Variables Here are a rundown of steps necessary to do the recoding defined above. 1. Select the Salary variable and click the Triangle button. 2. Type in a name and label for the new variable. I chose SalaryCode for both. Click the Change button. 3. Click Old and New Values 4. Click Range, LOWEST through value and type in 24999. Under the New Value listing, click Value and type in 1. Click the Add button to add to the list. 5. Repeat, using the Range option and type in 25000 and 74999. Under the New Value listing, click Value and type in 2. Click the Add button to add to the list. 6. Click Range, value through HIGHEST and type in 75000. Under the New Value listing, click Value and type in 3. Click the Add button. 7. Click Continue and OK to create the new variable.
6
NMK SPSS Tutorial
Split File
Often, an analyst wants to run separate tests or graphs for different subgroups. Example of this would include running descriptive statistics by gender or by level of education. This section will show how you can split a file so that separate analyses are run. For this example, we will split the file by gender. Data > Split File Click on the Organize output by groups option and select gender using the triangle button. Click OK.
To test this out, lets run descriptive statistics on the variables Beginning Salary and Months since Hire.
Gender = Female
Descriptive Statisticsa Minimum Maximum 216 216 216 $9,000 63 $30,000 98
Gender = Male
Descriptive Statisticsa Minimum Maximum 258 258 258 $9,000 63 $79,980 98
Remember to change the option back to Analyze all cases, do not create groups when you are done!!
Independent-Samples T Test: Used to test if the mean of two variables are equal. H0: 1 = 2 H1: 1 2
Paired-Samples T Test: Used to test if the mean difference between two dependent samples is 0. H0: d = 0 H1: d 0
Example: Does the population mean for salary differ for males and females? Here, we will use an Independent-Samples T Test. When current salaries for male and female groups are being compared in this analysis, the salary and gender variables are selected for Test Variable and Grouping Variable boxes, respectively.
Group Statistics Gender Male Female N Mean $41,441.78 $26,031.92 Std. Deviation $19,499.214 $7,558.021 Std. Error Mean $1,213.968 $514.258
Current Salary
258 216
Independent Samples Test Levene's Test for Equality of Variances t-test for Equality of Means Mean Difference $15409.86 $15409.86 Std. Error Difference $1,407.906 $1,318.400 95% Confidence Interval of the Difference Lower $12,643.322 $12,816.728 Upper $18,176.401 $18,002.996
Current Salary
F 119.669
Sig. .000
t 10.945 11.688
df
472
344.262
8
NMK SPSS Tutorial
In the above example, in which the null hypothesis is that males and females do not differ in their salaries, the t statistic under the assumption of unequal variances has a value of 11.688, and the degrees of freedom has a value of 344.262 with an associated significance level of .000. The significance level tells us that the hypothesis of no difference is rejected under the .05 significance level. Accordingly, we conclude that males and females differ in their salaries.