Access Millions of academic & study documents

Question 4

Content type
User Generated
Subject
Data Analytics
School
Grand Canyon University
Type
Homework
Showing Page:
1/2
Question 3: You are interested in understanding the demographics of a particular cohort in your
data set: those who have a bachelor's degree or higher whose occupation is also "Exec-managerial."
(Hint: First write code to subset those with occupational category of "Exec-managerial," then write
code to subset for educational level.)
Use the appropriate R function(s) to report the count of individuals who meet these criteria along
with their average age and the percentage who earn more than $50,000 annually. Include a
screenshot of the R console output as part of the answer.
Question 4: Using the Age variable, create a new variable that divides Age into age categories.
Your categories should be as follows: Under 25; 25-34; 35-44; 45-54; 55-64; 65+. The code to create
the first category would be as follows:
incomedat$age_cat[incomedat$Age < 25] <- "<25"
Use this line of code as a template to create the other categories. Ensure that your code worked by
showing a table with the age categories and the counts of individuals in each category.

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
Question 3: You are interested in understanding the demographics of a particular cohort in your data set: those who have a bachelor's degree or higher whose occupation is also "Exec-managerial." (Hint: First write code to subset those with occupational category of "Exec-managerial," then write code to subset for educational level.) Use the appropriate R function(s) to report the count of individuals who meet these criteria along with their average age and the percentage who earn more than $50,000 annually. Include a screenshot of the R console output as part of the answer. Question 4: Using t ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4

Similar Documents