Empirical Project 2 Working in Excel
Part 2.1 Collecting data by playing a public goods game
Note
You can still do Parts 2.2 and 2.3 without completing this part of the project.
Before taking a closer look at the experimental data, you will play a public goods game like the one in the introduction with your classmates to learn how experimental data can be collected. If your instructor has not set up a game, follow the instructions below to set up your own game.
Instructions How to set up the public goods game
Form a group of at least four people. Choose one person to be the game administrator. The administrator will monitor the game, while the other people play the game.
Administrator
 Create the game: Go to the ‘Economics Games’ website, scroll down to the bottom of the page, and click ‘Create a Multiplayer Game and Get Logins’. Then click ‘Externalities and public goods’. Under the heading ‘Voluntary contribution to a public good’, click ‘Choose this Game’. Enter in the number of people playing the game, and select ‘1’ for the number of universes. Then click ‘Get Logins’. A popup will appear, showing the login IDs and passwords for the players and for the administrator.
 Start the game: Give each player a different login ID. The game should be played anonymously, so make sure that players do not know the login IDs of other players. You are now ready to start the first round of game. There are ten rounds in total.
 Confirm that all the rounds are complete: On the top right corner of the webpage, click ‘Login’, enter your login ID and password, and then click the green ‘Login’ button. You will be taken to the game administration page, which will show the average contribution in each round, and the results of the round just played. Wait until all the players have finished playing ten rounds before refreshing this page.
 Collect the game results: Once the players have finished playing ten rounds, refresh this page. The table at the top of the page will now show the average contribution (in euros) for each of the ten rounds played. Select the whole table, then copy and paste it into a new worksheet in Excel.
Players
 Login: Once the administrator has created the game, go to the ‘Economics Games’ website. On the top right corner, click ‘Login’, enter the login ID and password that your administrator has given you, then click the green ‘Login’ button. You will be taken to the public goods game that your administrator has set up.
 Play the first round of the game: Read the instructions at top of the page carefully before starting the game. In each round, you must decide how much to contribute to the public good. Enter your choice for each universe (group of players) that you are a part of (if the same players are in two universes, then make the same contribution in both), then click ‘Validate’.
 View the results of the first round: You will then be shown the results of the first round, including how much each player (including yourself) contributed, the payoffs, and the profits. Click ‘Next’ to start the next round.
 Complete all the rounds of the game: Repeat steps 2 and 3 until you have played ten rounds in total, then collect the results of the game from your administrator.
The results from your game will look like Figure 2.1. In the questions below you will compare your results with those in Figure 3 of Herrmann et al. (2008), but first you need to reformat your table to look like Figure 2.2. Follow the steps in Excel walkthrough 2.1 to reformat your table.
Round  10  9  8  7  6  5  4  3  2  1 

Average contribution 
A table formatted with ‘Round’ and ‘Average contribution’ as the row variables.
Round  Average contribution 

1  
2  
3  
4  
5  
6  
7  
8  
9  
10 
A table formatted with ‘Round’ and ‘Average contribution’ as the column variables.
Excel walkthrough 2.1 Reformatting a table
Use the results of the game you have played to answer the following questions.
 Make a line chart with average contribution as the vertical axis variable, and period (from 1 to 10) on the horizontal axis. Describe how average contributions have changed over the course of the game.
Excel walkthrough 2.2 Drawing a line chart with multiple variables
Follow the walkthrough in the CORE video, or in Figure 2.4, to find out how to draw a line chart with multiple variables in Excel.
 Compare your line chart with Figure 3 of Herrmann et al. (2008).^{1} Comment on any similarities or differences between the results (for example, the amount contributed at the start and end, or the change in average contributions over the course of the game).
 Can you think of any reasons why your results are similar to (or different from) those in Figure 3? You may find it helpful to read the ‘Experiments’ section of the Herrmann et al. (2008) study for a more detailed description of how the experiments were conducted.
Part 2.2 Describing the data
We will now use the data for Figures 2A and 3 of Herrmann et al. (2008), and evaluate the effect of the punishment option on average contributions. Rather than compare two charts showing all of the data from each experiment, as the authors of the study did, we will use summary measures to compare the data, and show the data from both experiments (with and without punishment) on the same chart.
 variance
 A measure of dispersion in a frequency distribution, equal to the mean of the squares of the deviations from the arithmetic mean of the distribution. The variance is used to indicate how ‘spread out’ the data is. A higher variance means that the data is more spread out. Example: The set of numbers 1, 1, 1 has zero variance (no variation), while the set of numbers 1, 1, 999 has a high variance of 2178 (large spread).
First, download and save the data. The spreadsheet contains two tables:
 The first table shows average contributions in a public goods game without punishment (Figure 3).
 The second shows average contributions in a public goods game with punishment (Figure 2A).
You can see that in each period (row), the average contribution varies across countries, in other words, there is a distribution of average contributions in each period.
The mean and variance are two ways to summarize distributions. We will now use these measures, along with other measures (range and standard deviation) to summarize and compare the distribution of contributions in both experiments.
Before answering these questions, make sure you understand mean and variance, and how to calculate these measures in Excel.
 See Figure 1.5 in Exercise 1.3 of Economy, Society, and Public Policy for more information about the mean.
 See Excel walkthrough 1.6 for more information about the variance.
 Using the data for Figures 2A and 3 of Herrmann et al. (2008):
 Calculate the mean contribution in each period (row) separately for both experiments, using Excel’s AVERAGE function.
 Plot a line chart of mean contribution on the vertical axis and time period (from 1 to 10) on the horizontal axis (with a separate line for each experiment). Make sure the lines in the legend are clearly labelled according to the experiment (with punishment or without punishment).
 Describe any differences and similarities you see in the mean contribution over time in both experiments.
 Instead of looking at all periods, we can focus on contributions in the first and last period. Plot a column chart showing the mean contribution in the first and last period for both experiments. Your chart should look like Figure 2.6 below.
Excel walkthrough 2.3 Drawing a column chart to compare two groups
Follow the walkthrough in the CORE video, or in Figure 2.5, to find out how to draw a column or bar chart in Excel.
 variance
 A measure of dispersion in a frequency distribution, equal to the mean of the squares of the deviations from the arithmetic mean of the distribution. The variance is used to indicate how ‘spread out’ the data is. A higher variance means that the data is more spread out. Example: The set of numbers 1, 1, 1 has zero variance (no variation), while the set of numbers 1, 1, 999 has a high variance of 2178 (large spread).
The mean is one useful measure of the ‘middle’ of a distribution, but is not a complete description of what our data looks like. We also need to know how ‘spread out’ the data is in order to get a clearer picture and make comparisons between the distributions. The variance is one way to measure spread—the higher the variance, the more spread out the data is.
 standard deviation
 A measure of dispersion in a frequency distribution, equal to the square root of the variance. The standard deviation has a similar interpretation to the variance. A larger standard deviation means that the data is more spread out. Example: The set of numbers 1, 1, 1 has a standard deviation of zero (no variation or spread), while the set of numbers 1, 1, 999 has a standard deviation of 46.7 (large spread).
A similar measure is standard deviation, which is the square root of the variance. Standard deviation is commonly used because it provides a handy rule of thumb for large datasets—most of the data (95% if there are many observations) will be two standard deviations away from the mean.
 Using the data for Figures 2A and 3 of Herrmann et al. (2008):
 Calculate the standard deviation for Periods 1 and 10 separately, for both experiments. Does the rule of thumb apply? (In other words, are most values within two standard deviations of the mean?)
 As shown in Figure 2.6, the mean contribution for both experiments was 10.6 in Period 1. With reference to your standard deviation calculations, explain whether this means that the two sets of data are the same.
Excel walkthrough 2.4 Calculating the standard deviation
Follow the walkthrough in the CORE video, or in Figure 2.7, to find out how to calculate standard deviation in Excel.
 range
 The interval formed by the smallest (minimum) and the largest (maximum) value of a particular variable. The range shows the two most extreme values in the distribution, and can be used to check whether there are any outliers in the data. (Outliers are a few observations in the data that are very different from the rest of the observations.)
Another measure of spread is the range, the interval formed by the smallest (minimum) and the largest (maximum) values of a particular variable. For example, we might say that the number of periods in the public goods experiment ranges from 1 to 10. Once we know the most extreme values in our dataset, we have a better picture of what our data looks like.
 Calculate the maximum and minimum value for Periods 1 and 10 separately, for both experiments.
Excel walkthrough 2.5 Finding the minimum, maximum, and range of a variable
 A concise way to describe the data is in a summary table. With just four numbers (mean, standard deviation, minimum value, maximum value), we can get a general idea of what the data looks like.
 In Excel, create a summary table as shown in Figure 2.9 below. Make three more summary tables, for Period 10 (without punishment), Period 1 (with punishment), and Period 10 (with punishment). Use your answers to Questions 2 to 4 to complete the summary tables.
 Comment on any similarities and differences in the distributions, both across time and across experiments.
Mean  Standard deviation  Minimum  Maximum  

Contribution (Period 1, without punishment) 
A summary table for contributions in a given period.
Part 2.3 Did changing the rules of the game have a significant effect on behaviour?
The punishment option was introduced into the public goods game in order to see whether it could help sustain contributions, compared to the game without a punishment option. We will now use a method called a hypothesis test to compare the results from both experiments more formally.
By comparing the results in Period 10 of both experiments, we can see that the mean contribution in the experiment with punishment is 8.5 units higher than in the experiment without punishment (see Figure 2.6). Is it more likely that this behaviour is due to chance, or is it more likely to be due to the difference in experimental conditions?
 You can conduct another experiment to understand why we might see differences in behaviour that are due to chance.
 First, flip a coin six times, using one hand only, and record the number of times that you get ‘heads’. Then, using the same hand, flip a coin six times and record the number of times that you get ‘heads’.
 Compare the outcomes from Question 1(a). Did you get the same number of heads in both cases? Even if you did, was the sequence of the outcomes (for example. heads, then tails, then tails …) the same in both cases?
The important point to note is that even when we conduct experiments under the same controlled conditions, due to an element of randomness, we may not observe the exact same behaviour each time we do the experiment.
 statistically significant
 When a relationship between two or more variables is unlikely to be due to chance, given the assumptions made about the variables (for example, having the same mean). Statistical significance does not tell us whether there is a causal link between the variables.
If the observed differences are not likely to be due to chance, then we say the differences are statistically significant. To determine whether the differences in means is statistically significant or not, we need to consider the size of the difference relative to the standard deviation of both distributions (how spread out the data is).
The fact that statistical significance relies on a relative comparison is very important. The size of the difference alone cannot tell us whether something is statistically significant or not. In fact, even if the observed differences are large, it is not a guarantee that the differences are statistically significant. Figure 2.10 and 2.11 show the mean exam score of two groups (represented by the height of the columns, and reported in the boxes above the columns), with the dots representing the underlying data. Figure 2.10 shows that a relatively large difference in means is not statistically significant because the data is widely spread out (the standard deviation is large), while Figure 2.11 shows that a relatively small difference is statistically significant because the data is tightly clustered together (the standard deviation is very small). In Figure 2.10, the difference in means is likely to be due to chance, but in Figure 2.11, the difference in means is not likely to be due to chance.
 hypothesis test
 A test in which a null (default) and an alternative hypothesis are posed about some characteristic of the population. Sample data is then used to test how likely it is that these sample data would be seen if the null hypothesis was true.
 pvalue
 The probability of observing the data collected, assuming that the two groups have the same mean. The pvalue ranges from 0 to 1, where lower values indicate a higher probability that the underlying assumption (same means) is false. The lower the probability (the lower the pvalue), the less likely it is to observe the given data, and therefore the more likely it is that the assumption is false (the means of both distributions is not the same).
To determine statistical significance, we conduct a hypothesis test, which uses the size of the difference and the standard deviation to calculate the probability (called a pvalue) of seeing the data we observe, assuming that the means of both distributions are the same. Since the pvalue is a probability, it ranges from 0 to 1 (inclusive). The smaller the probability (the smaller the pvalue), the less likely it is that we will observe the given data, so the more likely it is that our assumption is false (in other words, the means of both distributions are not the same).
 significance level
 A cutoff probability that determines whether a pvalue is considered statistically significant. If a pvalue is smaller than the significance level, it is considered unlikely that the differences observed are due to chance, given the assumptions made about the variables (for example, having the same mean). Common significance levels are 1% (pvalue of 0.01), 5% (pvalue of 0.05), and 10% (pvalue of 0.1). See also: statistically significant, pvalue.
Our conclusions will depend on our definition of a ‘small’ probability. We define ‘small’ by choosing a cutoff (a percentage) also referred to as a significance level. Any probability smaller than that cutoff would be considered ‘small’. Some commonly used cutoffs are 1% (pvalue of 0.01), 5% (pvalue of 0.05), and 10% (pvalue of 0.1).
Find out more Hypothesis test
When we conduct a hypothesis test, we formulate a null hypothesis (in this case, that the two means are identical) and an alternative hypothesis (that the two means are different). At the end of the hypothesis test procedure, we will either reject the null hypothesis (sometimes called H_{0}) or not reject the null hypothesis. Essentially we will reject the null hypothesis if the pvalue (the probability of seeing data similar to the data observed if the null hypothesis was true) is smaller than a certain cutoff level. Some commonly used cutoffs are 1% (0.01), 5% (0.05) and 10% (0.10). If we reject the null hypothesis we also sometimes say that we have found a statistically significant difference at a (say) 5% significance level.
You may wonder how we should choose that cutoff level. Importantly this cutoff level describes the probability of a TypeI error. When we make decisions on sample data, as we do here, we may come to a conclusion that is erroneous. In particular we may actually reject the null hypothesis, while in reality the null hypothesis was true (which is what we call a TypeI error). The cutoff level above is equivalent to the probability of making a TypeI error. So if we chose a 5% cutoff (significance level) we implicitly accept that even if the null hypothesis was true, there is a 5% chance that we will reject it.
Now that we understand what this cutoff level represents (the probability of making a TypeI error if H_{0} is true), we can return to the initial question of what our cutoff (significance) level should be. There is not one ‘correct’ level, although 5% is a standard level people use without thinking (and that can cause problems). What matters is how costly a TypeI error is. If it is very costly, you should choose a small significance/cutoff level, perhaps even smaller than 1%. Would we want to set this significance level as low as possible to avoid such errors? The tradeoff when setting a lower significance level is that it is more difficult to reject the null hypothesis, even if it is incorrect (which of course we don’t know).
An example of such a situation is testing a new medication that is known to have significant sideeffects, but may be useful for a serious medical condition. We would start with the null hypothesis that the medication has no effect (H_{0}), and would only want to reject the null hypothesis if there is significant evidence that the medication is very useful for the intended purpose. But given that there are known significant sideeffects, we would want to keep the significance level low, so that we are not exposing patients to the side effects without any benefits.
To calculate the pvalue, we use a function in Excel called T.TEST.
 Using the data for Figures 2A and 3:
 Use Excel’s T.TEST function to calculate the pvalue for the difference in means in Period 1 (with and without punishment). What is the pvalue?
 With a cutoff of 5% (pvalue of 0.05), can we conclude that the difference in means is significant? Why or why not?
Excel walkthrough 2.6 Using Excel’s T.TEST function
 Using the data for Period 10:
 Use Excel’s T.TEST function to calculate the pvalue for the difference in means in Period 10 (with and without punishment). What is the pvalue?
 With a cutoff of 5%, can we conclude that the difference in means is significant? Why or why not?
 With reference to Figure 2.10 and 2.11, explain why we cannot use the size of the difference to directly conclude whether the difference in means is significant or not.
 spurious correlation
 A strong linear association between two variables that does not result from any direct relationship, but instead may be due to coincidence or to another unseen factor.
An important point to note is that statistical significance cannot tell us anything about causation. In the example of house size and exam scores shown in Figure 2.11, there was a statistically significant relationship between the two variables (students living in a threebedroom house had higher exam scores, on average, than students living in a twobedroom house). However, we cannot say that the larger size of the house was the cause of higher exam scores because it’s unlikely that building an extra room would automatically make someone smarter. Statistical significance cannot help us detect these spurious correlations.
However, experiments can help us determine whether there is a causal link between two variables. If we conduct an experiment and find a statistically significant difference in outcomes, then we can conclude that one variable is the cause of the other.
 Refer to the results from the public goods games.
 Which characteristics of the experimental setting make it likely that the punishment option was the cause of the change in behaviour?
 With reference to Figure 2.6, explain why we need to compare the two groups in Period 1 in order to conclude that there is a causal link between the punishment option and behaviour in the game.
Experiments can be useful for identifying causal links. However, if people’s behaviour in experimental conditions were different from their behaviour in the real world, our results would not be applicable anywhere outside the experiment.
 Discuss some limitations of lab experiments, and suggest some ways to address (or partially address) them. (You may find pages 158–171 of the paper ‘What do laboratory experiments measuring social preferences reveal about the real world?’ helpful, as well as the discussion on freeriding and altruism in Section 2.6 of Economy, Society, and Public Policy.)

Benedikt Herrmann, Christian Thöni, and Simon Gächter. 2008. Figure 3 in ‘Antisocial punishment across societies’. Science Magazine 319 (5868): p. 1365. ↩