首页 >
> 详细

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
- 微信：codinghelp

- Stat 429作业代做、代写mathematics课程作业、代做r编程语言 2019-11-18
- 代做431 Quiz 2作业、R编程设计作业调试、R语言作业代写、代做dat 2019-11-18
- 代写mt5761留学生作业、代做statistical Modelling作 2019-11-18
- Stata留学生作业代写、代做domco2opop 语言作业、Stata编程 2019-11-17
- 代做mast 397B作业、代写r语言留学生作业、代做sas语言作业、代写s 2019-11-17
- 代做comp25216作业、代写network Analysis留学生作业、 2019-11-17
- 代做comp 2406作业、代写json留学生作业、代做html/Mongo 2019-11-17
- 代写comp 250作业、代做java编程设计作业、代写kdtree课程作业 2019-11-17
- 代做vizdoom Game Engine作业、代写 Fps留学生作业、代做 2019-11-17
- Server作业代写、代tcp Connection编程作业、代写ip/Tc 2019-11-17
- 代写ict638留学生作业、代写mobile App作业、代做 .Net语言 2019-11-17
- 代写nodes And Edges作业、代做java程序语言作业、代写pyt 2019-11-16
- Data/Prod作业代做、代写python编程设计作业、代做java/C+ 2019-11-16
- Data Programming作业代写、代做canopy留学生作业、Pyt 2019-11-16
- 代做data Outputs作业、Csv Format作业代写、R程序语言作 2019-11-16
- 代做virtual Disk作业、C/C++程序语言作业调试、C/C++实验 2019-11-16
- 代写comp222作业、代做ca Assignment作业、代做python 2019-11-16
- Cmpt 300作业代做、代写operating Systems作业、C/C 2019-11-16
- Data Visualisation And Analytics Assi... 2019-11-15
- Block Breaker Assignment Game Engine ... 2019-11-15