Question: 1 ) Compile your R script and save it as a docx / html / pdf file using compile function in RStudio. Upload the compiled
Compile your R script and save it as a docxhtmlpdf file using compile function in RStudio. Upload the compiled file points
Grade:
Set directory: point
Compiled file that includes all the steps implemented correct: points
Task : points
Task : points
HINT: This Lab is to practice what you have learn in Chapter The majority of the required materials to do this Lab is in Chapter of your textbook as well as materials presented to cover Chapter
A key focus of our class this week has been distributions A distribution is simply an arrangement of values of a variable such as the population size of a state. A probability distribution is an arrangement of all the values potential outcomes of a variable that reflect the frequency of those values in nature. A distribution can either be empirical, which means that it is an actual bunch of numbers, or it can be theoretical, in which case we are just imagining an ideal arrangement of numbers. The normal or bell curve is just such a theoretical distribution.
The R open source statistical system is great at creating empirical distributions that are made up of randomly generated numbers. In Chapter the book includes several commands and explanations of randomly generated distributions. Chapter decided that the distribution of the population sizes of states was geometric and while this is one possibility, a better choice would be the socalled Pareto distribution. We can use R to generate a Pareto distribution of state populations that may be quite similar to the populations of the actual US states. In other words, we can generate random numbers for the sizes of the Fictional States of America.
#####Set the directory point#########################################
Task : Write, test, and submit the necessary code in R to accomplish the following:
Generate a normal distribution, or samples, with a mean of
Write a function that takes three variables a vector, a min and a max and returns the number of elements in the vector that are between the min and max including the min and max
HINT: Plug in XXX below to create the function.
myFunction functionvector min, max
b lengthXXXXXX XXX & XXX XXX
returnb
Use the function to see how many of your normal distribution samples are within the range of to Pass the "distribution" as the vector parameter, as the minimum parameter, and as the maximum parameter.
Repeat times creating a normal distribution and then calling your function to see if the results vary.
Task : Write, test, and submit the necessary code in R to accomplish the following:
Install actuar OR VGAM package and load the actuar OR VGAM package. Either one of these packages will work. Just use whatever works for you.
Generate random numbers in a Pareto distribution and assign them to a variable called FSApops shape and scale arguments will be explained in
Specify a scale and a shape for your Pareto distribution that makes it as similar as possible to the actual distribution of state populations on page of the textbook.
# rpareton m s: generating random numbers that fit a Pareto distribution
# n generate values; m location parameter set it to be about the population size of Wyoming;
# s vector of dispersion parameters.
Create a histogram that shows the distribution of values in FSApops.
Use a command to report the actual mean and standard deviation of the values stored in FSApops.
Use a command to report the minimum and maximum value of FSApops.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
