首页 >
> 详细

Please do not share this handout outside the class.

STAT 3032 Homework4 Instruction (Fall 2019)

Due Thursday, Oct 17 @ 11:59pm in Canvas

20 points in total

Please show your work on each problem for full credit. A correct answer, unsupported by the

necessary explanation, R code or output will receive very little if any credit. Your work needs

to be organized in a reasonably neat and coherent way, and submitted as a pdf file on

Canvas.

You are welcome to discuss with your classmates, but you must write up your homework

individually!

Problem 1

This problem will use the RateMyProfeesor dataset we saw in the lectures! Download the data

file RateprofThree.csv from Canvas. Each observation is a professor. The variables are:

quality the quality score of the professor on a scale of 1 to 5, with 1 being the worst and

5 being the best.

gender the gender of the professor. The possible values are “female” and “male”.

pepper if the professor is considered “hot” (i.e. physically attractive). The possible values

are “yes” and “no”.

(a) Import the dataset into R. Among the professors in the sample, how many of them are

male? How many professors received “yes” for their pepper value? Hint: use

summary(dataName)

(b) Fit a model that uses pepper to predict quality. Provide the model summary. What

percentage of the variability in quality is explained by pepper?

Note: You may notice that the percentage is low. We are using Problem 2 to practice

using dummy variable, not to find a good model to predict quality.

(c) What is the base level of pepper (the level that corresponds to 0 in the dummy

variable)?

Please do not share this handout outside the class.

(d) Interpret the estimated slope of the model in Part (b) in the context.

(e) Interpret the estimated intercept of the model in Part (b) in the context.

(f) Now fit a model using both gender and pepper to predict quality. Provide the

summary of the model. Write down the fitted model. Please pay attention to the notation.

(g) What is the average of the quality score for male professors with pepper equal to “no”?

Hint: For these professors, what is the value of pepperyes? What is the value of

gendermale?

(h) Please order the following four groups according to their average quality score (from the

highest to the lowest).

-Group A: male professors with pepper equal to “yes”

-Group B: female professors with pepper equal to “yes”

-Group C: male professors with pepper equal to “no”

-Group D: female professors with pepper equal to “no”

Problem 2

This problem is adapted from Question 1 in Section 3.4 (pg. 103) in the textbook A Modern

Approach to Regression with R.

The data file airfares.txt on the book web site gives the one-way airfare (in US dollars)

and distance (in miles) from city A to 17 other cities in the US. Interest centers on modeling

airfare as a function of distance.

Please do not share this handout outside the class.

(a) Read in the dataset from a website (see url below) and fit the model that uses

Distance to predict Fare.Provide the summary of your model output.

The url for the data is: http://gattonweb.uky.edu/sheather/book/docs/datasets/airfares.txt

Hint: Use the R function read.table( )

(b) Create a scatterplot of Fare (y-axis) vs. Distance (x-axis) with the fitted regression

model. Color this fitted model red. Hint: Use the R functions plot(y~x, data =

dataName) and abline(modelName, col = ‘red’)

(c) Create a plot where the x-axis is Distance and the y-axis is the standardized residuals

from the model. Include two horizontal lines at -2 and 2 to mark the boundaries of

outliers. Hint: use the R functions rstandard(modName) ,

plot(rstandard(modName)~ dataName$x), and abline(h=2).

(d) Remove the two outliers found in Part (c) in the dataset. Note that one of the outliers has

a standardized residual just below -2. In real life, it is up to you to determine if you want

to remove this borderline case. Here, we will remove it. Fit a polynomial regression

model of order 2. Provide the output of your fitted model.

(e) Write down the fitted model equation from Part (d). Pay attention to the notation.

(f) If we conduct the test of H vs. , where is the slope of . 0

: β2 = 0 HA

: β2 =/ 0 β2 Distance

What is the test statistic value based on this sample? What distribution does the test

statistic follow under the null hypothesis? What is the p value?

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-23:00
- 微信：codinghelp2

- Ee6435 Programming Homework 2020-05-30
- Computer Architecture Homework 3 2020-05-30
- Infs7450作业代做、Media Analytics作业代写、Pytho 2020-05-29
- 代写stats 782作业、代做r编程设计作业、代写data留学生作业、R课 2020-05-29
- 代写math223作业、R课程设计作业代做、代写data课程作业、R程序语言 2020-05-28
- 代写kxo151留学生作业、代做programming作业、Java语言作业 2020-05-28
- Math 160作业代做、Data课程作业代写、Matlab程序设计作业调试 2020-05-28
- 代做csci 3120作业、Program课程作业代做、C/C++语言作业代 2020-05-28
- St2020课程作业代做、Statistics作业代做、R程序设计作业调试、 2020-05-28
- Com1005作业代写、Ai Techniques作业代做、Java语言作业 2020-05-28
- 代写sit216留学生作业、Python程序语言作业调试、Java/C++实 2020-05-28
- 代写artificial课程作业、Java，Python程序语言作业调试、C 2020-05-27
- Comp Sci 3306作业代写、Python编程语言作业调试、代做jav 2020-05-27
- Data留学生作业代写、代做r课程设计作业、Analytics作业代做、R编 2020-05-27
- Csci 3120作业代做、C++程序语言作业调试、代做c/C++课程作业、 2020-05-26
- 代写algorithms作业、Data留学生作业代做、代写java、Pyth 2020-05-26
- Data Science作业代写、C++程序设计作业代写、Programmi 2020-05-26
- Data课程作业代写、C++编程设计作业调试、C/C++语言作业代做、Alg 2020-05-26
- 代写r留学生作业、代做data课程作业、代写r编程语言作业代做r语言编程|调 2020-05-25
- Cosc473作业代做、Systems作业代写、Python编程设计作业调试 2020-05-25