Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Tip Joke Description Effect of a waiter leaving a joke or an advertisement on getting a tip Format A dataset with 211 observations on the

Tip Joke

Description

Effect of a waiter leaving a joke or an advertisement on getting a tip

Format

A dataset with 211 observations on the following 5 variables.

Card Type of card used: Ad, Joke, or None
Tip 1=customer left a tip or 0=no tip
Ad Indicator for Ad card
Joke Indicator for Joke card
None Indicator for no card

Details

Can telling a joke affect whether or not a waiter in a coffee bar receives a tip from a customer? A study investigated this question at a coffee bar at a famous resort on the west coast of France. The waiter randomly assigned coffee-ordering customers to one of three groups: When receiving the bill one group also received a card telling a joke, another group received a card containing an advertisement for a local restaurant, and a third group received no card at all. He recorded whether or not each customer left a tip.

Write a Python script named that reads the file TipJoke.csv. The output of the script should print out a table of the form

Type Total Percent

Ad ? ?

Joke ? ?

None ? ?

where the Total column contains the number of entries of the specified card type and the Percent column contains the percentage of tips given for the specified card type with two decimal places of precision. Data from the .csv file is found below, note their are many more than this

Card Tip Ad Joke None
1 None 1 0 0 1
2 Joke 1 0 1 0
3 Ad 0 1 0 0
4 None 0 0 0 1
5 None 1 0 0 1
6 None 0 0 0 1
7 Ad 0 1 0 0
8 Ad 0 1 0 0
9 None 0 0 0 1
10 None 0 0 0 1
11 None 1 0 0 1
12 Ad 0 1 0 0
13 None 0 0 0 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

Explain what scientific methods are and why they are important.

Answered: 1 week ago

Question

a. When did your ancestors come to the United States?

Answered: 1 week ago

Question

d. What language(s) did they speak?

Answered: 1 week ago

Question

e. What difficulties did they encounter?

Answered: 1 week ago