1/228
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Q: What are the main R data types?
A: Numeric, character, logical, factor.
Q: What function creates a vector in R?
A: c()
Q: How do you access elements in a vector?
A: Use [ ] with position or condition.
Q: What can a list in R store?
A: Mixed data types (numbers, strings, etc.).
Q: How do you access a list element?
A: With $ or [[ ]].
Q: What is a data frame?
A: A table where each column is a variable.
Q: What are relational operators in R?
A: ==, !=, <, >, <=, >=.
Q: What are logical operators in R?
A: &, |, !.
Q: How do you detect missing values?
A: is.na(x)
Q: How do you remove missing values?
A: na.omit(x)
Q: How do you ignore missing values in a calculation?
A: Add na.rm=TRUE, e.g. mean(x, na.rm=TRUE).
Q: Common summary functions?
A: mean(), sd(), summary(), table().
Q: How do you sort or join data frames in R?
A: arrange() for sorting; left_join() or inner_join() for merging.
Q: What does the pipe operator %>% do?
A: Passes results from one step to the next.
Q: Example: what’s the output of
v1 <- c("hello", NA, "NA", "goodbye")
is.na(v1) ?
A: FALSE, TRUE, FALSE, FALSE.
Q: What does ggplot(data, aes(x, y)) + geom_point() do?
A: Makes a scatter plot.
Q: What is geom_bar() used for?
A: Creating bar charts.
Q: What should you always check on a plot?
A: Axes, color scale, and legend meaning.
Q: What is AWS used for?
A: Cloud storage and computing.
Q: What is EC2 used for?
A: Virtual machines (compute power).
Q: What is S3 used for?
A: Storing data.
Q: What’s the goal of machine learning?
A: Use data to predict or explain outcomes.
Q: What is supervised learning?
A: Outcome variable is known (regression/classification).
Q: What is unsupervised learning?
A: No outcome variable (e.g., clustering).
Q: Formula for simple linear regression?
A: Y = β₀ + β₁X + ε.
Q: What does β₀ represent?
A: Intercept.
Q: What does β₁ represent?
A: Slope of X.
Q: What does ε represent?
A: Random error.
Q: What does OLS stand for?
A: Ordinary Least Squares.
Q: OLS estimation formula?
A: β = (X′X)⁻¹ X′Y.