LectureWeek3-3.pdf

BUS 308 Week 3 Lecture 3

This lecture focuses on the Chi Square, how to set-up the data tables and how to conduct the Chi Square tests on distributions. All the chi square related functions are found in the fx or Formulas list. None of these are found in the Data Analysis tab.

The chi square test compares the actual or observed count distribution across groups (such as how many in each grade) against an expected distribution. We will see that different ways exist to define what this expected distribution is.

Chi Square Tests

With the Chi Square tests, we are going to move from looking at population parameters, such as means and standard deviations, and move to looking at patterns or distributions. Generally, when looking at distributions and patterns we will create groups within our variable of interest. For example, the variable grades is already divided into 6 groups. The Compa-ratio range could be divided into quartiles (4 groups); etc. Most variables can be subdivided this way.

The Chi Square distribution then examines the differences between what we see (actual counts per group) and what we expect in each group. Once we have these two counts, the actual calculation of the Chi Square statistic is:

∑ (Observed count – Expected count)^2/(Expected count).

This is simply the sum (∑) of the squared differences between what we saw and what we expected) divided by our expected count. The expected values are obviously critical to outcomes with this test, and they can be developed in several different ways if they are not already known. These approaches depend upon the complexity of the situation and will be discussed below.

First, we will determine if the compa-ratios are evenly distributed in the quartiles; in theory, a compa-ratio generally ranges from .8 to 1.2; this range is the most typical found in companies. A second example will be closer to the question asked in the assignment. We will look at if the males and females are distributed in a pyramid shape – most in the lower grades, and fewer and fewer in the higher grades – typical of a hierarchical company pyramid shape.

Both of these tests will use counts (how many) rather than the measurements (how much) we have been using to date.

The Chi Square tests use the difference between an actual distribution/counts and an expected distribution to reach decisions on the similarity or difference in patterns. One of the simplest examples of when to use this test is in testing the “fairness” of a single 6-sided die (half of a pair of dice). Over the long run, if we tossed it a “lot of times” we would expect to see each of the 6 numbered faces show up the same number of times. Of course, over a somewhat smaller number of tosses, say 60, we would not expect to see exactly the same number for each face, but would expect the counts to be close. Comparing the actual counts of how many times each face number showed with the expected count of 10 (which equals the number of tosses in out sample of 60 divided by the number of possible outcomes or groups which equal 6) for each face, would give us our answer on whether the die was fair or biased.

This lecture will look at two related Chi Square tests. The first, called the Goodness of Fit Test, involves a single row of counts, such as with the die example above. The second is called the Contingency Table analysis involves multiple rows in the table, such as we might have if we looked at how males and females were distributed for some measure. Both are calculated the same way.

Chi Square

Two input tables are required for all Chi Square test set-ups. The first table is the “actual” or “observed” counts, a table showing how many items fit into each group we care about. The second is a table showing the expected counts.

Example

The assignment does not ask for a simple 1 row table of counts, a Goodness of Fit test; but we will start with this simple example first. In the goodness of fit test, our table is a single row showing the counts. For example, the number of employees in each grade. In keeping with looking at compa-ratios in these lectures, let’s examine if the compa-ratios are evenly distributed by quartile for our company.

Since we have 50 in our sample, an equal distribution would have 12.5 in each quartile (50/4 groups). We can have decimal values in the “expected” table, even if that is not realistic for actual counts, as the expected count is more of a theoretical value. Note that the expected frequency could be an actual count that is felt to be desired or required rather than a theoretical value.

This just leaves us with the job of counting how many values are within each quartile. Quartile 1 is any value up to but not including .90; Quartile 2 runs from .90 up to but not including 1.0; Quartile 3 ranges from 1.0 up to but not including 1.10; and quartile 4 includes any values of 1.10 and above. (Note that these ranges allow for the possibility that some compa- ratios might be outside of the normal limits of .80 thru 1.20.)

The process for this Goodness of Fit test involves the following actions. Note the following about this test set-up. First, the raw compa-ratios values were posted in Column AM, and then sorted from low to high. Quartile changes were highlighted in yellow for counting ease. The counts for each quartile were entered into the data table actual row (cells AH78 thru AK78) while the expected frequency values were entered into cells AH79 thru AK79. Both rows have the same total (50); this is a key check to see if the data was entered properly.

The first four steps in our hypothesis testing procedure are similar to what we have seen before. In step 1, we translated our research question (are the compa-ratios distributed evenly by quartile) into the null hypothesis (Ho: Compa-ratios are distributed evenly) and alternate (not evenly distributed). Steps 2 thru 4 are the same as in previous examples with the Chi Square statistic and Test identified as what we will be using in Step 3.

Step 5 can be completed in a couple of ways. The fastest is by using the Fx statistical function CHISQ.TEST(Actual range, Expected range). This will provide the p-value as its

outcome, and we can compare this to our alpha value and make our decision on rejecting or failing to reject the null hypothesis.

(For those interested in working out the Chi Square steps, we can use the Fx Statistical function, CHISQ.DIST(Chi Square value, df, True); this gives us the probability or area under the Chi Square distribution to the left of the Chi Square statistic; since we want the p-value (the area to the right or larger than our calculated value), we would use =1- CHISQ.DIST(Chi Square value, df, True). This involves determining the actual Chi Square values. The process for doing this will be explained in this week’s third lecture.)

In step 5, we see that the p-value is less than our alpha of 0.05, so we reject the null hypothesis and state that the compa-ratios are not evenly distributed. (HR might be upset at this finding.) The step 6 conclusion is that while the compa-ratios are not evenly distributed, this does not help our equal pay question as the difference between males and females was not examined for this question.

Here is a screen shot of the entire output. (Note that for this example, steps 5 and 6

are not exactly laid out as in the assignment file.

Example – Question 3

The third question for this week asks about employee grade distribution. We are concerned here about the possible impact of an uneven distribution of males and females in grades and how this might impact average salaries. While we are concerned about an uneven distribution, our null hypothesis is always about equality, so the null would respond to a question

such as are males and females distributed across the grades in a similar pattern; that is, we are either males or females more likely to be in some grades rather than others.

A similar question can be asked about degrees, are graduate and undergraduate degrees distributed across grades in a similar pattern? If not, this might be part of the cause for unequal salary averages.

The data for this test would be found in a contingency table with rows showing the degree and columns showing grades. Set-up of this table is fairly simple and involves copying the variables we want (grade and Deg, in this example), sorting them by grade and then Deg, and simply counting how many fit each cell (degree – grade match). Our final actual count table is shown below.

Deg Grade 0 A

Place the actual distribution in the table below. 0 A A B C D E F Total 0 A

UnderG 7 5 3 2 5 3 25 0 A Grad 8 2 2 3 7 3 25 0 A Total 15 7 5 5 12 6 50 0 A

The second table for each form is the expected value table. It will have the same row and column totals as the actual table has. This is an important check to ensure that the tables are set up correctly. The set-up of the Contingency Table Expected values is slightly more complicated than for the Goodness-of-Fit expected table.

In general, we do not have a specific expected frequency count for these tables, so we need to create them using the information available to us from the Actual table. For each cell in the Expected table, we multiply its row total times its column total and divide by the grand total (50). For example, in the above table, the expected entry for Grad in grade D would be the Grad total (25) times the Grade D total (5) divided by the grand total (50); this gives us 25*5/50 = 2.5 for that cell. We can use the cell formulas shown below to create the first column values, and drag them across the rows thru grades B to F. See the screen print below.

Now that we have our data tables created, we can look at performing the Chi Square Contingency Table analysis using the hypothesis testing procedure.

Step 1: Ho: Grad and Undergrad degrees are distributed in a similar fashion.

Ha: Grad and Undergrad degrees are not distributed in a similar fashion.

(Note that an alternate wording could be that Degrees and grades are unrelated (not correlated) versus the alternate that they are significantly correlated. Both interpretations are appropriate for the contingency table test.)

Step 2: Alpha = 0.05

Step 3: Chi Square statistic and Contingency table test, used for count data

Step 4: Decision Rule: Reject the null hypothesis if the p-value is > 0.05.

Step 5: Conduct the test.

As with the F and T-tests, we use the Fx (or Formulas) list of statistical tools. The CHISQ.TEST function has inputs for the actual and Expected ranges and returns the p-value. This data entry is exactly the same as we saw in the F and T-test examples last week. The Chi square does not have a function listed in the Data | Analysis functions. We get a p-value of 0.85 (rounded) using =CHISQ.TEST(L58:Q59,L63:Q64). Note that the row and total column values are NOT included in the data ranges. (See the above screen print of the input tables.)

Step 6: Conclusion and Interpretation

What is the p-value? 0.85

Decision on rejecting the null: Do Not Reject the null hypothesis

Why? P-value is > 0.05.

Conclusion on impact of degrees? Degrees are distributed equally across the grades and do not seem to have any correlation with grades. This suggests they are not an important factor in explaining differing salary averages among grades.

Here is a video on Chi Square: https://screencast-o-matic.com/watch/cb6jffIk8T

NOTE: There are some issues with both versions of the Chi Square test when we have 20% or more of the cells with expected values less than 5. In most cases, this presents a p-value that is too small, potentially causing incorrect rejections of the null. There are conflicting recommendations on what to do with this issue. Some say make what is called the Yates’ correction (do a search on this), others say combine columns to reduce the number of small cells, and still others say just be aware of this if your rejection p-value is close to alpha. We are choosing not to emphasize this issue, but merely leave it up to you to investigate if it becomes a concern in your professional life.

Question 4

Having looked at grade mean differences for compa-ratios and educational degree distribution, neither seems to help answer our equal pay question. The compa-ratios show that not all of the grades have an equal average, with some senior grades having higher averages than the lower grades. This could be due to poorly aligned midpoints (higher midpoints would lower the average compa-ratios in those grades) or to a pattern of paying relatively more for the higher graded work. We do not know right now. At any rate, since none of this week’s analysis focused on gender, we have not really gained any additional insights into pay practices based on gender.

Please ask your instructor if you have any questions about this material.

When you have finished with this lecture, please respond to Discussion thread 3 for this week with your initial response and responses to others over a couple of days before reading the third lecture for the week.