Question

In: Statistics and Probability

Is there an R code that would allow me to run a random sample 10,000 times...

Is there an R code that would allow me to run a random sample 10,000 times without having to run the code created individually?
I have completed the first two tasks, but I do not know if R has a repeat code that would speed things up.

Now using the “Minutes” column generate a random sample size of 5. (THIS HAS ALREADY BEEN COMPLETED BY ME. JUST ANSWER THE QUESTION CONCERNING THE THIRD ONE AND THE R CODE).

Calculate the sample mean and record it (write a direct R program to record this) (THIS HAS ALREADY BEEN COMPLETED. PLEASE JUST ANSWER THE LAST QUESTION CONCERNING THE R CODE)

Continue steps (b) and (c) 10,000 times (that means you have recorded 10,000 sample means)

Solutions

Expert Solution


Related Solutions

R code Need assistance in getting this R code to run variables (Process) char ( Age)...
R code Need assistance in getting this R code to run variables (Process) char ( Age) char tmp <- expand.grid(Process = unique(words$Process),Age =unique(words$Age)) X <- model.matrix(~ factor(Process):factor(Age), data = tmp) glht(mod, linfct = X)
Can someone show me the R code to accomplish this? In R, Construct scatter plots of...
Can someone show me the R code to accomplish this? In R, Construct scatter plots of y versus x, y versus ln(x), ln(y) versus ln(x) and 1/y versus 1/x. Include your R code in a separate file. The article “Reduction in Soluble Protein and Chlorophyll Contents in a Few Plants as Indicators of Automobile Exhaust Pollution” (Intl. J. of Environ. Studies, 1983: 239-244) reported the accompanying data on x distance from a highway (meters) and y lead content of soil...
The run times of two computer programs, A and B, are independent random variables. The run...
The run times of two computer programs, A and B, are independent random variables. The run time of program A is an exponential random variable with mean 3 minutes, while that of program B is an Erl(2,lambda) random variable with mean 3 minutes. If both programs are being executed on two identical computers, what is the probability that program B will finish first?
Sample Code and Models Run each of the models below and explain the code function and...
Sample Code and Models Run each of the models below and explain the code function and your findings for each system, do they agree/disagree with what you understand and why ?? Matlab Code % Winter 2018 Control Engineering % Lab No.3 - Root Locus problems % Mark Clarke clear s = tf('s') K = 1150; %Proportional Controller Gain, May need to be altered? % Enter Model 1 % This is a model of a simple 2nd order with no zeros...
I cannot get this code to run on my python compiler. It gives me an expected...
I cannot get this code to run on my python compiler. It gives me an expected an indent block message. I do not know what is going on. #ask why this is now happenning. (Create employee description) class employee: def__init__(self, name, employee_id, department, title): self.name = name self.employee_id = employee_id self.department = department self.title = title def __str__(self): return '{} , id={}, is in {} and is a {}.'.format(self.name, self.employee_id, self.department, self.title)    def main(): # Create employee list emp1...
A simple random sample of 12 reaction times of helicopter pilots is selected. The reaction times...
A simple random sample of 12 reaction times of helicopter pilots is selected. The reaction times have a normal distribution. The sample mean is 1.67 sec with a standard deviation of 0.16 sec. Construct a 90% confidence interval for the population standard deviation. 1. 0.11 < σ < 0.23 2. 0.01 < σ < 0.05 3. 0.12 < σ < 0.25 4. 0.13 < σ < 0.22
CODE IN PYTHON: Your task is to write a simple program that would allow a user...
CODE IN PYTHON: Your task is to write a simple program that would allow a user to compute the cost of a road trip with a car. User will enter the total distance to be traveled in miles along with the miles per gallon (MPG) information of the car he drives and the per gallon cost of gas. Using these 3 pieces of information you can compute the gas cost of the trip. User will also enter the number of...
pl use R code to do that and show me the program Use a linear regression...
pl use R code to do that and show me the program Use a linear regression of Y~log(X) using the labtestdata.csv data to predict Y (2dp) when x = 250 on the unlogged scale? Calculate the F-value (1 dp) from an ANOVA on the regression of Y~log(X) using the data contained in labtestdata.csv abtestdata.csv y x 1.018746 1 1.508895 2 0.727282 3 1.787127 4 2.903983 5 3.181554 6 1.737834 7 2.715766 8 1.570552 9 3.046107 10 4.499675 11 4.240688 12...
8.Write in R code. a)stimulate a string of 10,000 characters drawn uniformly and independently for the...
8.Write in R code. a)stimulate a string of 10,000 characters drawn uniformly and independently for the set {A,C,G,T} [HINT: sample] b) create a frequency table of the string [HINT:table] c) write a function to create a contingency table of adjacent k-tuples. For example, with k=3 and with the string "CAGACAAAAC", you would want to produce the following table: [ ONLY USE FOR LOOPS AND PASTE (,collapse=""), DO NOT USE EMBED, SUBSTR, or DO.CALL] AAA AAC ACA AGA CAA CAG GAC...
Write a python script to solve the 4-queens problem using. The code should allow for random...
Write a python script to solve the 4-queens problem using. The code should allow for random starting, and for placed starting. "The 4-Queens Problem[1] consists in placing four queens on a 4 x 4 chessboard so that no two queens can capture each other. That is, no two queens are allowed to be placed on the same row, the same column or the same diagonal." Display the iterations until the final solution Hill Climbing (your choice of variant)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT