6. The sample function is useful for sampling from a vector. For example, if X <- c(1,2,3,4,5) then sample(x,3, replace=

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899559
Joined: Mon Aug 02, 2021 8:13 am

6. The sample function is useful for sampling from a vector. For example, if X <- c(1,2,3,4,5) then sample(x,3, replace=

Post by answerhappygod »

6 The Sample Function Is Useful For Sampling From A Vector For Example If X C 1 2 3 4 5 Then Sample X 3 Replace 1
6 The Sample Function Is Useful For Sampling From A Vector For Example If X C 1 2 3 4 5 Then Sample X 3 Replace 1 (56.35 KiB) Viewed 36 times
6. The sample function is useful for sampling from a vector. For example, if X <- c(1,2,3,4,5) then sample(x,3, replace=FALSE) will randomly sample three elements from x without replacement, sample(x,3,replace=TRUE) will randomly sample three elements from x with replacement, and sample(x) will return a random permutation of the elements of x. Write R code that will randomly permute the rows of the data frame iris. 7. Write R code that will create the matrices [1 2 3 X = 4 5 6 and Y | 7 8 9 and perform the following computations. Note that the transpose of a matrix if found using the t function and the inverse of a matrix X is found as solve(x). (a) X'X+X (b) Y'XY (c) (X'X)-1 8. Using the recycling rules in R, show a simple way of creating the matrix - х without having to type in all of the entries.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply