Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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")
- 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).
- 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.
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started