Analysis of categorical data: Course quiz instructions for SPSS The dataset Please download the Online sales dataset from the Download pod in the Course quiz resources screen. The filename is smr_bus_acd_clo_quiz_online_250.xls. Save it to your computer. This version stores the results from a survey of 250 firms. Import it into SPSS with the following menu sequence: File, Open, Data. Change Files of type to Excel Locate the Excel file and import the relevant sheet. Ensure that the imported dataset has 250 rows. SPSS appears not to have a set of facilities for dealing with one and two proportions in a simple way, so we refer you to an Excel Add-In written for this purpose, called SSC-Stat. You can find it at http://www.reading.ac.uk/ssc/n/n_sscstat.htm There is plenty of online help on how to install and load Add-ins into Excel. In SPSS, obtain a one-way summary table of this categorical variable with: Analyze, Descriptive Statistics, Frequencies Select Uses_contractor into the Variables box Press Continue then OK. Now answer Q1 in the quiz. Now note down the count of Yeses and the total sample size. Testing the null hypothesis stated above translates to testing that the true proportion of firms that use contractors is 0.1, i.e. H 0 : π Contractors = 0.1 1 Page Epigeum Ltd, 2014
H 1 : π Contractors 0.1 Test the null hypothesis stated above as follows: Go to Excel and in the Add-Ins tab: Click SSC-stat, Analysis, One-sample proportion Select the Summary values radio button, enter the number of Yeses in the Number of successes box and enter the total sample size into the Number of trials box Under Confidence interval, tick the Simple normal approx. box only Tick the box to Test sample mean value and type 0.1 in the box Click OK. Now answer Q2 6 in the quiz. A Pearson chi-squared test could have been conducted here to obtain the same p-values as the one obtained from the z-test. This is because in this context the two test statistics are equivalent. To test the same null hypothesis stated above, we could have conducted an exact binomial test. Your decision about H 0 would be unchanged from above. To obtain exact binomial confidence intervals: From the SSC-stat menu, recall the One sample proportion dialogue box Tick to request an Exact confidence interval. The above sequence output an exact 95% confidence interval for the true proportion firms that use contractors to improve their user interface. The exact interval is very similar to the one obtained using a Normal approximation because of the large sample size and because the observed sample proportion of 0.184 is not extreme. Return to SPSS. Obtain a two-way summary table of these two categorical variables with the menu sequence: Analyze, Descriptive Statistics, Crosstabs 2 Page Epigeum Ltd, 2014
Select Uses_contractor in the Rows box and Sector_electrical in the Columns box Press Cells, click the Column Percentages box Press Continue then OK Now answer Q7 8 in the quiz. Now note down the count of Yeses and the total sample size for each sector respectively. As its name suggests, the null hypothesis is that there is no true difference between the two proportions. So the null hypothesis we are testing is H 0 : π other sectors π electrical = 0 H 1 : π other sectors π electrical 0 where π is the true proportion of firms that use contractors for each retail sector respectively. Now compare the two proportions as follows: Go to Excel and the Add-Ins tab Click SSC-stat, Analysis, Two-sample proportion Select the Summary values radio button Enter the number of Yeses in the Number of successes boxes and enter the total sample size into the Number of trials boxes as follows: sector of type 1Other as Sample 1 and sector of type 2Electrical for sample 2 Click OK. Now answer Q9 14 in the quiz. A Pearson chi-squared test could have been conducted to obtain the same p-value. This is because in this context the two statistics are equivalent. Try it in SPSS as follows: Analyze, Descriptive Statistics, Crosstabs Move Sector_electrical into the Row box and Uses_contractor into the Column box 3 Page Epigeum Ltd, 2014
Press Statistics and tick Chi-square Press Continue then OK Check that the p-value (labelled Asymp. Sig. (2-sided) ) from the Pearson chi-squared statistic is the same as that from the z-statistic in SSC-stat. We can conduct an exact hypothesis test to test the same null hypothesis stated above. Note that SPSS already prints a p-value (labelled Exact Sig. (2-sided) ) attached to the Fisher s exact test. Your decision about H 0 should be unchanged from above. Obtain a two-way summary table of this categorical variable with: Analyze, Descriptive Statistics, Crosstabs Select Uses_contractor in the Rows box and Retail_sector in the Columns box Press the Cells button and tick to display Column percentages Press Continue then OK. The hypothesis we are testing is H 0 : π DIY/Hardware = π electrical = π fashion H 1 : at least one true proportion is different where π is the true proportion of firms that use contractors for the respective sectors. The comparison is done using a Pearson chi-squared hypothesis test as follows: Press Statistics and tick the Chi-Square box The p-value is in the row labelled Pearson Chi-Square. A p-value cannot be zero, but SPSS truncates it at 3 decimals, so you may want to report it as < 0.001. Check if the expected number of counts in each cell is sufficiently large, as follows: 4 Page Epigeum Ltd, 2014
Press the Cells button and tick to display the Expected counts Now answer Q15 18 in the quiz. To test the same null hypothesis stated above, we could conduct an exact hypothesis test, namely a Fisher s exact test. Press the Exact button and tick the Exact radio button Your decision about H 0 should be unchanged from above. Recall the Crosstabs dialogue box In the Column box, replace Retail_sector with Specialised_staff and click OK. Now answer Q19 in the quiz. Next we must recode the variable Uses_contractor, currently stored as text ( Yes or No ) into a numerical format, to obtain the relevant test statistic in SPSS. Do this as follows: Select Transform, Automatic Recode Move Uses_contractor into the Variable box In the Add New Name box, type Uses_contractor_num Press the Add New Name button and click OK. The null hypothesis we wish to test is: H 0 : no true linear trend in the proportion of firms that use contractors number of specialised staff employed 5 Page Epigeum Ltd, 2014
H 1 : true linear trend in the proportion of firms that use contractors number of specialised staff employed. Test the above null hypothesis as follows: In the Row box, replace Uses_contractor with Uses_contractor_num Press Statistics and tick the Chi-Square box The relevant result is in the row labelled Linear-by-Linear Association. A p-value cannot be zero, but SPSS truncates it at 3 decimals, so you may want to report it as < 0.001. Now answer Q20 21 in the quiz. 6 Page Epigeum Ltd, 2014