Why do we overestimate others’ willingness to pay?

In this WPA, we will analyze data from Matthews et al. (2016): Why do we overestimate others’ willingness to pay? The purpose of this research was to test if our beliefs about other people’s affluence (i.e.; wealth) affect how much we think they will be willing to pay for items. You can find the full paper at http://journal.sjdm.org/15/15909/jdm15909.pdf.

Study 1

In this WPA, we will analyze data from their first study. In study 1, participants indicated the proportion of other people taking part in the survey who have more than themselves, and then whether other people would be willing to pay more than them for each of 10 items.

The following table shows a table of the 10 projects and proportion of participants who indicated that others would be more willing to pay for the product than themselves (Table 1 in Matthews et al., 2016).

Product Number Product Reported p(other > self)
1 A freshly-squeezed glass of apple juice .695
2 A Parker ballpoint pen .863
3 A pair of Bose noise-cancelling headphones .705
4 A voucher giving dinner for two at Applebee’s .853
5 A 16 oz jar of Planters dry-roasted peanuts .774
6 A one-month movie pass .800
7 An Ikea desk lamp .863
8 A Casio digital watch .900
9 A large, ripe pineapple .674
10 A handmade wooden chess set .732

Table 1: Proportion of participants who indicated that the “typical participant” would pay more than they would for each product in Study 1.

Study 1 variable description

Here are descriptions of the data variables (taken from the author’s dataset notes available at http://journal.sjdm.org/15/15909/Notes.txt)

  • id: participant id code
  • gender: participant gender. 1 = male, 2 = female
  • age: participant age
  • income: participant annual household income on categorical scale with 8 categorical options: Less than $15,000; $15,001–$25,000; $25,001–$35,000; $35,001–$50,000; $50,001–$75,000; $75,001–$100,000; $100,001–$150,000; greater than $150,000.
  • p1-p10: whether the “typical” survey respondent would pay more (coded 1) or less (coded 0) than oneself, for each of the 10 products
  • task: whether the participant had to judge the proportion of other people who “have more money than you do” (coded 1) or the proportion who “have less money than you do” (coded 0)
  • havemore: participant’s response when task = 1
  • haveless: participant’s response when task = 0
  • pcmore: participant’s estimate of the proportion of people who have more than they do (calculated as 100-haveless when task=0)

Revision- Loading and Saving data

  1. If you created an R project last week (I recommended calling it RCourse or something similar), open this R project again. If you did not create an R project, instead set your working directory (using setwd()) to the location of the Rcourse folder you created last week. There should be at least two folders in this working directory: data and R.

  2. Open a new R script and save it as wpa_4_LastFirst.R in the R folder.

  3. The data are stored at http://journal.sjdm.org/15/15909/data1.csv. Load the data into R by using read.table() into a new object called matthews.df.

  4. Using write.table(), save the data as a tab–delimited text file called matthews.txt in the data folder of your working directory.

  5. R also has its own file format in which you can save data. Using save(), save a copy of the matthews.df data in the .Rdata format.

  6. Look at the first few rows of matthews.df using head(), View(), and str()

  7. Clean your workspace by running rm(list = ls()). You can check it has worked by re-running head(), View(), or str() on matthews.df

  8. Reload the matthews data by using either load() or read.table(). Remember to use the correct file extension.

Data Frame Manipulation

  1. What are the names of the data columns?

  2. Currently gender is coded as 1 and 2. Let’s create a new character column called gender.a that codes the data as male and female.

  3. What percent of participants were male?

  4. What was the mean age?

  5. Create a new dataframe called product.df that only contain columns p1, p2, … p10 from matthews.df. (Hint: Use paste())

  6. The colMeans() function takes a dataframe as an argument, and returns a vector showing means across rows for each column of data. Using colMeans(), calculate the percentage of participants who indicated that the ‘typical’ participant would be willing to pay more than them for each item. Do your values match what the authors reported in Table 1?

  7. The rowMeans() function is like colMeans(), but for calculating means across columns for every row of data. Using rowMeans() calculate for each participant, the percentage of the 10 items that the participant believed other people would spend more on. Save this data as a vector called pall.

  8. Add the pall vector as a new column called pall to the matthews.df dataframe

  9. What was the mean value of pall across participants? This value is the answer to the question: “How often does the average participant think that someone else would pay more for an item than themselves?”

  10. I created a new table containing fictional demographic information about each participant. The data are stored in a tab–delimited text file (with a header row) at http://nathanieldphillips.com/wp-content/uploads/2016/10/matthews_demographics.txt. Load the data into an object called demo.df into R.

  11. Using merge add the demographic data to matthews.df

  12. Using either basic indexing or subset(), calculate the mean age for males only.

  13. Using either basic indexing or subset(), calculate the mean age for females only.

  14. Using aggregate() calculate the mean age of male and female participants separately. Do you get the same answers as before?

  15. Using aggregate() calculate the mean pall value for male and female participants separately. Which gender tends to think that others would pay more for products than them?

  16. Using aggregate() calculate the mean pall value of participants for each level of income. Do you find a consistent relationship between pall and income?

  17. Now repeat the previous analysis, but only for females (Hint: use the subset argument within the aggregate function)

  18. What was the mean age for participants for each combination of gender and income?

  19. The variable pcmore reflects the question: “What percent of people taking part in this survey do you think earn more than you do?”. Using aggregate(), calculate the median value of this variable separately for each level of income. What does the result tell you?

Matrices

  1. Columns 2 to 18 of matthews.df contain only numeric values. Using the code below we can create a matrix of these values, call it matthews.mx.
matthews.mx <- as.matrix(matthews.df[,2:18])
  1. Use head(), View() and str to see how this matrix compares to the original data.frame.

  2. We can use the apply(X, MARGIN, FUN) function to perform vector functions on either every row or every column of our matrix. The MARGIN argument determines whether the function is applied to the rows (1), columns (2) or both (1:2) of the matrix, and the FUN argument specifies the function to be applied. Use ?apply to see details. For instance the code below returns the mean for each of the 10 item columns (p1, p2 … p10), similar to colMeans.

apply(X=matthews.mx[,4:13], MARGIN=2, FUN=mean)
  1. apply() is more flexible than colMeans or rowMeans, as we can specify different functions. Use apply() and table to obtain the frequency of each response for each of the 10 items.

  2. Pretend we just discovered there was another particpant whose data we lost. We decide to estimate the data for this participant (including their gender, age, income etc.) by calculating the median of the other participants’ scores. Use apply to calculate these medians, and save the results as participant.191.

  3. Add a new row to the matrix matthews.mx containing participant 191’s estimated data. (Hint use rbind). Call this new matrix new.matthews

  4. Add the column containing gender coded as male, female from matthews.df to matthews.mx (Hint: use cbind). Call the resuling matrix matthews.gender.mx. What happens to the data?

  5. Using save(), save matthews.df, matthews.mx, matthews.gender.mx and new.matthews objects to a file called wpa4data.RData in the data folder in your working directory.

Submit!

Save and email your ‘.R’ file wpa_4_LastFirst.R to me at ashleyjames.luckman@unibas.ch. Put the subject as WPA4-23496-02.