Statistics

You are currently browsing articles tagged Statistics.

Let us assume that our null hypothesis is that when someone is sick, it is not swine flu.  A type I error is a false positive.  That is, we claim that the person has the swine flu, when actually then do not.  A type II error is a false negative.  This means that the person has swine flu, but we erroneously conclude that they do not.

What is the probability that someone who has flu-like symptoms actually has swine flu?  We can calculate this using Bayes Rule:

  • P(H1N1|symptoms) = P(Symptoms|H1N1)*P(symptoms)/P(H1N1)

Let us assume that all individuals with swine flu have symptoms so that P(Symptoms|H1N1)=1.  Let us assume 2% of the population gets any type of flu each year and displays symptoms.  Let us assume only .02% of the population gets H1N1.  So, P(symptoms)=0.02 and P(H1N1)=.0002.  Thus we have:

  • P(H1N1|symptoms) = 1*0.02/0.002=.01. 

This means that if we see a random person with the flu like symptoms, there is only a 1% chance that they actually have the swine flu.  

This may explain why the CDC and WHO ignored early warnings from a Washington-based biosurveillance company concerning a possible flu outbreak.  Although there was an increase in the number of cases of influenza, the probability that it was an outbreak of H1N1 (or any type of outbreak) was low.  Although  probability of a false positive was high, the cost of a false negative is also large.  Ex-post, it is obvious that the CDC and WHO should have acted quicker to fight the spread H1N1.  Ex-ante, these organizations likely receive numerous reports of potential outbreaks and acting on every single one–most of which turn out to be false–would be very costly.  Identifying the optimal time to initial school closings and public health warnings is very difficult and must take into account both the probabilities and the costs of type I and type II errors.

Tags: ,

Let us say you have 10 observations of 2 different variables.  How do you determine which of the observations to use?  Should you throw out the outliers?  Should you only include the most similar values?  Does more observations increase or decrease the amount of measurement error?

These problems can be answered by the discipline of Statistics.  An interesting book by Stigler recounts The History of Statistics.  Astronomers lead many of the statistical advances in the seventeenth and eighteenth centuries.  Accurate measurement is very important to astronomers.  Further, observations with respect to the circumference and oblateness of the earth were made at different times and places throughout history.  This leaves a conundrum of  how best to combine these observations.

Mayer, Boscovich, and others contributed to the development of the idea of least squares, but Stigler credits Legendre with the invention of least squares.  Legendre came up with the idea in his attempt to measure the length of the median quadrant (the distance from the equator to the North Pole) through Paris.  

To demonstrate some of his ideas, I will use a simpler example.  Let us assume that a drug can have a dosage level between 0 and 5 and we want to find it’s impact on health (measured from a 0-10 scale).  Let us look at the following data.  The goal is to find the parameters m (slope) and b (intercept) that accurately measure the relationship between drug dosage and health (ignore any questions of endogeneity).  Should we include all 10 observations?

Although Euler recognized that including more observations increases the maximum possible error, Legendre realized that adding more observations also greatly increased the probability of getting close to the true value of the parameters of interest.  

In my example, we need to fit a line to measure the parameters m and b.  How do we set up the errors so that we have the most accurate calculations.  Laplace believed that the following two conditions would need to hold:

  1. Σi Dosagei*ei = 0
  2. Σi |Dosagei*ei| = minimum

The first condition basically says that the errors are uncorrelated with the independent variables on average.  The second condition hopes to minimize the errors.  Legendre extended Laplace’s second condition to minimize the sum of the squared errors rather than just the absolute error level.

Another key point is that this regression line must go through the “center of gravity.”  In my example, the average dosage for the ten observations is 2.2 and the average health level is 5.9.  This means the center of gravity is at the coordinates (2.2, 5.9).  In the solution in my example is to set m=1.1456 and b=3.3797.  We see that if we plug 2.2 into the equation, the output is 5.9; thus, the regression line does indeed go through the center of gravity.

Understanding the historical development of modern statistical techniques is an interesting task, and Stigler’s book enlightens the reader with much detail.

Tags: , , ,

This comic may cause you to laugh.

Tags: ,

The California HealthCare Foundation has a great document summarizing many useful Health Care Cost Statistics (see full text or fact sheet).  Some of the highlights:

  • Health Care spending as a percentage of GDP is projected to grow 16.0% of GDP in 2006 to 19.5% of GDP in 2017.
  • Average health care spending per capita was $7026 in 2006 and will grow to $7868 in 2008.
  • In 1962, Defense spending made up half of the federal budget, Social Security about 15% and Medicare had not yet been enacted.  By 2007, Defense spending is only 20% of the budget while Social Security makes up 21% and Medicare 16% and rising.
  • The U.S. has by far the highest health care spending as a percentage of GDP.  This table compares health care spending across different countries.
  • Hospitalization and Physician Services make up over 50% of health care spending.  This table gives the distribution of health care spending in the U.S. by type of service.
  • What are the drivers of the cost increases?  Price inflation and a change in the volume and mix of services provided.

Tags: ,

ANOVA

Let us say that you are a hospital administrator.  You are very clever and have come up with a system to score the quality of the work done by the physicians at your hospital.  To simplify things, lets assume that you only have 3 physicians who work at your hospital.  The physician’s scores are as follows:

  • Dr. Albert: 76, 85, 91, 67, 73 
  • Dr. Burns: 92, 90, 60, 79, 75
  • Dr. Collin: 50, 80, 83, 80, 74

The average score for Dr. Albert is 78.4, for Dr. Burns is 79.2 and for Dr. Collin is 73.4.  As the hospital administrator, you want to know whether these differences are due to differences in doctor quality or likely from random chance.  If there were only two doctor’s a t-test would suffice, but what tests can you use in the case of multiple doctors?

The solution to this is to run an ANOVA test.  How do we do this?  Follow these easy steps.

  1. Let j be the group number (j=a, b, c) and i be the number obervation within each group (i=1, 2,…,5)
  2. Calculate the mean of each group (μj): μa= 78.4; μb 79.2; μc= 73.4.
  3. Also calculate the mean of the entire sample. μ=77
  4. Now calculate the Sum of Squares within each group [SSwithin = ΣΣ (Xij - μj)2].  This shows how much variation there is for each doctor.
    • SSa = (76 – 78.4)2 + (85 - 78.4)2 + (91 - 78.4)2 (67 – 78.4)2 + (73.4 – 78.4)2 = 367.2 
    • SSb = 666.8
    • SSc = 727.2
    • SSwithin  = SSa + SSb +  SSc = 1761.2
  5. Now calculate the Sum of Squares between each group. [SSbetween =Σ njj - μ)2].  This shows how much variation there is across each of the doctor’s average score.
    • SSbetween = 5*(78.4 -77)2 + 5*(79.2 – 77)2 + 5*(73.4 – 77)2 = 98.8
  6. The F-statistic is calculated as the mean square (MS) statistic for the between and within sum of squares (SS).  How do we go from the SS to the MS?  That’s easy, we just divide both by the degrees of freedom.
    • MSwithin  = SSwithin/(N-J) = SSwithin/13.  This is because there are 15 observations and 3 doctors so 15-3=12.  Our answer here is: 1761.2/12 = 146.77
    • MSbetween = SSbetween/(J-1) = SSwithin/2. This is because there are 3 doctors, we have 3-2=4. Our answer here is: 98.8/2 = 49.4.
  7. Now we can calculate the F statistic as: F = MSbetween/MSwithin = 49.4/166.77 = .337
  8. If we look this up on an chart for F-statistics, we see that the probability that all 3 doctors are equally good is .721.  Thus, we fail to reject the null that all three doctors are equally good.

STATA

Is there an easier way to do this?  Yes.  If you have Stata, you could just use the score as the dependent variable and have dummy variables for Drs. A, B, an C. The you can run a statistical test that the coefficient estimate for Dr. A = the coefficient estimate for Dr. B = the coefficient estimate for Dr. C.  This will give you the same probability that the three doctors are equally skilled that we calculated manually above.

Tags: ,

My favorite team, the Milwaukee Brewers, is in town and I have gone to the first two games of the series (both wins). Unlike the recent dreadful history, this year the Brewers have the 2nd best record in the National League and are in the lead for the NL Wild Card. In honor of the Brewers visit to San Diego, today I will write a brief post of how statistics and baseball have intertwined.

Introduction

Baseball is a game where players a generally judged on a statistical basis. How many homeruns does a player hit? What is his batting average? What is the pitcher’s earned run average (ERA)?

The book Moneyball showed how the Oakland A’s were able to use advanced statistical analysis to put together a winning team despite having much lower financial resources compared to teams such as the Yankees, Red Sox and Cubs. While most fans are familiar with statistics such as ERA and on-base percentage (OBP), other, lesser-known statistics may help to reveal how good a player really is.

Lesser-known baseball statistics (from Hardball Times)

  • BABIPBatting Average on Balls in Play. This is a measure of the number of batted balls that safely fall in for a hit (not including home runs). The exact formula we use is (H-HR)/(AB-K-HR+SF). If a pitcher has a low BABIP , this indicates that they are have been “lucky” since most of the balls that have been hit have been caught and their actual ERA may be lower then their talent would suggest. If they have high BABIP, this generally means the pitcher is “unlucky” since most of the balls in play have been hits, so their ERA may inflated compared to their actual talent level.
  • FIP – Fielding Independent Pitching. a measure of all those things for which a pitcher is specifically responsible. The formula is (HR*13+(BB+HBP-IBB)*3-K*2)/IP, plus a league-specific factor (usually around 3.2) to round out the number to an equivalent ERA number. FIP helps you understand how well a pitcher pitched, regardless of how well his fielders fielded.
  • GPA – Gross Production Average. This is a variation of OPS, but more accurate and easier to interpret. The exact formula is (OBP*1.8+SLG)/4, adjusted for ballpark factor. The scale of GPA is similar to BA: .200 is lousy, .265 is around average and .300 is a star
  • K/9; BB/9; K/BB. These statistics are strikeouts/9 innings, walks/9 innings, and the ratio of strikeouts to walks. Since strikeouts and walks are wholely under the control of the pitcher, these statistics measure how good the pitcher’s stuff is (based on strikeouts) compared to how good his control is (based on the walks statistics).
  • OPSOn Base plus Slugging Percentage. A crude but quick measure of a batter’s true contribution to his team’s offense. On base percentage measure how often the player is able to reach base safely and slugging percentage takes into account the players power numbers (doubles, triples, HRs).
  • Pythagorean Record. A formula for converting a team’s Run Differential into a projected Won/Loss record. The formula is RS2/(RS2+RA2). Teams’ actual won/loss records tend to mirror their Pythagorean records, and variances can usually be attributed to luck. The Brewers record is currently 70-51, but their Pythagorean Record is 66-55, indicating that they have been somewhat lucky this year.
  • WHIP – Walks and Hits Per Inning Pitched. A variant of OBP for pitchers. This is a popular stat in rotisserie baseball circles.

Statistically Oriented Baseball Blogs and Websites

Tags: ,

The Kaiser Fast Facts website is a useful tool for any health researchers who need basic statistical information regarding medical care in the U.S.  The numerous slides filled with information-filled charts and graphs.

Tags: ,

For many years price increases in the medical sector has outpaced overall inflation by a significant amount. According to the Bureau of Labor Statistics, here is the increase in consumer prices over the last few years.

Year Medical CPI CPI Δ
2001 4.7 1.6 3.1
2002 5.0 2.4 2.6
2003 3.7 1.9 1.8
2004 4.2 3.3 0.9
2005 4.3 3.4 0.9
2006 3.6 2.5 1.1
2007 5.2 4.1 1.1
2008 (est.) 3.2 3.1 0.1
Average 4.2 2.8 1.5

Medical inflation is outpacing general inflation by an average of 1.5% per year. But is this measure of medical inflation accurately measured? Not according to paper by Joseph Newhouse (1992). Here are 4 reasons why not.

  1. Medical CPI measures input, not final goods. The CPI for medical services focuses on inputs such as physician visits or hospital days. However, the service the patient consumers is treatment for a specific disease. An increase or decrease in the requisite number of doctors visits is a change in the input towards treatment. A true measure of medical CPI would measure how the price to treat a disease changes over time.
  2. Actual Prices not observed. Generally, statisticians use the list price as the price of medical services. However, very few people pay this list price. Most individuals have insurance and these insurance companies negotiate bulk discounts. Thus, the list price is not the relevant price for most individuals.
  3. Quality changes. Even if one uses the same amount of inputs in treating a disease, the quality of medical care has likely increased over time. Of course, observing quality changes in medical care is extremely difficult.
  4. Medical CPI weight out-of-pocket expenses. Medical CPI weighs the cost to consumers of medical spending. However, since most people have health insurance, items which are paid more frequently out of pocket receive a higher weight. For instance, dental care is more frequently paid out of pocket and thus receives a higher weight in the CPI. [I am not sure if this weighting has changed in more recent versions of the medical CPI].

Tags: , ,

Newer entries »