Basics of R Programming: Data Types and Matrices
23 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the primary use of R programming language?

  • Web Development
  • Artificial Intelligence
  • Data Science (correct)
  • Database Management

What is the significance of the matrix() function in R?

  • It creates a list of characters
  • It creates a three-dimensional array
  • It creates a two-dimensional array (correct)
  • It creates a one-dimensional array

How can you access the element in the 2nd row and 3rd column of a matrix P?

  • P[,3]
  • P[2,3] (correct)
  • P[3,2]
  • P[2,]

What is the department of the employee with emp_id 4?

<p>HR (B)</p> Signup and view all the answers

What is the purpose of the byrow argument in the matrix() function?

<p>To arrange elements sequentially by row (D)</p> Signup and view all the answers

What is the type of the start_date column in the employee_data dataframe?

<p>Date (A)</p> Signup and view all the answers

What is the difference between a matrix and an array in R?

<p>A matrix is a two-dimensional array, while an array can be more than two-dimensional (A)</p> Signup and view all the answers

What is the purpose of the Pearson correlation test?

<p>To evaluate the association between two variables (C)</p> Signup and view all the answers

What is the output of the command print(P[2,])?

<p>All elements in the 2nd row (D)</p> Signup and view all the answers

How many rows are in the employee_data dataframe after expansion?

<p>8 (C)</p> Signup and view all the answers

What is the name of the employee with emp_id 3?

<p>Michelle (B)</p> Signup and view all the answers

What is the dimension of the array created in the example?

<p>4x2x3 (D)</p> Signup and view all the answers

What is the output of print(result[3,2,2])?

<p>12 (B)</p> Signup and view all the answers

How are the columns and rows named in the matrix?

<p>Using the column.names and row.names functions (C)</p> Signup and view all the answers

What is the data type of the object 'factor.data'?

<p>Factor (B)</p> Signup and view all the answers

What is the purpose of a factor in R?

<p>To store categorical data (A)</p> Signup and view all the answers

What is the structure of a data frame in R?

<p>A table with variables and observations (B)</p> Signup and view all the answers

What type of relationship does the Pearson correlation coefficient measure?

<p>Linear dependence (B)</p> Signup and view all the answers

What is the assumption of the Spearman rho test?

<p>Variables should be measured on an ordinal or continuous level (C)</p> Signup and view all the answers

What is the purpose of the Shapiro test?

<p>To check for normality of distribution (C)</p> Signup and view all the answers

When would you use Kendall tau test?

<p>When there are tied ranks (A)</p> Signup and view all the answers

What is the graphical method to check for normality of distribution?

<p>Q-Q plot (C)</p> Signup and view all the answers

What is the condition to use Pearson correlation coefficient?

<p>Variables should be measured on an ordinal or continuous level and should be normally distributed (C)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser