Chapter 5 quiz - 5-4 Quiz_ Python Functions

docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

243

Subject

Mathematics

Date

Jan 9, 2024

Type

docx

Pages

6

Uploaded by EarlSteel9150

Report
Question 1 3/ 3 points The scores received in four exams in a math class are collected for 50 students. The following Python code is used to fit a simple linear regression model using data from the ExamScores.csv file. Which of the two variables, “Exam4” or “Exam2”, is the response variable? Which is the predictor variable? Select one. import pandas as pd import statsmodels.formula.api as smf scores = pd.read_csv('http:/data-analytics.zybooks.com/ExamScores.csv') model = smf.ols('Exam4 ~ Exam2!, scores).fit() Exam2 and Exam4 are both response variables. o Exam4 is the response variable and Exam2 is the predictor variable. Exam2 and Exam4 are both predictor variables. Exam2 is the response variable and Exam4 is the predictor variable. Question 2 3/ 3 points Which of the following correctly represents the coefficient of determination in terms of the variance that is an output from the analysis of variance table? Select one. explained variance + unexplained variance total variance 1 total variance @) explained variance total variance unexplained variance total variance
Question 3 0/ 3 points The ols() method in statsmodels is used to fit a simple linear regression model using “Exam4” as the response variable and “Exam3” as the predictor variable. The output is shown below. A text version is available. What is the correct regression equation based on this output? Is this model statistically significant at 10% level of significance (alpha = 0.10)? Select one. (Hint: Review results of F-statistic) OLS Regression Results R-squared: Adj. R-squared: F-statistic Prob (F-statistic): Log-Likelihood: No. Observations: AIC: Df Residuals: BIC: DF Model: Covariance Type: 0.077 0.058 4.010 0.0509 -172.76 349.5 353.3 P>lt] [0.025 68.9586 17.568 0.000 61.066 0.975] 76.851 0.206 0.1028 (X5 2.002 0.051 -0.000 omnibus: 5.557 Durbin-Watson: Prob(Omnibus) : 0.062 Jarque-Bera ( skew: 0.659 Prob(38): Kurtosi 3.621 Cond. No. Exam4 = 68.9576 + 0.1028 Exam3, model is not statistically significant 1.644 4.422 0.110 271. Exam4 = 76.85 + 0.206 Exam3, model is not statistically significant Exam4 = 68.9576 + 0.1028 Exam3, model is statistically significant o Exam4 = 76.85 + 0.206 Exam3, model is statistically significant
Question 4 3/ 3 points Which of the following python methods can be used to perform simple linear regression on a data set? Select all that apply. | linregress method from scipy module simplelinearregression from scipy module | ols method from statsmodels module Question 5 3/ 3 points An online shopping website collected data regarding its operations and obtained the following linear regression model for the estimated revenue in millions, ¥, based on the click-through rate in thousands, x. ?=12+02¢ What is the best interpretation of the value of the estimated slope of 0.2? Select one. The estimated change in the click-through rate is 0.2 thousand for each for each one million in revenue. o The estimated change in revenue for each additional thousand clicks is $0.2 million. When there are no clicks on the website, the estimated revenue is $0.2 million. Every click on the website causes $0.2 million more revenue.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 1 3/ 3 points The linregress() method in scipy module is used to fit a simple linear regression model using “Reaction” (reaction time) as the response variable and “Drinks” as the predictor variable. The output is shown below. What is the correct regression equation based on this output? Is this model statistically significant at 5% level of significance (alpha = 0.05)? Select one. 000000000000001, intercej SELELELEELELEITY 28166526882823, pvalue=0.0010983582017795293, stderr=0.7141428428542851) Reaction = 3.9999 + 6.0000 Drinks, model is not statistically significant Reaction = 6.0000 + 3.9999 Drinks, model is statistically significant Reaction = 6.0000 + 3.9999 Drinks, model is not statistically significant ' Reaction = 3.9999 + 6.0000 Drinks, model is statistically significant Question 2 3/ 3 points Which of the following Python methods return the correlation coefficient? Select all that apply. | pearsonr method from scipy.stats submodule | corr method from pandas dataframe
Question 3 0/3p The ols() method in statsmodels was used to fit a simple linear regression model using “Exam4” as the response variable and “Exam1” as the predictor variable. The output is shown below. A text version is available. What is the correct regression equation based on this output? Is this model statistically significant at 5% level of significance (alpha = 0.05)? Select one. (Hint: Review results of F-statistic) OLS Regression Results Method: Date: Time: No. Observations: DF Residuals: DF Model: Covariance Type: -173.00 350.0 EIEN P>lt| [0.025 Intercept 57.7627 10.052 5.746 0.000 37.552 Exanl 0.2266 0.121 1.876 0.067 0016 0.975] 77.973 [R1T] omnibu: 3.859 Durbin-watson: Prob(Omnibus’ 0.145 Jarque: a (I8 Skew: _ 0.428 I‘::g(]fl Examé =77.973 +0.469 Examl, model is not statistically significant Examd = 57.7627 + 0.2266 Exam1, model is not statistically significant Examd =77.973 +0.469 Examl, model is statistically significant ® ) Examd =57.7627 + 0.2266 Exam1, model is statistically significant
Question 4 0/ 3 points Which of the following Python methods in scipy.stats submodule returns the P-value for performing a hypothesis test for the significance of the correlation coefficient? Select one. pearsonr from pandas module @ pearson from scipy module pearsonr from scipy module pearson from pandas module Question 5 3/ 3 points The height and grade point average of 50 randomly selected students are recorded. The following Python code is used to fit a simple linear regression model using data collected from the sample that is stored in the gpa.csv file. Which of the two variables, “gpa” or “height”, is the response variable? Which is the predictor variable? Select one. import pandas as pd import statsmodels.formula.api as smf scores = pd.read_csv('http:/data-analytics.zybooks.com/gpa.csv') model = smf.ols(gpa ~ height!, scores).fit() height is the response variable and gpa is the predictor variable. » ) gpa is the response variable and height is the predictor variable. gpa and height are both response variables. gpa and height are both predictor variables.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help