Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use R to answer the questions below # For this assignment we will use the Prestige dataset from a library called car. Load the packages

Use R to answer the questions below

# For this assignment we will use the Prestige dataset from a library called car. Load the packages that contain the dataset and the data package

https://cran.r-project.org/web/packages/carData/index.html

Can also download the data in R using: install.packages("carData")

# Prestige is a dataset of Canadian Occupations. To find more information about this dataset, use the command ?Prestige

# Q1. Provide a count of how many observations (records) there are. (1 Point)

# Q2. Provide variable names and types (e.g., numeric, categorical, character, etc.) of the fields. (2 points)

# Q3. For numeric variable education, provide following summary stats: (1 Point) # a. Mean # b. Median # c. Range # d. Standard deviation. # e. Maximum and Minimum

# Q4. For the categorical variable type, produce these types of summary stats: (4 Points) # a. What are the different levels. # b. What are the counts of distinct categories. Hint: the function table() comes in handy. # c. A bar plot. # d. A piechart and title it as Occupation Types

# Q5. Provide a summary of all the variables from the Prestige dataset in one table. (1 Point)

# Q6. For the variable income: (3 Points) # a. How many times was the income equal to or more than $5000?

# b. What percent of incomes are less than $6798 ?

# c. What is the sum of all incomes below $5930?

# Q7. For further analysis: (4 Points) # a. Create a subset of numeric variables and call the new dataset prestige_numeric. Reminder that census is not a numeric variable.

# b. Provide summary statistics for all the variables in prestige_numeric in one table.

# c. Create a histogram for the variable income.

# d. Create a histogram for proportions for the variable prestige

# Q8. For the categorical variable census: (4 Points) # a. Create a variable called census_categories and aggregate all the values in 3 categories with three intervals (1113 3000, 3001-6000, 6001-9518).

# b. Assign three levels (low, medium, and high) to these categories.

# c. Provide a table with summary results.

# d. Provide a bar plot and a pie chart for this variable.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

1. Which is the most abundant gas presented in the atmosphere?

Answered: 1 week ago