Question

1. Suppose you have created a vector x in R using the command x <-c(2, 7, 3, 1, 9) . Please find the results for the following commands (2) xlc(1,3,5)] (3) x [2:4] (5) length(x) (6) x [2: length(x)1 (7) x[1: length(x)-1] (8) max(x) (9) min(x) 2. Besides the vector x in question 1, suppose you have created another vector y in R using the command y <- c(1, 2, 3, 4, 5). Please find the results for the following commands (3) x*y (4) x/y (5) (x+y)-2 (6) abs(x-y)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

s) 7 ley

Add a comment
Know the answer?
Add Answer to:
1. Suppose you have created a vector x in R using the command x <-c(2, 7,...
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
  • 1. Who created Powershell? 2. What is the "pipe" command and what is it used for?...

    1. Who created Powershell? 2. What is the "pipe" command and what is it used for? 3. What is the script that is used to find all the services that are currently running on the computer? 4. What is the PowerShell command to run Notepad? 5. What is are the aliases for the following PowerShell commands: Set-Location, Copy-Item, Get-Childitem, New-PSDrive.

  • 1. Find a 2x2 matrix A if for the vector v= [R], Av = [4 +38]...

    1. Find a 2x2 matrix A if for the vector v= [R], Av = [4 +38] 2. For this problem, use matrices A = La ), B=1 _Jandc=lo 9]. Suppose that the matrices A and B commute (so AB=BA) and the matrices A and C commute. Find the entries for the matrix A. 3. Find a number a so that the vectors v = [3 2 a) and w = [2a -1 3] are orthogonal (perpendicular). 4. For the vector...

  • Solve in MATLAB Problem 3: Given the vector x- [2 1 0 6 2 3 5...

    Solve in MATLAB Problem 3: Given the vector x- [2 1 0 6 2 3 5 3 4 1 3 2 10 12 4 2 7 9 2 4 51 use a for loop to (a) Add up the values of all elements in x (b) Compute the cumulative sum, y, of elements in x You can check your results using the built-in functions sum and cumsum. Q.5 What is the value of the sum of elements in vector x?...

  • Exercise 1: Use Matlab command to obtain the following a) Extract the fourth row of the...

    Exercise 1: Use Matlab command to obtain the following a) Extract the fourth row of the matrix generated by magic(6) b) Show the results of 'x' multiply by 'y' and 'y' divides by 'x'. Given x = [0:0.1:1.1] and y=[10:21] c) Generate random matrix 'r' of size 4 by 5 with number varying between -8 and 9 Exercise 2: Use MATLAB commands to get exactly as the figure shown below x=pi/2:pi/10:2*pi; y=sin(x); z=cos (x);

  • Using C++ to write .cpp and .h file. Main function and sample output are given. The...

    Using C++ to write .cpp and .h file. Main function and sample output are given. The task is to write a vector class for dynamic allocation.declare the the class named vector with the required attributes. The task are defined in the main function. #include <iostream> #include "vector.h". #define LOG(x,y) std::cout << x << y « std::endl; #define INFO(x) std::cout << "[INFO]: #define WARNING(x) std::cout <« "[WARNING]: "<< x <« std: :endl; << x << std::endl; " « x < std::endl;...

  • Need help. command or explanation. 3. Given the matrix A [3 7 4ti 5; 0 -i...

    Need help. command or explanation. 3. Given the matrix A [3 7 4ti 5; 0 -i -1 4; 3 8 4 -1] where i represents the imaginary number, run each of the commands below and explain the observed result. a. A c. A(10) f. A (I1 3], 13 2]) g. [A: A (end-1,:)1 h. A(, 12 4 1 3]) k. 1. m. n. o. p. sum (A) sum (A, 2) [A; sum (A) ] numel (A) B = reshape (A,...

  • hello this is about linear regression i want answer the question using R write the results...

    hello this is about linear regression i want answer the question using R write the results and command of R A marketing researcher studied annual sales of a product that had been introduced 10 years ago. The data are as follows, where X is the year (coded) and Y is sales in thousands 1 VI X;: 2 135 3 162 4 178 5 221 6 232 5 7 283 6 8 306 7 9 374 8 10 395 9 98...

  • 3. Suppose that X has a Poisson distribution with mean μ=15. Use the 'cdf' command MTB...

    3. Suppose that X has a Poisson distribution with mean μ=15. Use the 'cdf' command MTB > cdf; SUBC 〉 poisson 15. Find PX 〈 10)-[3] and P(15 X 20)= [3] 4. Suppose that Y has a hypergeometric distribution with parameters N = 20, M = 6, and n = 4, Use the command MTB > cdf 3; hypergeometric 20 6 4. a. [3] to find P(Y 53) = b. 3) Use the similar command to find P(Y > 2)...

  • In the vector space R, let 8 {(1,3,0), (1, -3, 0), (0, 2, 2)}. (a) (6...

    In the vector space R, let 8 {(1,3,0), (1, -3, 0), (0, 2, 2)}. (a) (6 points) Show that y is a basis of R3. (b) (7 points) Find the matrix [I,where I is the identity transform R3 R3 (c) (7 points) Using the matrix [I, convert the vector (r, y, z) into coordinates with respect to y instead of B. In other words, find ((x, y, z)] {(1,0,0), (0, 1,0), (0,0, 1)} be the standard basis, and let

  • Suppose you have a categorical variable X with nine categories: A, B, C, D, E, F, G, H and I. The frequencies corre...

    Suppose you have a categorical variable X with nine categories: A, B, C, D, E, F, G, H and I. The frequencies corresponding to these categories are 25, 12, 7, 4, 6, 2, 1, 0, and 2 Consider now X is a vector of these frequencies and give R expressions that return the categories and its corresponding frequencies as below: X A B D E F G I 25 12 7 4 2 1 0 Now you wish to remove...

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