Graphical Analysis Techniques & Examples of Graphical Analysis Techniques in Research

profileclw0dq8
Week2Lecture.docx

Week 2 Lecture

Last week we looked at describing data sets.  We looked at summary statistics for location, variation/consistency, position, and likelihood.  While discussing consistency and variability within the data, the need often arises to examine distribution patterns.  Distributions are a critical element of statistical analysis.  As we will see starting next week, a lot of our ability to make inferences about populations based on sample results depends on assumptions about data distribution patterns.

We start our discussions about data patterns and distributions by examining some graphical analysis techniques; describing and organizing the data visually to see what insights might be gained.  Tables and graphs are some of the best techniques to display the characteristics of the data – clustering, dispersion, center, outliers, even shape are all important elements in understanding what the data is telling us.

Visual conclusions fall into the realm of qualitative findings.  While many feel comfortable making claims based on these observations, others feel that as useful as these initial observations may be, claims must be tested and verified with quantitative approaches such as experimentation, additional sampling, and inferential statistical tests.

The ultimate goal of graphical displays is to illuminate relationships in the data; make things clearer.

Graphs and Tables

Tables

Tables or frequency tables show numerical counts and percentages.  Single variable tables generally show frequencies and relative frequencies Multi-variables, also known as crosstabulation tables, show counts between and among the variables.  The Excel tool Pivot Table will create these kinds of tables.

Graphs

It has often been said that “a picture is worth a thousand words” for their ability to display relationships and detail that are often missed or hard to describe otherwise.  This is the strength – and weakness – of graphs.  Done well, they illuminate patterns and relationships; done poor – either intentionally or thru design errors – they can distort and hide key data issues.

Types of graphs

While there are literally dozens of graph types, we will look at only a few of the most commonly used.  These include bar graphs, column and histogram graphs, line graphs, scatter diagrams, and pie charts.  The general purpose of each of these is to provide a visual representation of the variation within data sets.

Bar and Column Graphs.  These graphs are very similar as both display frequency counts for unique groups or attributes.  Bars are shown horizontally, while columns are vertical.

Dot Plots.  These graphs use dots to represent data points along a single numerical axis.  Multiple values result in vertical columns of dots.  The data points may be individual values or ranges grouped into “bins.”

Histograms.  These graphs have some characteristics similar to both the dot plots and column graphs.  They are columns that touch each other and show counts for how many values of a continuous measurement are within each bin or range.  Generally, they have between 5 to 7 bins depending upon the number of data points.

Line Graphs.  These graphs show trends over time or groups.  They are used in quality control as statistical process control charts.

Scatter Diagrams.  These graphs use dots to show the relationship between pairs of measurements.  Often, a regression line will be added to show the linear relationship.

Pie Charts.  These circular charts show the percent or proportion each group is of the whole.

Excel Tool.  The Insert tab on Excel’s main ribbon allows for the creation of tables, charts, and graphs.

Interpretation Issues – What to Look For

We examine graphs and tables both for what they show and for what they don’t.  Obviously, look for what the graphs show:

· Trends

· Changes in trends, means, variation/spread

· Patterns and cycles

· Data clustering

· Outliers

· Data gaps or missing data

· Relationships and changes in relationships

· Randomness or non-randomness

In one of the Sherlock Holmes stories, he remarks about the strange case of the barking dog.  Watson says there was no barking dog, and Holmes replies, “exactly.”  (At least, according to the author’s memory.)  The point was, the dog should have barked if an evil-doer stranger was present, but it did not.  That missing data point suggested something.  The same is true with graphs, in addition to looking for what is there, look for what isn’t:

· Missing data, particularly with sharp drops at one end or the other indicating missing or not reported results

· Randomness - data that is “too” neat or perfect might have been manipulated

· Identical base comparison years or units, for example one measure based on hundreds and another on thousands will distort the relationship between them

How to Lie with Graphs

Graphs are wonderful at displaying information.  However, as much of their impact is visual, they can easily be distorted.  Here are a couple of tricks to watch out for.

One simple trick is to not start the y-axis with the value of 0.  This has the effect of stretching out vertical differences – a line that might look fairly flat if graphed with values starting at 0, could show a sharp increase with a restricted range in the y-axis. 

Another common distortion occurs with Column graphs.  Even though, the difference in bars should be judged solely on height, making one base much narrower and another much wider distorts the volume in the bars; and people form judgements more on volume comparisons than on strictly height – so the “fatter” bar will seem more significant.

Probability distributions

Statistical inference – making judgements about a population based on the results of samples – relies on two critical elements.  The first is having a random sample, one that as fairly represents the population as possible.  The other is an analysis based on the proper probability distribution.  Statistical inference is based on probability – the likelihood of getting the results we did given the population we assume we are dealing with.  For example, when we toss a pair of fair dice, we expect that that long-term average sum of the showing faces will be 7.  If  we toss a pair of dice 100 times and get an average of 3, we rightly assume something is wrong as the probability of getting 3 with a pair of fair dice is quite low for even a single value much less for the average.

Reading and Interpreting Distributions

Let’s use the example of tossing a pair of dice to build and interpret a probability distribution.   When we toss a pair of dice, we have 36 possible outcomes resulting in values from 2 to 12 showing on the top faces.

In theory, we have a 1/36 probability of getting a 2, (1 showing on each face), a 2/36 probability of getting a 3(1,2 or 2,1), a 3/36 probability of getting a 4(1,3,2,2,3,1)) etc.  The complete theoretical probability distribution for these values is shown in the histogram below.  The graph shows the value of the sum of the top faces of the two dice on the x (horizontal) axis and the number of ways that the value can be formed on the y (vertical) axis.  As noted, we can form the value 3 only 2 ways, and this gives us a probability of 2/36 = 0.056 or 5.6% chance of getting a 3 when we toss a pair of dice.

Let’s use this histogram to learn about probability distributions.  Some basics:

· The area under the entire curve (or sum of the bar areas in this case) equals 1.00; meaning that one of the outcomes must occur.

· The probability of a single outcome (example rolling a 9) equals the area for the outcome listed on the x-axis.

· The probability for multiple outcomes, such as getting an 11 or 12, is the sum of the probabilities for each value (since each outcome is mutually exclusive and independent of each other).

· We define the term “p-value” as the probability of getting a value equal to or more extreme than any specific value. For example, the p-value for an outcome of 10, would be the probability of getting a 10, 11, or 12; just as the p-value for a value of 5 would be the probability of getting a 2,3 ,4 ,or 5.

So, with these “ground rules,” let’s explore how to use this probability distribution to understand the outcomes.

Example 1.  What is the probability of getting a 7 on any given toss?

Since we can get a 7 in any of 6 ways, the probability is 6/36 or .17

Example 2.  What is the probability of getting a 6, 7, or 8 on any given toss?

We can get a 6 in 5 different ways, a 7 in 6 ways, and an 8 in 5 ways, so in total we have a probability of (5 + 6 + 5)/36 which equals 16/36 = .44.  We simply add up the probabilities of each separate outcome, which is the same as adding the area for these outcomes.

Example 3.  What is the probability of getting any value larger than 4?

This asks about getting the values of 5, 6, 7, 8, 9, 10, 11, or 12.  We could, of course, simply add the areas for each to get the answer; but a simpler way exists.  We know that the probability of getting 2 – 4 [P(2, 3, or 4)] plus the probability of getting 5 – 12 [P(5 thru 12)] must equal 1, as these two probabilities encompass the entire range of possible outcomes.  So, if P(2, 3, or 4) + P(5 thru 12) = 1; then it makes sense to say that P(5 thru 12) = 1 -  P(2, 3, or 4).  This is called the compliment rule. It is often easier to find the probability of the opposite of an event and use the complement rule to find the desired probability.  In this case, P(2, 3, or 4) = (1 + 2 + 3)/36 = 6/36.  So P(5 thru 12) = 1 -  P(2, 3, or 4) = 1- 6/36 = 30/36 or .83.

Example 4.  What is the p-value of getting a 4 or less?  10 or more?

Recall that a p-value is the probability of getting a specific result or a more extreme result.  When looking from the center of the distribution, the more extreme results than 4 would include getting a 3 or a 2.  So, the P-value would be the probability of getting P(2, 3, or 4), which we calculated above as 6/36 or .17

The same thinking applies to getting a 10 or more, the related more extreme outcomes would be 11 or 12.  Since we have a symmetrical distribution, the probability 10, 11 or 12 is the same as that of 2, 3, 4 or .17.

Example 5.  What is the probability of getting between 5 and 9 on a single toss?

This would equal the P(5 thru 12) minus P(10, 11 or 12).  Since we know both of these values from examples 3 and 4, we get 30/36 – 6/36 = 24/36 = .67.

These 5 examples cover the most common situations encountered with a probability distribution.  In the case of discrete outcomes, we could do something line the odds of getting an even or odd outcome; this would simply equal adding the column areas for each of the appropriate values.

Normal Curve.  One of the most commonly used probability distributions in statistics is the normal curve, AKA bell shaped curve.  The normal curve looks much like the histogram we used above with the bars shrunk down to almost no width.  The normal curve values run from minus infinity to plus infinity, but the practical range is much smaller.  The mean = median = mode for the curve, and each side is symmetrical.  As with our histogram above, the area under the normal curve equals 1.0.

A specialized case of the normal curve, called the standard normal curve, has a mean of 0 and a standard deviation of 1.0.  We get the standard normal curve from any normal curve by subtracting the mean from each value, and then dividing the result by the original standard deviation.  This allows us to determine probabilities of any outcome using one curve rather than needed to calculate values from different curves all the time.  And, as we might hope, Excel will do all the math involved for us.  (Actually, Excel will do the math for any normal curve as well.)

Some key functions, found in the Fx and Formulas lists, include the following.  Note that formulas having “.S.” in the middle are for the standard normal curve; without the s are for any normal curve distribution.

· DIST(VALUE, MEAN, STANDARD DEVIATION, CUMMULATIVE), gives the total area/probability to the left of the stated value for a normal curve with a specified mean and standard deviation and cumulative = True or 1. (Note if cumulative is false or 0, we get the height of the curve for graphing purposes.) Example: =NORM.DIST(10, 8, 2, true) = 0.8413 (rounded).

· INV(PROBABILITY, MEAN, STANDARD DEVIATION) returns the numerical value for the given probability. Example =NORM.INV(0.8413,8,2) = 10 (rounded).

· S.DIST(value, cumulative) gives the area/probability of the given z-score value or less with cumulative set to true or 1. Example: =NORM.S.DIST(1.96, TRUE) = 0.975.

· S.INV(Probability) returns the Z-score associated with the given probability. Example: =NORM.S.INV(0.975) = 1.96.

With these functions, we can do the same kinds of probability calculations we did with our dice and the histogram.  Some examples follow.

Example 1.  What is the probability of getting a result exactly in the middle of the distribution, a z-score of 0.00.  Note, since the normal curve extends so far, the probability of each specific value is technically 0 (any value divided by 2*infinity).  However, since specific events and values do occur, we create a range by making an adjustment.  Since z-scores are typically reported to two decimal places, we add +/-0.005 to the score for our range.  So, the area or probability for a z-score of 0 would be the area under the range between -0.005 to +0.005.  We then find the larger area (the largest value) and subtract the smaller area from it.  This, for our example equals a probability =norm.s.dist(0.005,1) – norm.s.dist(-0.005,1) = 0.003989 or 0.004 (rounded).

Example 2.  What is the p-value of exceeding a z-score of 1.96?  Excel does not directly calculate probabilities of exceeding a value, so we need to use the compliment rule whenever we are asked for a probability exceeding a value.  Since we are again working with a z-score, we use the standard normal curve functions: =1-NORM.S.DIST(1.96,1) = 1-0.975 = 0.025.

Example 3.  What is the p-value of getting less than a z-score of -1.96?  The probability of getting a score up to any value is directly found from Norm.s.dist, so this question is answered by =NORM.S.DIST(-1.96,1) = 0.025 (rounded).

With these three approaches, you can find any normal curve probability based on a z-score.  If you have means and standard deviations, the same logic applies but you would use the normal curve functions that do not contain the “.S.” term.

T Curve.  A special family/set of normal curves are used when we estimate the mean and standard deviation from sample values.  These curves are somewhat flatter and more elongated than the standard normal curve.  Additionally, a separate curve exists for each sample size that we might use.  The good news is that Excel does all the work for these curves as well.  And, as we will see, these curves are used more often than the standard normal curve in statistical analysis.

The key difference with the T curves is the idea of degrees of freedom (df).  For the t distribution, df = the sample size -1 (n -1); and this value is used in the Excel functions.  The t-related Excel functions, also found in Fx and Formulas, are:

· DIST(t-value, df, cumulative) – the p-value (probability) for this value or less, for example, =T.DIST(2.228,10,1) = 0.975 (rounded). 1-T.DIST(t-value, df, 1) would be the p-value for a positive t-value. T.DIST(-2.228,10,1) = 0.025; this would be the p-value for a negative t-value.  As with NORM.DIST, using false or 0 for the cumulative value gives us the value to graph the t-distribution.

· DIST.2T(t-value, df) – probability of getting a value between (minus t-value) and  (plus t-value), for example, =T.DIST.2T(2.228,10) = 0.05 (rounded)

· DIST.RT(t-value, df) – p-value (probability) of getting this value or more, for example, =T.DIST.RT(2.228,10) = 0.025 (rounded), the p-value for a positive t-value.

· INV(probability, df) – the t-value that has probability of being this large or smaller, for example =T.INV(.95,10) = 1.812.

· INV.2T(probability, df) - - the t-value that cuts of probability/2 in each side/tail; for example T.INV.2T(0.05, 10) = 2.228. The probability of equaling or exceeding +2.228 is 0.025, while the probability of equaling or being less than -2.228 is 0.025.

Using these functions to find values and probabilities for ranges is done in a similar fashion as with the normal curve examples shown above.