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
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...
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...
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...
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?
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 MAT LAB ONLY. THANK YOU (a) Create and plot the signals listed below and...
PLEASE USE MAT LAB ONLY. THANK YOU (a) Create and plot the signals listed below and save your Matlab code in a script file. i) Cosine signal of frequency 100 Hz over the range [0,0.1] seconds and samples spaced 10^- 4 seconds apart with a phase of pi/2 and an amplitude of 1.   PLEASE USE MAT LAB ONLY. THANK YOU ii) A square wave that oscillates between 0 and 1 every five samples, plot 3 periods of the waveform. iii)...
Assignment - Practical Coding (CPT) "Medicine" Section Please read the overview and instructions before attempting this...
Assignment - Practical Coding (CPT) "Medicine" Section Please read the overview and instructions before attempting this assignment. You may refer to Buck Step By Step Ch 26 "Medicine". Copy and Paste your completed assignment (only) on a separate MS word document or compatible file, and submit electronically via Moodle prior to due date. OVERVIEW Procedure coding is the transformation of written descriptions of procedures and professional services into numeric designations (code numbers). The physician rendering medical care either writes or...
Show all your work. Indicate clearly the methods you use, because you will be scored on...
Show all your work. Indicate clearly the methods you use, because you will be scored on the correctness of your methods as well as on the accuracy and completeness of your results and explanations. A bank categorizes its customers into one of three groups based on their banking habits. A random sample of 30 customers from each group was selected, and the number of times each customer visited the bank during the past year was recorded. The following table shows...