: SPSS Exercises
One sample Chi-square Test
This test is conducted on variables which consist of two or more categories and it investigates if the proportions of scores/observations which appear in categories of a variable are equal to expected values. The table below shows Kristen’s variables which were used in conducting a research study on the method of cooking and the taste of chips.
Table 1: Variables in Kristen’s Study of Cooking Methods and Taste of Chips
|Taste||Taste has 3 categories 1 = potato chips fried in Animal Fat 2 = potato chips fried in Canola oil 3 = Baked potato chips|
|Hypothesized Taste||Taste has 2 categories 0 = potato chips fried in Canola oil 1 = potato chips fried in Animal Oil or Baked|
Creating a weighted data file
To add weight to the data file, SPSS was used and the following procedure was followed. After loading the file into SPSS, click on Data from the menu bar. A drop down menu appears from where you choose `weight cases’. Then a dialogue box appears where you click on the radio button for `weight cases by’ then from the variable box on the left hand side, select “number who preferred each type of chip” and move it to the right hand side box for frequency variables and eventually click ok (Kumar, 2009).
Conducting a one-sample chi-square test to study if the cooking method used to fry potato chips affects the resulting taste. From the output, identify the observed frequency for potato chips fried in canola oil, the p value and the chi-square value.
The procedure for conducting a one sample chi-square test in SPSS is described below. Load the data into SPSS then from the menu bar click analyze and choose non parametric tests then choose chi-square from the legacy dialogue box which appears. A chi-square dialogue box appears where you select the following variables from the left window; “method of cooking potato chips” and “number who preferred each type of chi” and move them to the right side window and eventually click ok. The tables below present the output obtained after conducting the test.
|Table 2: Method of cooking potato chips|
|Observed N||Expected N||Residual|
|Fried in animal fat||7||16.0||-9.0|
|Fried in Canola oil||33||16.0||17.0|
|Table 3: Number who preferred each type of chip|
|Observed N||Expected N||Residual|
|Table 4: Test Statistics|
|Method of cooking potato chips||Number who preferred each type of chip|
|a. 0 cells (.0%) have expected frequencies less than 5.The minimum expected cell frequency is16.0. After conducting the test, the observed frequency for potato chips that have been fried in Canola oil is 33 as shown in table 2 in the second column. Table 4 above presents the test statistics obtained after conducting the test whereby the chi-square value was 27.125 at 2degrees of freedom and test was significant at a p value of 0.000.|
The expected frequencies obtained for the 3 categories of potato chips are shown in table 3 above in the third column where 16 individuals were expected in each case. The study has a sample size of 48 individuals which is relatively large and it is expected that all the individuals are allocated randomly (Gay et al, 2009)
Kristen states that individuals seem to likely prefer potato chips that are fried in canola oil over those that are fried in animal fat or baked. The following hypothesis was formulated to conduct the test;
H0: Individuals likely seem to prefer potato chips that have been fried in Canola oil over those fried in animal fat or baked.
H1: Individuals do not likely seem to prefer potato chips that have been fried in canola oil over those fried in animal fat or baked.
A follow up test was conducted using expected frequencies which are not equal following the procedure explained above and the obtained output is shown in the table below.
|Table 5: Test Statistics|
|Number who preferred each type of chip||Method of cooking potato chips|
|a. 0 cells (.0%) have expected frequencies less than 5. The minimum expected cell frequency is 24.0.|
A results section of the conducted analyses
A one-sample chi-square test was conducted to investigate whether individuals prefer potato chips in canola oil over those fried in animal fat or baked. The results of the test were significant, = (2, N = 48) = 27.125, . The proportion of individuals who prefer potato chips fried in canola oil was greater than the hypothesized proportion while the proportions of potato chips fried in animal fat and baked were less than their hypothesized proportions. A follow up test indicated that the proportion of individuals who preferred potato chips fried in canola oil did not differ significantly from the proportion of individuals who preferred potato chips fried in animal fat or baked,= (1, N = 15) = 6.750, . The results suggest that individuals did not prefer potato chips fried in canola oil over those fried in animal or baked.
Two Independent –Samples Test: The Mann-Whitney U Test
This test is used to investigate if median scores of a variable being tested appear to be different between 2 groups. The table below shows the variables studied in Billie’s test.
Table 6: Test variables
|Weight||Weight is the grouping variable; 1 = Over weight 2 = Normal weight|
|Time in seconds||It is the test variable and it shows the time taken by an individual to complete a meal|
To carry out Billie’s study, the following test was conducted via SPSS. After loading the data file into SPSS, click analyze from the menu bar, click nonparametric tests, and click legacy dialogue box and then click 2 independent samples. A 2 independent samples tests dialog box appears where you pick time in seconds from the left window and post it to the test variable list then select weight (1,2) and post it to the box for the grouping variable. Click define groups where you type 1 in the group 1 box to show the over -weight cases and 2 is inserted into group 2 box to show normal weight and click continue. Move to the test type section and check the Mann-Whitney u box then click ok to conduct the test (Kumar, 2009). The tables below indicate the results obtained from the test.
|Table 7: Ranks|
|weight||N||Mean Rank||Sum of Ranks|
|Time in Seconds||overweight||10||8.30||83.00|
|Table 8: Test Statistics|
|Time in Seconds|
|Asymp. Sig. (2-tailed)||.000|
|Exact Sig. [2*(1-tailed Sig.)]||.000a|
|a. Not corrected for ties.|
|b. Grouping Variable: weight|
The Mann-Whitney U test conducted shows that the mean rank obtained for normal weight individuals is 24.57 as indicated by results from table 7 above. The p value for the test is .000 and the Z value for corrected ties is -3.811.
Comparison between the p value for the Mann-Whitney U test and the p value obtained from conducting an independent samples t test. After conducting an independent samples t test, the p value obtained was 0.000 which was similar to the p value obtained from conducting the Mann-Whitney U test hence no difference was noted (Gay, et al, 2009). The results table for the independent samples t test is shown in the appendix section as table 12.
A Mann-Whitney U test was conducted to evaluate the hypothesis that overweight individuals tend to eat faster than normal weight individuals. The results of the conducted test were as expected and significant, Z = -3.811, Overweight individuals had an average rank of 8.30 while normal weight individuals had an average rank of 24.57 as shown in tables 7 & 8 above.
The box plot named figure I from the appendix section shows the distribution of the time taken by both the overweight and normal weight individuals. The graph was generated through SPSS by following the procedures from the menu bar and graphs to box plots then defining axis variables (Kumar, 2009).
Conducting the K Independent-Samples Tests: The Kruskal-Wallis Tests
Marvin conducted a research study to test the effect of hair color on social extroversion. The table below indicates the variables used in the study.
Table 9: Research variables
|Variable||Definition of Terms|
|Hair Color||1 = Blond 2 = Brunet 3 = Red Head|
|Social Extroversion||A measure of social extroversion|
A Kruskal-Wallis test was conducted to investigate the presence of a relationship between the 2 variables under study. The procedure similar to Mann-Whitney U test was followed and the results of conducting the test are shown below (Kumar, 2009).
|Hair Color||N||Mean Rank|
|a. Kruskal Wallis Test|
|b. Grouping Variable: Hair Color|
The Kruskal-Wallis test indicates the presence of a significant difference in the medians= (2, N =18) = 5.963, . Since the test is significant, follow up tests should be conducted (Gay, et al, 2009).
The effect size for the test is obtained by computing the formula below (Gay, et al, 2009);
η2 = whereby 5.963 is divided by 17
η2 = 0.35.
A box plot was generated via SPSS to show the distribution of social extroversion among the three groups as shown in figure 2 from the appendix section.
One way ANOVA was conducted for comparison of the results with those obtained from the Kruskal-Wallis test. The table below shows the output after conducting the test,
|Tests of Between-Subjects Effects|
|Dependent Variable: Social Extroversion|
|Source||Type III Sum of Squares||df||Mean Square||F||Sig.||Partial Eta Squared|
|a. R Squared = .319 (Adjusted R Squared = .228)|
The ANOVA test conducted was significant at the 0.05 level of precision, F (2, 15) = 3.511, p = 0.056, ms error = 3.433 (Ghauri, et al. 2005).
Both the Kruskal-Wallis and the one way ANOVA tests conducted indicated that the test were significant at p values .051 and 0.56 respectively (Ghauri, et al. 2005).
A Kruskal-Wallis test was conducted to investigate the differences between hair colors on the median change in social extroversion. The test was significant, = (2, N =18) = 5.963, . The effect size for the relationship between hair color and extroversion was strong with hair color accounting for 35% of the variance in social extroversion.
Ghauri, P., Granhaug, K. and Kristianslund, I.,(2005). Research Methods in Business Studies: a Practical Guide.
Kumar, R. (2009). Research Methodology: A step-by-step Guide for Beginners. Greater Kalash: Sage Publications
Gay, L,R., Mills, E. G., Airasian, P.,(2009). Educational Research: Competencies for Analysis and Applications (10th ed.)
Figure 1: Source (SPSS output)
|Independent Samples Test|
|Levene’s Test for Equality of Variances||t-test for Equality of Means|
|F||Sig.||t||df||Sig. (2-tailed)||Mean Difference||Std. Error Difference||95% Confidence Interval of the Difference|
|Time in Seconds||Equal variances assumed||2.745||.106||-3.975||38||.000||-109.400||27.522||-165.116||-53.684|
|Equal variances not assumed||-5.397||30.828||.000||-109.400||20.272||-150.754||-68.046|