Starting from:

$50

STA442 Assignment 1 Solution

1.Let Y ∼ Bin(n = 30,π = 0.9). Y can be interpreted as the number of successes in a sample of size n = 30 from a Binomial distribution with probability of success π = 0.9.
(a) Let the observed number of success after 30 trials is y = 27. Calculate Wald and score
(b) Simulate N = 100,000 observations of Y using R function rbinom(). Calculate the Wald and Score 95% confidence interval for each of the observations. This means you are calculating 100,000 confidence intervals of each type. Calculate the proportion of these Wald intervals that contain 0.9 (the true value of π). Also calculate the proportion of score intervals that contain 0.9. Compare the results and comment on your findings.
2. Same as the previous question Let Y ∼ Bin(n = 30,π) and y = 27. This time we don’t know the true value of π
3. (a) Perform the following simulation (for this please set the seed to your student ID),
• Generate 500 random values from X1 ∼ Uniform[−10,10], X2 ∼ N(0,4) and X3 ∼
Bernoulli(0.7)
• Set β = (−0.8,0.1,0.2,0.3)
• Simulate Yi ∼ Poisson(µi), where, µi = exp(∑j xijβj)

More products