The command quantile(data, probs = a) will find the 100ath percentile of the data set data. In
Question:
The command quantile(data, probs = a) will find the 100ath percentile of the data set data. In other words, x = quantile(data, probs = 0.75) will find the value x in data so that 75% of other values are less than x.
(a) Find the 35th percentile of price in the mispriced_diamonds.csv data set.
(b) Use subsetting and create a new data frame called diamonds_35th that only contains diamonds with a price that is less than your answer in part (a).
(c) Find the total number of rows in the data frame diamonds_35th. (d) Verify that the number of diamonds in diamonds_35th is 35% of the number of diamonds in the original data set. Hint: The number of rows from part (c) is the number of diamonds in diamonds_35th. Find the number of diamonds in the original data set by finding the number of rows in the original data set. Hint 2: You don’t need to use a specific R command or function to find the percent, just use division, which is the forward slash / (e) Use the command write_csv to write the data frame diamonds_35th to a file. Hint: You need to load the package tidyverse (or readr) to use write_csv.
Financial Algebra advanced algebra with financial applications
ISBN: 978-0538449670
1st edition
Authors: Robert K. Gerver