Question: R Programming: Use preexisting functions in R to write a function called ourhist that produces a pro- portion histogram of a numerical vector x such
R Programming:
-
Use preexisting functions in R to write a function called ourhist that produces a pro- portion histogram of a numerical vector x such that the number of breaks is determined by the Scott method and the histogram is overlaid with the density line. Test it on 100 randomly generated observations from the Exp(3) distribution.
-
Using the ifelse() function, write a function that adds 1 to all the positive entries of a vector and subtracts one from all the non-positive entries. Test it on 100 randomly generated observations from the N(0,1) distribution, and use the function from the previous problem to create a histogram of the modified sample.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
