Question

Q4: (1) Create vector s as a random sample of 12 numbers from 1, 2, 3, ..., 99, 100 without replacement, using function samplPlease use R. Thank you!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOURCE CODE:

*Please follow the comments to better understand the code.

**Please look at the Screenshot below and use this code to copy-paste.

***The code in the below screenshot is neatly indented for better understanding.


# STEP1 Create the vector s as the random sample from 1 to 100

#Pick 12 random numbers. So, size=12

#Without Replacement, So, replace=FALSE

s <- sample(x = 1:100,size = 12,replace = FALSE)


#STEP 2

# Print the data structure of s

print(s)

===================================================

WE WILL GET 12 RADNOM UNIQUE numbers from 1 to 100 every time we run the program

=====================================================

SCREENSHOT:

main. saved 1 # STEP1 Create the vector s as the random sample from 1 to 100 using GNU R Version 3.5.0 (2018-04-23) Er main.rmain. saved 1 # STEP1 Create the vector s as the random sample from 1 to 100 using GNU R Version 3.5.0 (2018-04-23) Irmain.r

main.r saved 1 # STEP1 Create the vector s as the random sample from 1 to 100 using GNU R Version 3.5.0 (2018-04-23) Er main.

If there are any doubts, comment down here. We are right here to help you. Happy Learning..!! PLEASE give an UPVOTE I Have Pu

Add a comment
Know the answer?
Add Answer to:
Please use R. Thank you! Q4: (1) Create vector s as a random sample of 12...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please code in C thank you. 1. Create an array with 20 random numbers between 1...

    Please code in C thank you. 1. Create an array with 20 random numbers between 1 and 100. Incorporate the following specifications. • Send the base address of the array and an integer to a function called sort(). • The integer is a user input which is either 0 or 1. If the user does not enter either 0 or 1, keeping asking the user until you get the right input. • If the user input is 0, sort the...

  • Use the rbinom() function to create a vector of 1000 random observations from the binomial distribution...

    Use the rbinom() function to create a vector of 1000 random observations from the binomial distribution with n=100 and probability of success is equal to 0.4. Calculate the mean and standard deviation statistics for this vector of random draws using the mean() and sd() commands. How do these numbers compare the mean and standard deviation of the binomial distribution when  and ? If they are different, why? Make a histogram of this vector using the hist() command.

  • 3) Create a vector of noisy data by adding a trigonometric function to a random number,...

    3) Create a vector of noisy data by adding a trigonometric function to a random number, starting from your month of birth up to last 5 digits of your student ID number. So, a student with an ID number of 110030110 should create random numbers up to 30110. Calculate statistical values of the random data and print them to the command window in a tabular format. Smooth that noisy data with a moving average filter using a step size of...

  • Use MATLAB to solve this problem. Thank you. Upload the assignment to CANVAS, it should include...

    Use MATLAB to solve this problem. Thank you. Upload the assignment to CANVAS, it should include two things: the PDF and the zipped folder. Late assignments are not accepted. For the questions below, do not create the arrays or matrices by hand. Instead, use built-in MATLAB functions and shorthand notations. Otherwise, no points will be given. 1) Create a function called my product that computes the multiplication of the numbers in any vector using a while loop. The function should...

  • hi can you please help me solve this problem?..thank you.. Figure Q4(d) shows the Hard Disk...

    hi can you please help me solve this problem?..thank you.. Figure Q4(d) shows the Hard Disk Drive Read/Write structure. 8-bits data is currently (d) being stored from location 0 to 7, and the data reading and writing is done magnetically Reference: Write Head Read Head NWrite Write 1 (1) (0) N Figure Q4(d) (i) Using the reference write (1) and write (0), explain the process of writing 110011002 into location 0 to 7. [5 marks] (ii) Using the positive edge...

  • STATS Use the R function rnorm() to simulate selecting a random sample of size 25 from...

    STATS Use the R function rnorm() to simulate selecting a random sample of size 25 from a population with mean 80 and s.d. 20. The goal here is to show how contamination affects the mean, s.d., and z-scores. (a) Obtain the sample mean and sample sd of the simulated sample and use them to obtain the z-score for 100. (b) Create the vector contam = c(0,seq(1000,10000,length=21)) To show the effects of contamination, separately add each value of contam to the...

  • Q4 please and thank you (3) You are given that the vector field f in Q2 is conservative. Find the corresponding potential function and use this to check the line integral evaluated in Q2. (4) Conside...

    Q4 please and thank you (3) You are given that the vector field f in Q2 is conservative. Find the corresponding potential function and use this to check the line integral evaluated in Q2. (4) Consider the vector field F(x, y) -ryi - 2j (-Fii F2j) and let C be the closed curve consisting of three segments: the straight line from (0, 0) to (1,0) followed by the circular arc from (1,0) to (0,1) followed by the straight line from...

  • 1. Please use R. (1). Please use R. Please create a function which can operate t...

    1. Please use R. (1). Please use R. Please create a function which can operate t hypothesis testing with one population (two-tailed test). After entering vector data, significant level, and degree of freedom, output the word "reject HO" if the testing result rejects the null hypothesis. Output the word "do not reject HO" if the result does not reject the null hypothesis. Hint: use length to determine the degree of freedom of the t-distribution. (2). A factory claims its products...

  • Please help with the below. Thank you! Please use R Console: I have to create a...

    Please help with the below. Thank you! Please use R Console: I have to create a command in R console so that below all has 3 bins. Below is the data: 107 194 146 40 8 4 1 Please show the command so that all have minimum 3 bins. The command should be something like the below: newbreaks=c(breaks[1], breaks[i:j],breaks[n])

  • I must use R Program to solve them. Please help! Thank you ünif uniform random variable...

    I must use R Program to solve them. Please help! Thank you ünif uniform random variable 1) Draw the graphs of the p.d.f. of the following distributions (a) The standard normal p.d.f (b) The normal pdf with ? = 50, ? = 10 (c) The uniform p.d.f. over interval [10, 20] (d) The exponential P.d.f with parameter ? 4. 2) Illustrating the central limit theorem. Let X be a random variable having the uniform distribution over the interval [6, 12]...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT