Question: I just would like to know the necessary r code. I do not want the output but just the code that I can use. For

I just would like to know the necessary r code. I do not want the output but just the code that I can use. For example, in question one, how do you substitute all values not between 99th percentile and 1st percentile with missing values. I just need the r code representation of the arguments.

dataframe is india04_new

the packages used:

install.packages("nycflights13")

library(tidyverse)

library(nycflights13)

data(diamonds)

load("india04.Rdata")

  1. Use theifelse()function to form a new variable calledincwage_adjin a new dataframe calledindia04_new2, where all the income values that arenotbetween the 1st and the 99th percentile are substituted with missing values (NA).
  2. Usingindia04_new2, form a new variable calledlog_incwage_adj, that is the natural logarithm ofincwage_adj. Save the resulting dataframe as a new objectindia04_new3.
  3. Plot a histogram oflog_incwage_adjfromindia04_new3constructed above. How does it look different from the same histogram constructed using the natural log transformation of theincwagevariable from theindia04_newdataframe?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Economics Questions!