Question

Instructions: You are not required to use R markdown for the lab assignment. Please include ALL...

Instructions: You are not required to use R markdown for the lab assignment. Please include ALL R commands you used to reach your answers in a word or pdf document. Also, report everything you are asked to do so

Problem 2 : Answer the following questions:

1. First run alphas <- seq(0.1, 1, by = 0.1) and nalphas <- - rev(alphas). Based on what you have seen, describe how functions seq and rev work. Then run qnorm(c(nalphas, alphas)) and report the result you get. What are they? What pattern did you notice and why?

2. Use the function rnorm to generate 10000 random numbers from N(50, 4), store those random numbers into a vector called firstrn. It is expected that the sample mean of firstrn should be close to the population mean 50. Use the function mean to verify this.

3. Suppose X ∼ Possion(2). Report the probability that P(1 < X ≤ 5). Show the code you used to reach this answer.

Homework Answers

Answer #1

1. The seq function gives a increasing Arithmetic progression while the "rev" givea a reverse sequence of a vector.

The qnorm produced by nalphas are NaNs because the percentile values can't be negative.

Here is the R code:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
R Studio must be used to answer these questions 1. You know that 85% of the...
R Studio must be used to answer these questions 1. You know that 85% of the distribution of a standard normal random variable lies to the left of a given value. How do you determine the given value? Group of answer choices a. qnorm(.85) b. pnorm(.85) c. 1-pnorm(.85) d. 1-dnorm(.85) 2. You want to generate 1000 random values from a normal distribution with mean 100 and standard deviation 15. What command will produce these values? Group of answer choices a....
Question (2) [5 marks] (Use R) Suppose you have a company producing cupcakes. Each cupcake is...
Question (2) [5 marks] (Use R) Suppose you have a company producing cupcakes. Each cupcake is supposed to contain 10 grams of sugar. The cupcakes are produced by a machine that adds the sugar in a bowl before mixing everything. You believe the machine does not add 10 grams of sugar for each cupcake. If your assumption is true, the machine needs to be fixed. You stored the level of sugar of thirty cupcakes. Note: You can create a randomized...
For this lab assignment you will need to write some code and create some graphs. You...
For this lab assignment you will need to write some code and create some graphs. You may use excel to create your graphs, or other language of your choice. Your data needs to demonstrate the experimental running time for Selection Sort (code in book), Merge Sort (code in book), and the Arrays.sort() method. Here is a basic outline of how you need to code this assignment. 1) Create several arrays of size 100, 1000, 10000, 100000, 1000000, … (you need...
Use R to do each of the following. Use R code instructions that are as general...
Use R to do each of the following. Use R code instructions that are as general as possible, and also as efficient as possible. Use the Quick-R website for help on finding commands. 1. Enter the following values into a data vector named Dat: 45.4 44.2 36.8 35.1 39.0 60.0 47.4 41.1 45.8 35.6 2. Calculate the difference between the 2nd and 7th entries of this vector using only reference indices. 3. Calculate the median of Dat. 4. Sort the...
R Code Directions: All work has to be your own, you may not work in groups....
R Code Directions: All work has to be your own, you may not work in groups. Show all work. Submit your solutions in a pdf document on Moodle. Include your R code (which must be commented and properly indented) in the pdf file. Name this pdf file ‘your last name’-HW5.pdf. Also submit one text file with your R code, which must be commented and properly indented. You may only use ‘runif’ to generate random numbers; other random number generating functions...
CAN ANYONE SOLVE THIS BY USING R ? CAN YOU PLEASE NOT USE the (CORRECT=F FUNCTION)...
CAN ANYONE SOLVE THIS BY USING R ? CAN YOU PLEASE NOT USE the (CORRECT=F FUNCTION) WHEN SOLVING PART B, I AM NOT VERY CLEAR WITH THAT. 2) From a random sample of 673 items made by a particular manufacturing process, it is found that 27 are defective. (a) (1 mark) Find a 99.5% confidence interval for the proportion of defective items made by the process. (Also include the commands and output.) (b) (1 mark) Give the command and output...
Instructions: Be sure to define all random variables/events used in probability calculations. You should obtain “exact”...
Instructions: Be sure to define all random variables/events used in probability calculations. You should obtain “exact” probabilities from R rather than giving approximate probabilities using the 68-95-99.7 rule. Provide any code you use (final computed values are not sufficient). I strongly recommend that you create a Jupyter Notebook for this assignment, embedding your written comments in Markdown cells. 2. The systolic blood pressure for female diabetics between the ages of 30 and 34 has mean 131 mmHg and standard deviation...
PLEASE USE R CODE!! Continue to generate standard normal random variables until you have generated n...
PLEASE USE R CODE!! Continue to generate standard normal random variables until you have generated n of them, where n≥100 is such that S/sqrt(n) <0.1, where S is the sample standard deviation of the n data value. (a)How many normals do you think will be generated? (b)What is the sample mean of all the normals generated? (c)What is the sample variance?
R Code Directions: All work has to be your own, you may not work in groups....
R Code Directions: All work has to be your own, you may not work in groups. Show all work. Submit your solutions in a pdf document on Moodle. Include your R code (which must be commented and properly indented) in the pdf file. Name this pdf file ‘your last name’-HW5.pdf. Also submit one text file with your R code, which must be commented and properly indented. You may only use ‘runif’ to generate random numbers; other random number generating functions...
can you please do this lab? use lunix or C program its a continuation of a...
can you please do this lab? use lunix or C program its a continuation of a previous lab. the previous lab: Unix lab 4: compile and link multiple c or c++ files Please do the following tasks step by step: create a new directory named by inlab4 enter directory inlab4 create a new file named by reverse.c with the following contents and then close the file: /*reverse.c */ #include <stdio.h> reverse(char *before, char *after); main() {       char str[100];    /*Buffer...