Answered step by step
Verified Expert Solution
Link Copied!

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")

  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

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

Slavery And American Economic Development

Authors: Gavin Wright

1st Edition

0807152285, 9780807152287

More Books

Students also viewed these Economics questions

Question

Explain the key components of an assessment center (AC).

Answered: 1 week ago