Step-by-step explanation:
This problem is not about percent or relative change, but about absolute change. Its solution is very simple:
Absolute change, or
change = new value - old value
= 56 - 45 = 11 (increase)
b. purchase a large quantity of an item
c. commit to buy more in the future
h(x) = x^2 - x + 7
Find f[g(5)]
A. 92
B. 2
C. 30
D. 242
Answer:
A
Step-by-step explanation:
Evaluate g(5), then use the value obtained to evaluate f(x) , that is
g(5) = 2(5)² - 4(5) = 2(25) - 20 = 50 - 20 = 30, then
f(30) = 3(30) + 2 = 90 + 2 = 92
Answer:
1, -1
Step-by-step explanation:
b. Create a vector x by generating n=50 numbers from N(mean=30,sd=2) distribution. Calculate the confidence interval from this data using the CI formula. Check whether the interval covers the true mean=30 or not.
c. Repeat the above experiments for 200 times to obtain 200 such intervals. Calculate the percentage of intervals that cover the true mean=30. This is the empirical coverage probability. In theory, it should be very close to your CL.
d. Write a function using CL as an input argument, and the percentage calculated from question c as an output. Use this function to create a 5 by 2 matrix with one column showing the theoretical CL and the other showing the empirical coverage probability, for CL=.8, .85, .9, .95,.99.
a. To find the z score for a given confidence level, you can use the `qnorm()` function in R. The `qnorm()` function takes a probability as an argument and returns the corresponding z score. To find the z score for a 95% confidence level, you can use `qnorm(1-.025)`:
```R
z <- qnorm(1-.025)
```
This will give you the z score for a 95% confidence level, which is approximately 1.96.
b. To create a vector `x` with 50 numbers from a normal distribution with mean 30 and standard deviation 2, you can use the `rnorm()` function:
```R
x <- rnorm(50, mean = 30, sd = 2)
```
To calculate the confidence interval for this data, you can use the formula:
```R
CI <- mean(x) + c(-1, 1) * z * sd(x) / sqrt(length(x))
```
This will give you the lower and upper bounds of the 95% confidence interval. You can check whether the interval covers the true mean of 30 by seeing if 30 is between the lower and upper bounds:
```R
lower <- CI[1]
upper <- CI[2]
if (lower <= 30 && upper >= 30) {
print("The interval covers the true mean.")
} else {
print("The interval does not cover the true mean.")
}
```
c. To repeat the above experiment 200 times and calculate the percentage of intervals that cover the true mean, you can use a for loop:
```R
count <- 0
for (i in 1:200) {
x <- rnorm(50, mean = 30, sd = 2)
CI <- mean(x) + c(-1, 1) * z * sd(x) / sqrt(length(x))
lower <- CI[1]
upper <- CI[2]
if (lower <= 30 && upper >= 30) {
count <- count + 1
}
}
percentage <- count / 200
```
This will give you the percentage of intervals that cover the true mean.
d. To write a function that takes a confidence level as an input and returns the percentage of intervals that cover the true mean, you can use the following code:
```R
calculate_percentage <- function(CL) {
z <- qnorm(1-(1-CL)/2)
count <- 0
for (i in 1:200) {
x <- rnorm(50, mean = 30, sd = 2)
CI <- mean(x) + c(-1, 1) * z * sd(x) / sqrt(length(x))
lower <- CI[1]
upper <- CI[2]
if (lower <= 30 && upper >= 30) {
count <- count + 1
}
}
percentage <- count / 200
return(percentage)
}
```
You can then use this function to create a 5 by 2 matrix with one column showing the theoretical CL and the other showing the empirical coverage probability:
```R
CL <- c(.8, .85, .9, .95, .99)
percentage <- sapply(CL, calculate_percentage)
matrix <- cbind(CL, percentage)
```
This will give you a matrix with the theoretical CL in the first column and the empirical coverage probability in the second column.
Know more about z score here:
#SPJ11