#### Question Details

Microsoft Word - 420HwIV.doc

1.

Suppose that the height ( X ) ( in inches ) and the weight ( Y ) ( in pounds ) of female students at Anytown State University follows a bivariate normal distribution with

? 1 = 65, ? 1 = 2, ? 2 = 130, ? 2 = 12, ? = 0.60.

Suppose also that the height ( X ) ( in inches ) and the weight ( Y ) ( in pounds ) of male

students at Anytown State University follows a bivariate normal distribution with ? 1 = 69, ? 1 = 2.5, ? 2 = 170, ? 2 = 15, ? = 0.60.

Write your own R function that simulates a Bivariate Normal distribution. ( There are R functions that do that, for example, mvrnorm from MASS or rmvnorm from mvtnorm. Do NOT use these, write your own! ) The input should be a positive integer n, and five real numbers ?1, ?2, ?1, ?2, ? (?1, ?2 > 0). The output should be a data frame with two variables, x and y. The function should be called yourNetID. For example, mine would be called stepanov:

a)

Hint1:

Hint 2:

11 2?1()2 1

> stepanov = function(n,m1,m2,s1,s2,r) { ? ? ? }

If X~N(? ,?2 ), then Y~N(? + ??2 (x?? ), 1??2 ??2 ).

OR If Y~N(? ,?2 ), then X~N(? + ??1 (y?? ), 1??2 ??2 ). 22 1?2()1

2

To create a data frame: data.frame(x,y).

b) Simulate heights and weights of 100 female students and heights and weights of 100 male students.

> par(mfrow=c(2,2))

c) Make four probability histograms: female height female weight male height male weight

For each probability histogram, overlay the corresponding normal distribution density function.

d) Combine the heights of female students and the heights of male students into height. Combine the weights of female students and the weights of male students into weight. Create a dummy variable gender ( 1 for females, 0 for males ) that matches height and weight.

> par(mfrow=c(1,1))

- e) ?Plot weight ( y ) vs height ( x ) using different symbols for females and males.
- f) ?Fit a linear model that predicts a student?s weight using student?s height and gender as the predictors.
- i) ?Test H0: ?gender=0 vs H0: ?gender?0 at ?=0.05.
- ii) ?Add the two parallel lines representing the model fit to the plot from part (e).

- g) ?Fit a linear model that predicts a student?s weight using student?s height as the predictor.

i) ii)

Add the thin dashed least squares regression line to the plot from part (e).

Compute the sample correlation coefficient between the students? heights and weights. (Doestheanswersurpriseyou?)

cor( ... , ... ).

- h) ?Fit a logistic regression model to predict the student?s gender using student?s height and weight as the predictors.
- i) ?Suppose that Pat is 67 inches tall and weighs 145 pounds. What is the ( predicted ) probability that Pat is a female?
- j) ?Fit a logistic regression model to predict the student?s gender using student?s height as as the predictor.

?Hint?:

- k) ?Use part (j) to plot the estimated logistic mean response function ( the relationship between the predicted probability of a student being a female and a student?s height ) on the range from 55 to 75 inches. ( Obviously, the range on the y-axis is from 0 to 1. )
- l) ?Fit a logistic regression model to predict the student?s gender using student?s weight as as the predictor.
- m) ?Use part (l) to plot the estimated logistic mean response function ( the relationship between the predicted probability of a student being a female and a student?s weight ) on the range from 100 to 200 pounds.
- n) ?Which model ( out of part (h) model, part (j) model, and part (l) model ) do you prefer? Justify your answer.

**Solution details:**

Answered

QUALITY

Approved

ANSWER RATING

This question was answered on: * Sep 18, 2020 *

* * Solution~0001013841.zip (25.37 KB)

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy from our tutoring website www.aceyourhomework.com (Deadline assured. Flexible pricing. TurnItIn Report provided)

##### Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .

#### About this Question

STATUSAnswered

QUALITYApproved

DATE ANSWEREDSep 18, 2020

EXPERTTutor

ANSWER RATING

#### GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

- As a reference for in-depth understanding of the subject.
- As a source of ideas / reasoning for your own research (if properly referenced)
- For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).

#### NEW ASSIGNMENT HELP?

### Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions.
New orders are original solutions *and precise to your writing instruction requirements. Place a New Order using the button below.*

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.