Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Similarly, we might think that increasing the default tip suggestions made some riders angry and would make them respond by tipping zero dollars. Run a

Similarly, we might think that increasing the default tip suggestions made some riders angry and would make them respond by tipping zero dollars. Run a logistic regression in which the depenent variable is the zero_tip and the independent variables are CMT, post_feb, and CMTxpost. At the mean, what was the marginal effect of increasing the default tip suggestions on the probability that a rider would decide to top zero dollars? Store your answer in the variable effect_on_zero_tip as a float. Is the effect statistically significant? Store your answer in the variable stat_sig as either the string "yes" or "no". my code is wrong: import pandas as pd
import statsmodels.api as sm
data = pd.DataFrame({
'zero_tip': [1,0,0,1,0,1,1,0,0,1],
'CMT': [1,0,1,0,1,0,1,0,1,0],
'post_feb': [1,1,1,0,1,0,1,1,0,0]
})
X = data[['CMT', 'post_feb']]
y = data['zero_tip']
X = sm.add_constant(X)
logit_model = sm.Logit(y, X)
result = logit_model.fit()
marginal_effects = result.get_margeff()
effect_on_zero_tip = marginal_effects.margeff[0]
p_value = result.pvalues['CMT']
stat_sig = 'yes' if p_value <0.05 else 'no'

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 Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

What is the meaning of fiduciary obligation?

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago