The author of the following article was interested in knowing how people liked their steaks prepared and whether their choice shed light to any aspect of their lifestyle. Although his investigation produced inconclusive results, his plan of action was to determine if risk-averse people were more likely to order their steak well done? The data obtained in his investigation was based on participant’s responses to risk related questions and compared against their responses on “steak doneness”.
#load data that was uploaded to github as a csv file.
#use the raw data url rather than the display url.
#assign this function to the variable myURL
myURL <- getURL("https://raw.githubusercontent.com/JAdames27/DATA-607---Data-Acquisition-and-Management/main/DATA%20607%20-%20Assignment%201/steak-risk-survey.csv")
#once the data is retrieved from the github url, assign csv data to the variable myData
myData <- read.csv(text = myURL)
#use the "glimpse()" function to see the column titles (variables)
glimpse(myData)
## Rows: 551
## Columns: 15
## $ RespondentID <dbl> …
## $ Consider.the.following.hypothetical.situations...br.In.Lottery.A..you.have.a.50..chance.of.success..with.a.payout.of..100...br.In.Lottery.B..you.have.a.90..chance.of.success..with.a.payout.of..20...br..br.Assuming.you.have..10.to.bet..would.you.play.Lottery.A.or.Lottery.B. <chr> …
## $ Do.you.ever.smoke.cigarettes. <chr> …
## $ Do.you.ever.drink.alcohol. <chr> …
## $ Do.you.ever.gamble. <chr> …
## $ Have.you.ever.been.skydiving. <chr> …
## $ Do.you.ever.drive.above.the.speed.limit. <chr> …
## $ Have.you.ever.cheated.on.your.significant.other. <chr> …
## $ Do.you.eat.steak. <chr> …
## $ How.do.you.like.your.steak.prepared. <chr> …
## $ Gender <chr> …
## $ Age <chr> …
## $ Household.Income <chr> …
## $ Education <chr> …
## $ Location..Census.Region. <chr> …
#assign the same data to a new variable, myData1, to work with without changing the original data frame
myData1 <- myData
After taking a glimpse, I renamed the titles of each column since they were too long, making the data harder to read.
However, the information for one of the columns was important: -Lottery A, you have a 50% chance of success, with a payout of $100. -Lottery B, you have a 90% chance of success, with a payout of $20.
Assuming you have $10 to bet, would you play Lottery A or Lottery B?
I renamed this column to “Lottery A or B?”, but the responses are based on their answers to the information given above. In short, Lottery A is the riskier choice vs Lottery B is safer.
colnames(myData1) <- c('Respondent_ID',"Lottery_A_or_B", "Smokes_Cigarettes", "Drinks_Alcohol", "Gambles", "Skydived", "Speeds_while_Driving", "Cheated_on_Spouse", "Eats_Steak", "Steak_Doneness", "Gender", "Age", "Household_Income", "Education", "Location")
#now the data frame is much easier to read
head(myData1)
## Respondent_ID Lottery_A_or_B Smokes_Cigarettes Drinks_Alcohol Gambles
## 1 NA Response Response Response Response
## 2 3237565956 Lottery B
## 3 3234982343 Lottery A No Yes No
## 4 3234973379 Lottery A No Yes Yes
## 5 3234972383 Lottery B Yes Yes Yes
## 6 3234958833 Lottery B No Yes No
## Skydived Speeds_while_Driving Cheated_on_Spouse Eats_Steak Steak_Doneness
## 1 Response Response Response Response Response
## 2
## 3 No No No Yes Medium rare
## 4 No Yes Yes Yes Rare
## 5 No Yes Yes Yes Medium
## 6 No Yes Yes Yes Medium
## Gender Age Household_Income Education
## 1 Response Response Response Response
## 2
## 3 Male > 60 $50,000 - $99,999 Some college or Associate degree
## 4 Male > 60 $150,000+ Graduate degree
## 5 Male > 60 $50,000 - $99,999 Bachelor degree
## 6 Male > 60 $50,000 - $99,999 Graduate degree
## Location
## 1 Response
## 2
## 3 East North Central
## 4 South Atlantic
## 5 New England
## 6 Middle Atlantic
#since the results of the author's investigation were inconclusive based on the original data, I created a subset data frame to only look at responses to health related questions
#all other questions/columns that did not DIRECTLY relate to health were removed.
myDataSub <- subset(myData1, select = -c(2,5,8,13:15))
head(myDataSub)
## Respondent_ID Smokes_Cigarettes Drinks_Alcohol Skydived Speeds_while_Driving
## 1 NA Response Response Response Response
## 2 3237565956
## 3 3234982343 No Yes No No
## 4 3234973379 No Yes No Yes
## 5 3234972383 Yes Yes No Yes
## 6 3234958833 No Yes No Yes
## Eats_Steak Steak_Doneness Gender Age
## 1 Response Response Response Response
## 2
## 3 Yes Medium rare Male > 60
## 4 Yes Rare Male > 60
## 5 Yes Medium Male > 60
## 6 Yes Medium Male > 60
#remove the observations coming from participants who do not eat steak.
myDataSub1 <- myDataSub %>%
filter(Eats_Steak == "Yes")
head(myDataSub1)
## Respondent_ID Smokes_Cigarettes Drinks_Alcohol Skydived Speeds_while_Driving
## 1 3234982343 No Yes No No
## 2 3234973379 No Yes No Yes
## 3 3234972383 Yes Yes No Yes
## 4 3234958833 No Yes No Yes
## 5 3234955240 No No No Yes
## 6 3234955010 No Yes Yes Yes
## Eats_Steak Steak_Doneness Gender Age
## 1 Yes Medium rare Male > 60
## 2 Yes Rare Male > 60
## 3 Yes Medium Male > 60
## 4 Yes Medium Male > 60
## 5 Yes Medium rare Male 18-29
## 6 Yes Medium rare Male 18-29
I think that the author’s approach was a great start, but I feel that some of his questions, while still valid, were too general. The initial question that was posed was, “Are risk-averse people more likely to order their steak well done?”. As a follow up, he might want to narrow his questions down to those relating to risk while eating. ie. “Are people who are less open to exploring new foods more likely to order their steak well done?”
I might have asked additional risk related questions that have more to do with health and eating habits. For example, questions such as; “Do you overeat? (more than one serving at a time)”, “Do you have high cholesterol?”, “Do you have high blood pressure?”, “Do you have diabetes?”, or questions that reflect bad experiences while dining, “Do you eat sushi?”, “Have you ever gotten sick from eating under-cooked foods?”, “Have you ever gotten food poisoning?”, etc.
Also, having too many variables sometimes makes it harder to see relationships between them, in my opinion.
https://fivethirtyeight.com/features/how-americans-like-their-steak/
MLA Citation WaltHickey. “How Americans like Their Steak.” FiveThirtyEight, FiveThirtyEight, 16 May 2014, fivethirtyeight.com/features/how-americans-like-their-steak/.