Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USE ONLY CHI SQUARE TEST OF INDEPENDENCE Question: Part 2 – R work (must be done

ID: 3362533 • Letter: U

Question

USE ONLY CHI SQUARE TEST OF INDEPENDENCE

Question: Part 2 – R work (must be done in R) Copy and paste your R code and output into a word document ... Part 2 – R work (must be done in R) Copy and paste your R code and output into a word document to submit to Canvas. Follow these instructions to import the necessary dataset:             Before opening the dataset needed for this problem, you’ll need to call the “car” package. Run the following line of code: > library(car) Now you can import the “Prestige” dataset and use it to answer the question below. Name the data frame with your UT EID:                        

> my_eid <- Prestige

The Prestige dataset contains information about different occupations in Canada in 1971. Three types of occupations were collected: blue collar (“bc”), white collar (“wc”), and professional/technical (“prof”). The women variable indicates the percentage of the workforce in each occupation that was female. You are interested in looking at occupations with workforces that are majority (greater than 50%) female compared to those that are majority male.

Create a new variable in the dataset called maj.women that indicates whether or not each occupation is greater than 50% women. (1pt)

Are there differences in the rate of majority female occupations across the three types? Carry out the appropriate analysis to answer this question and include all steps for full credit. (4pt)

Explanation / Answer

library(car)
my_eid <- Prestige
my_eid$maj.women <- ifelse(my_eid$women>49.99, "Yes", "No")

my_eid_new1 <- subset(my_eid,my_eid$maj.women=="Yes")
my_eid_new2 <- split(my_eid_new1, my_eid_new1$type)