Question

In: Statistics and Probability

Using piping %>%, sample from the vector 1:10 1000 times with replacement, calculate the resulting sampled...

Using piping %>%, sample from the vector 1:10 1000 times with replacement, calculate the resulting sampled vector’s mean, then exponentiate that mean.
Please write in R Language. Thanks.

Solutions

Expert Solution

#load the package
library(dplyr)
#set the seed to reproduce the result
set.seed(123)
#sample of 1000 numbers from the elements
#of the vector 1:10 with replacement
sample(1:10, size = 1000, replace = TRUE) %>%
#compute the sample's mean
mean() %>%
#exponentiate the mean
exp()

Sample Output

P.S. - Please let me know if you have any query.


Related Solutions

Suppose you toss a fair coin 10 times resulting in a sequence of heads (H) and...
Suppose you toss a fair coin 10 times resulting in a sequence of heads (H) and tails (T). Let X be the number of times that the sequence HT appears. For example, HT appears thrice in THTHHTHHHT Find E(X). Use Indicator random variables.
Suppose you toss a fair coin 10 times resulting in a sequence of heads (H) and...
Suppose you toss a fair coin 10 times resulting in a sequence of heads (H) and tails (T). Let X be the number of times that the sequence HT appears. For example, HT appears thrice in THTHHTHHHT Find E(X). Hint: Use Indicator random variables.
The results of sampling independent populations: sample 1 from population 1 • mean 1000 • sample...
The results of sampling independent populations: sample 1 from population 1 • mean 1000 • sample standard deviation 400 • sample size 50 sample 2 from population 2 • mean 1250 • sample standard deviation 400 • sample size 50 Test the HO: population 1 mean = population 2 mean at alpha = 0.01. HA: population 1 mean =/ population2 mean. This is a two-tailed test with both a negative lower critical value and a positive upper critical value. Separate...
Using the data collected for each lens, calculate (10 times) the focal length of each lens....
Using the data collected for each lens, calculate (10 times) the focal length of each lens. For both lenses, use the lens equation 1/p +1/q = 1/f. Long focal length lens Position of lens (cm) Position of screen (cm) 1 23.8 70.0 2 45.6 70.0 3 23.1 72.0 4 48.6 72.0 5 22.3 75.0 6 52.2 75.0 7 21.9 77.0 8 54.7 77.0 9 21.7 79.0 10 56.9 79.0 Short focal length lens Position of Lens (cm) Position of Screen...
A sample consists of 75 TV sets purchased several years ago. The replacement times of those...
A sample consists of 75 TV sets purchased several years ago. The replacement times of those TV sets have a mean of 8.2 years. Assume σ= 1.1 years. Find the 95% confidence interval. Why are you finding a confidence interval for Question 1? A random sample of 61 Foreign Language movies made in the last 10 years has a mean length of 135.7 minutes with a standard deviation of 13.7 minutes. Construct a 95% confidence interval. For items 1 and...
A random sample of size n = 2 is chosen without replacement from the set{ 1...
A random sample of size n = 2 is chosen without replacement from the set{ 1 , 2 , 3 } . X = 0 if the first number is even, and X = 1 if the first number is odd. Y = 0 if the second number is even, and Y = 1 if the second number is odd. a) List all of the samples. (b) Find the joint distribution of X and Y. (c) Are X and Y...
Calculate the [H+], [OH-], pH, pOH for the resulting solution if 20.00 mL sample of 0.2650...
Calculate the [H+], [OH-], pH, pOH for the resulting solution if 20.00 mL sample of 0.2650 M NaOH was titrated with 21.33 mL of 0.1175 M H2SO4.
1. A coin is tossed 100 times, each resulting in a tail (T) or a head...
1. A coin is tossed 100 times, each resulting in a tail (T) or a head (H). If a coin results in a head, Roy have to pay Slim 500$. If the coin results in a tail, Slim have to pay Roy 500$. What is the probability that Slim comes out ahead more than $20,000?
Calculate the activity at 25 degrees Celsius of NACl(s) at 1, 10, 100, and 1000 bar....
Calculate the activity at 25 degrees Celsius of NACl(s) at 1, 10, 100, and 1000 bar. The density of NaCl at 25 degrees Celsius and 1 bar is 2.16 (g/cm3).
In an opinion survey, a random sample of 1000 adults from the U.S.A. and 1000 adults...
In an opinion survey, a random sample of 1000 adults from the U.S.A. and 1000 adults from Germany were asked whether they supported the death penalty. 560 American adults and 590 German adults indicated that they supported the death penalty. Researcher wants to know if there is sufficient evidence to conclude that the proportion of adults who support the deal penally in the US is different than that in Germany. Use a confidence interval (at confidence interval of 98%) to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT