Question

This question needs to be solved in R: Run the following code to generate a data...

This question needs to be solved in R:

Run the following code to generate a data frame called `ucb`.
```{r,eval=TRUE}
rm(list=ls())
gender = rep(c("female","male"),c(1835,2691))
admitted = rep(c("yes","no","yes","no"),c(557,1278,1198,1493))
dept = rep(c("A","B","C","D","E","F","A","B","C","D","E","F"),
c(89,17,202,131,94,24,19,8,391,244,299,317))
dept2 = rep(c("A","B","C","D","E","F","A","B","C","D","E","F"),
c(512,353,120,138,53,22,313,207,205,279,138,351))
department = c(dept,dept2)
ucb = data.frame(gender,admitted,department)
rm(gender,admitted,dept,dept2,department)
ls()
```

a) Does there seem to be a relationship between department and gender? Draw your conclusion
based on two approaches: (1) use an appropriate plot, and (2) a parametric test. For the parametric test, **write down the hypotheses and the assumption(s)**. Use a 5% significance level.

b)Use a non-parametric method to test whether there is an association between `gender` and `admitted`. State the hypotheses, give the p-value and observed odds-ratio.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

answer :

d ;
0 1.4 1.8 돋 . gender 9 oog admitted bo OOO 一寸 department 0 1.4 1.8

.0 1.4 1.8 돋 . gender 9 oog admitted bo OOO 一寸 department 0 1.4 1.8

Hypothesis : There is no relationship between department and gender values or B1=0

thanks,

Add a comment
Know the answer?
Add Answer to:
This question needs to be solved in R: Run the following code to generate a data...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Paste the R code for each exercise along with the answers. If: Age <- c(22, 25,...

    Paste the R code for each exercise along with the answers. If: Age <- c(22, 25, 18, 20) Name <- c("James", "Mathew", "Olivia", "Stella") Gender <- c("M", "M", "F", "F")       then what is the R-code for getting the following output: ##   Age   Name Gender ## 1 22 James      M ## 2 25 Mathew      M a. DataFrame = data.frame(c(Age), c(Name), c(Gender)) subset(DataFrame, Gender == "M") b. DataFrame = data.frame(c(Age),c(Name),c(Gender)) subset(Gender=="M"), eval=FALSE c. DataFrame = data.frame(Age,Name,Gender) subset(DataFrame,Gender=="M") d. DataFrame = data.frame(c(Age,Name,Gender))...

  • solve for (c) ~ (g) especially tricky integration is need to be solved solve for (d) ~(g) (c) is solved 2. Using polar coordinates: (a) Show that the equation of the circle sketched is r 2a cos 0....

    solve for (c) ~ (g) especially tricky integration is need to be solved solve for (d) ~(g) (c) is solved 2. Using polar coordinates: (a) Show that the equation of the circle sketched is r 2a cos 0. Hint: Use the right triangle OPGQ (b) By integration, find the area of the distk P(r, e) 2a r < 2a cos θ Find the centroid of the area of the first quadrant (c) half disk. (d) Find the moments of inertia...

  • Please show work/explain using R code. Question 6 Your answer is INCORRECT In a certain city,...

    Please show work/explain using R code. Question 6 Your answer is INCORRECT In a certain city, there are about one million eligible voters. A simple random sample of size 10,000 was chosen to study the relationship between gender and participation in the last election. The results were Men Women Voted 2799 3322 Didn't Vote 1499 2380 If we are testing for a relationship between gender and participation in the last election, what is the test statistic? a) x2 30.308 b)...

  • 2. R programming 2·The data set prostate in the faraway package is froma study on 97...

    2. R programming 2·The data set prostate in the faraway package is froma study on 97 men with prostate cancer who were due to receive a radical prostatectomy We are interest is in predicting lpsa (log prostate specific antigen) with Icavol (log cancer volume). (a) Draw a scatterplot -does a simple linear regression model seem reasonable? (b) Without using the R function Im), compute the values T,Y, Sxx, Syy and Sxy. Com- pute the ordinary least squares estimates of the...

  • The exercise involving data in this and subsequent sections were designed to be solved using Excel. The following estim...

    The exercise involving data in this and subsequent sections were designed to be solved using Excel. The following estimated regression equation is based on 10 observations was presented. y = 29.1270 +0.5906x1 +0.4980x2 Here SST = 6,614.875, SSR = 6,040.125, Sbı = 0.0812, and Sba = 0.0696. a. Compute MSR and MSE (to 3 decimals). MSR 3020.063 MSE 82.107 b. Compute the F test statistic (to 2 decimals). Use F table. 36.78 What is the p-value? less than .01 At...

  • The exercise involving data in this and subsequent sections were designed to be solved using Excel. The following estim...

    The exercise involving data in this and subsequent sections were designed to be solved using Excel. The following estimated regression equation is based on 10 observations was presented. y = 29.1270+ 0.5906x1 +0.4980:02 Here SST = 6,894.875, SSR = 6,237.875, Sby = 0.0777, and $by = 0.0667 a. Compute MSR and MSE (to 3 decimals). MSR 3118.938 MSE 93.857 b. Compute the F test statistic (to 2 decimals). Use F table. 33.23 What is the p-value? less than .01 than...

  • A two-factor ANOVA was perofrmed with a-2, b-2, and r-3. The following are the data Male Female L...

    A two-factor ANOVA was perofrmed with a-2, b-2, and r-3. The following are the data Male Female Less than bachelor's degree 15 10 6 12 10 At least one bachelor's degree 10 (a) Complete the ANOVA table F-statistics F-MS(A)/MSE F-MS(B)/MSE Variation df Mean squares SS(A) SS(B) (a-1) (b-1) SS(AB) SSE MS(A) MS(B) Factor A (Gender) a Factor B (Education)a-1 Interaction MS(AB) F-MS(AB)/MSE rror l-a MSE Total n- SS(Total) (b) Write down Ho and H and determine whether there are differences...

  • Using the data from the previous question on LDL cholesterol, you decide to test if the...

    Using the data from the previous question on LDL cholesterol, you decide to test if the variance in LDL cholesterol of patients admitted to the hospital with a heart attack is the same as that of those who have not (the control). You use the R function var.test and obtain the following output.    F test to compare two variances data: ldl.ha and ldl.cont F = 7.683, num df = 9, denom df = 15,    p-value = 0.0006501 alternative...

  • The exercise involving data in this and subsequent sections were designed to be solved using Excel....

    The exercise involving data in this and subsequent sections were designed to be solved using Excel. The following estimated regression equation is based on 10 observations was presented. $ = 29.1270 + 0.590621 +0.498022 Here SST = 6,943.875, SSR = 6,696.375, 85, = 0.0752, and 86 = 0.0513. a. Compute MSR and MSE (to 3 decimals). MSR 3348.188 MSE 35.337 b. Compute the F test statistic (to 2 decimals). Use F table. 94.72 ♡ What is the p-value? less than...

  • #5 Need this solved along with the R code asap. Thank you very much in advance...

    #5 Need this solved along with the R code asap. Thank you very much in advance for the work. Right click and Open image in a new tab if it is too small to see. we wish to compare the expected values, μ× andWy of two independent normal populations, say X and Y, with known standard deviations ox-8.3 and ay-10.. we take a random sample of size 13 from X (XiX2. .Xi3) and a random sample of size 7 from...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT