Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I cannot figure out the R codes for the following questions. The packages I am using are: library(tidyverse) library(nycflights13) data(diamonds) load ( india04.Rdata ) I

I cannot figure out the R codes for the following questions.

The packages I am using are:

 library(tidyverse) library(nycflights13) data(diamonds) load("india04.Rdata")

I am sharing exercise 1 just for the sake of giving a complete picture. I only need help with the r codes of exercise 2.

image text in transcribedimage text in transcribed
Section 1 Exercises 1. (3 pts) Filter out the Unknown category from the edattain variable in the indiae4 dataframe. Save the resulting dataframe as india04_new . Use the indiae4_new dataframe to answer the remainder of the questions in this section. 2. (7 pts) Show one example of how you could explore the distribution of each of the age , edattain , and incwage variables in indiae4_new. What do you learn? 3. (5 pts) Compare and contrast coord_cartesian() vs xlim() when zooming in on a histogram. 4. (5 pts) What does na.rm = TRUE do in max() and mean() functions? Test each command on the variable incwage in india04_new . 5. (5 pts) What is the highest income level observed in the data? 6. (5 pts) How many individuals earn exactly 200 rupees? How many earn 201? What are your thoughts on this difference?Section 2 Exercises Start from the indian4_new dataframe you created in Section 1 Exercise 1: 1. (5 pts) Use the ifelse() function to create a new variable called incwage_adj in a new dataframe called india04_new2 , where all the income values that are not between the 1st and the 99th percentile are substituted with missing values (NA). 2. (5 pts) Using indiae4_new2 , create a new variable called log_incwage_adj , that is the natural logarithm of incwage_adj . Save the resulting dataframe as a new object india04_news 3. (5 pts) Plot a histogram of log_incwage_adj from indiae4_news constructed above. How does it look different from the same histogram constructed using the natural log transformation of the incwage variable from the india04_new dataframe

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

International economics

Authors: Robert J. Carbaugh

13th Edition

978-1439038949, 1439038945, 978-8131518823

More Books

Students also viewed these Economics questions

Question

Explain the importance of Human Resource Management

Answered: 1 week ago

Question

Discuss the scope of Human Resource Management

Answered: 1 week ago

Question

Discuss the different types of leadership

Answered: 1 week ago

Question

Write a note on Organisation manuals

Answered: 1 week ago