代写STAT 312: Basic Statistics for Engineering and Science Homework 2调试R语言
- 首页 >> Algorithm 算法STAT 312: Basic Statistics for Engineering and Science
Homework 2
See Canvas page ”Useful R functions for Statistics” for more information on functions like ppois() and qnorm().
You can find the data sets needed on the Canvas page ”Data sets for homework” .
1. (2 points) Let Y ~ Pois(4.5). Use the R function ppois() or dpois() to answer the following
(a) P (Y ≤ 7)
(b) P (2 ≤ Y < 6)
Note: ppois() is the cdf and dpois() is the pmf. Use help(ppois) in R to learn more about these functions.
2. (3 points) Let Y ~ N (5, 32). Use the built-in R functions pnorm() and qnorm() to answer the following
(a) P (Y > 7.8)
(b) P (1.6 < Y ≤ 7.8)
(c) Find y that satisfies P (Y ≤ y) = 0.95
3. Exercise 6.5.4 a,b (4pt) Note: A time series plot is simply a scatterplot of a variable against time (e.g. year).
4. Exercise 6S16 a, b, and d (6pt)
5. Exercise 6.S18 a (2pt) and b (1pt)
6. (2 points) Use the built-in R functions rnorm() to simulate 10,000 random numbers from the N (1, 22) distribution. Don’t show the numbers(!) just store them in a variable, say x. Note: Use set.seed( . . .) so that you will get the same answers each time you generate the report (’knit’ the .Rmd file)
Calculate the mean and the standard deviation of your sample. Are these values close to the population parameters (μ = 1 and σ = 2)?