Question

The following is a line of R commands and the corresponding output for an object named...

The following is a line of R commands and the corresponding output for an object named “x” in an R Workspace: > class(x); dim(x); colMeans(x); length(x); mean(x); [1] ”data.frame” [1] 15 2 height weight 65.0000 136.7333 [1] 2 [1] NA Warning message: 1 In mean.default(x) : argument is not numeric or logical: returning NA ———— Using the above information, answer the following questions:

(a) How many variables are there in the object x? What are they?

(b) How many observations are there in the object x?

(c) What is the mean of x[,3]?

(d) Compute the sum of each column of x.

Homework Answers

Answer #1

(a) How many variables are there in the object x? What are they?
ans: there are 2 variables in x, which are height, weight
(b) How many observations are there in the object x?
ans:there are 15 observations in x
(c) What is the mean of x[,3]?
ans: There are only 2 columns in x, so mean of 3rd column can not be calculated
(d) Compute the sum of each column of x.
ans: we know the average of each column, we also know that there are 15 rows. using this we can calculate the sum
1st column=> sum/15=65.0000=> sum = 15*65=975
2nd column=> sum/15=136.7333=> sum=15*136.7333=2050.9995

Know the answer?
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
Similar Questions
Use R to do each of the following. Use R code instructions that are as general...
Use R to do each of the following. Use R code instructions that are as general as possible, and also as efficient as possible. Use the Quick-R website for help on finding commands. 1. Enter the following values into a data vector named Dat: 45.4 44.2 36.8 35.1 39.0 60.0 47.4 41.1 45.8 35.6 2. Calculate the difference between the 2nd and 7th entries of this vector using only reference indices. 3. Calculate the median of Dat. 4. Sort the...
Wenton Powersports produces dune buggies. They have three assembly lines, “Razor,” “Blazer,” and “Tracer,” named after...
Wenton Powersports produces dune buggies. They have three assembly lines, “Razor,” “Blazer,” and “Tracer,” named after the particular dune buggy models produced on those lines. Each assembly line was originally designed using the same target production rate. However, over the years, various changes have been made to the lines. Accordingly, management wishes to determine whether the assembly lines are still operating at the same average hourly production rate. Razor Blazer Tracer 11 10 9 10 8 9 8 9 10...
QUESTION 1 [13 MARKS] Write down only the letter corresponding to your choice next to the...
QUESTION 1 [13 MARKS] Write down only the letter corresponding to your choice next to the question number. 1.1. A random variable that can assume only a finite number of values is referred to as a a) Infinite sequence b) Finite sequence c) Discrete random variable d) Discrete probability function e) All of the above 1.2 Which one of the following statements is incorrect? a) A data set provides information about people, objects or other entities. b) If the possible...
*Answer all questions using R-Script* Question 1 Using the built in CO2 data frame, which contains...
*Answer all questions using R-Script* Question 1 Using the built in CO2 data frame, which contains data from an experiment on the cold tolerance of Echinochloa crus-galli; find the following. a) Assign the uptake column in the dataframe to an object called "x" b) Calculate the range of x c) Calculate the 28th percentile of x d) Calculate the sample median of x e) Calculate the sample mean of x and assign it to an object called "xbar" f) Calculate...
Which one of the following statements about GLMs and GAMs is FALSE? a.An iterative algorithm is...
Which one of the following statements about GLMs and GAMs is FALSE? a.An iterative algorithm is used to fit both GLMs and GAMs. That is, it requires repeated computations that converge to the fitted model b.If a data frame is fed into glm() using the data argument then if there are missing values in any variable in the formula then, by default, that row is deleted c.The glm() function and gam() function(s) models the mean response d.For GAMs the coefficients...
Which one of the following statements about GLMs and GAMs is FALSE? a.An iterative algorithm is...
Which one of the following statements about GLMs and GAMs is FALSE? a.An iterative algorithm is used to fit both GLMs and GAMs. That is, it requires repeated computations that converge to the fitted model b.If a data frame is fed into glm() using the data argument then if there are missing values in any variable in the formula then, by default, that row is deleted c.The glm() function and gam() function(s) models the mean response d.For GAMs the coefficients...
Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5,...
Data For Tasks 1-8, consider the following data: 7.2, 1.2, 1.8, 2.8, 18, -1.9, -0.1, -1.5, 13.0, 3.2, -1.1, 7.0, 0.5, 3.9, 2.1, 4.1, 6.5 In Tasks 1-8 you are asked to conduct some computations regarding this data. The computation should be carried out manually. All the steps that go into the computation should be presented and explained. (You may use R in order to verify your computation, but not as a substitute for conducting the manual computations.) A Random...
1) Consider the following Java program, which one of the following best describes "setFlavor"? public class...
1) Consider the following Java program, which one of the following best describes "setFlavor"? public class Food {     static int count;     private String flavor = "sweet";     Food() { count++; }     void setFlavor(String s) { flavor = s; }     String getFlavor() { return flavor; }     static public void main(String[] args) {         Food pepper = new Food();         System.out.println(pepper.getFlavor());     } } a. a class variable b. a constructor c. a local object variable d....
1) Consider the following Java program. Which statement updates the appearance of a button? import java.awt.event.*;...
1) Consider the following Java program. Which statement updates the appearance of a button? import java.awt.event.*; import javax.swing.*; public class Clicker extends JFrame implements ActionListener {     int count;     JButton button;     Clicker() {         super("Click Me");         button = new JButton(String.valueOf(count));         add(button);         button.addActionListener(this);         setSize(200,100);         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         setVisible(true);     }     public void actionPerformed(ActionEvent e) {         count++;         button.setText(String.valueOf(count));     }     public static void main(String[] args) { new Clicker(); } } a. add(button);...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT