Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

from sklearn.linear _ model import LinearRegression regr = LinearRegression ( ) regr.fit ( genre _ dummies, gross [ ' inflation _ adjusted _ gross' ]

from sklearn.linear_model import LinearRegression
regr = LinearRegression()
regr.fit(genre_dummies, gross['inflation_adjusted_gross'])
action = regr.intercept_
adventure = regr.coef_[[0]][0]
print((action, adventure))
Next, we will compute 95% confidence intervals for the intercept and coefficients. The 95% confidence intervals for the intercept and coefficient means that the intervals have a probability of 95% to contain the true value and coefficient respectively. If there is a significant relationship between a given genre and the adjusted gross, the confidence interval of its coefficient should exclude 0. We will calculate the confidence intervals using the pairs bootstrap method.
# Import a module
import numpy as np
# Create an array of indices to sample from
inds =... #CODE HERE
# Initialize 500 replicate arrays
size =500
bs_action_reps =...#CODE HERE
bs_adventure_reps =...#CODE HERE

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

5. Have you any experience with agile software development?

Answered: 1 week ago