Statistics Quiz - Languages R
Free practice quiz: Statistics (Languages R). 53 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
This Languages R practice quiz has 53 multiple-choice questions on Statistics, and 53 of them come with an explanation. Try the 5 sample questions below (tap an option to check yourself), then play the full quiz online. No sign-up needed.
Start quiz: 53 questions, freeSample questions
In R, which function is primarily used for calculating the variance of a dataset?
Show answer
Answer: C. var()
The `var()` function in R is specifically designed to compute the sample variance of a numeric vector. `sd()` calculates the standard deviation, `mean()` calculates the average, and `median()` finds the middle value.
What does the standard deviation measure?
Show answer
Answer: B. The spread or dispersion of data points around the mean
Standard deviation quantifies the amount of variation or dispersion of a set of values. A low standard deviation indicates that the values tend to be close to the mean, while a high standard deviation indicates that the values are spread out over a wider range.
Which statistical measure is sensitive to outliers?
Show answer
Answer: C. Mean
The mean is calculated by summing all values and dividing by the count. Extreme values (outliers) can significantly pull the mean towards them, thus making it sensitive to outliers. The median and IQR are more robust to outliers.
In R, what does `set.seed(n)` primarily do?
Show answer
Answer: B. Ensures reproducibility of random number generation.
Calling `set.seed(n)` before generating random numbers ensures that the sequence of random numbers generated will be the same each time the code is run. This is crucial for reproducible research.
What is the primary goal of descriptive statistics?
Show answer
Answer: C. To summarize and describe the main features of a dataset.
Descriptive statistics involve methods for summarizing and organizing data, such as calculating measures of central tendency (mean, median), dispersion (variance, standard deviation), and creating visualizations like histograms and box plots.
More questions in this quiz
Answers and explanations are in the full quiz.
- What does the R function `summary()` typically return for a numeric vector?
- When performing hypothesis testing in R, which function is commonly used to conduct a t-test?
- In R, what is the primary purpose of the `cor()` function?
- Which R package is widely used for data visualization, including statistical plots?
- What does a p-value less than 0.05 typically indicate in hypothesis testing?
- In R, the `mean()` function calculates:
- Which of the following is a measure of central tendency?
- What type of sampling is represented by selecting every k-th item from a population list?
- In R, how would you create a histogram for a numeric vector named `data_vector`?
- Which statistical test is appropriate for comparing the means of two independent groups?
- In R, the `sd()` function calculates:
- What is a 'confidence interval'?
- Which R function is used to create box plots?
- What is the null hypothesis (H0) in hypothesis testing?
- In R, which of the following is NOT a measure of dispersion?
- What is the purpose of a scatter plot?
- Which R package is often used for data manipulation and transformation, making statistical analysis more efficient?
- What does a chi-squared (χ²) test typically assess?
- In R, what does the argument `na.rm = TRUE` in functions like `mean()` or `sd()` do?
- What is the purpose of the `quantile()` function in R?
- In a two-sample t-test, what does it mean if the alternative hypothesis is `alternative = 'two.sided'`?
- What is the main function for creating regression models in R, like linear regression?
- Which R function would you use to perform analysis of variance (ANOVA)?
- What does the term 'outlier' refer to in statistics?
- In R, what is the typical way to access the p-value from the results of a t-test?
- What is the median of the following dataset: 5, 2, 8, 1, 9, 4, 7?
- Which R command creates a simple random sample of size 10 from a vector `population`?
- What does a correlation coefficient of -1 indicate?
- What is the primary purpose of a control group in an experiment?
- In R, what is the typical output of `range(data_vector)`?
- Which statistical method is used to estimate the relationship between a dependent variable and one or more independent variables?
- In R, the `t.test()` function can be used for:
- What is the interquartile range (IQR)?
- Which type of sampling involves dividing the population into distinct groups and then randomly sampling from each group?
- In R, the `predict()` function is typically used after fitting a model to:
- What does a p-value of 0.65 typically suggest in relation to a significance level of 0.05?
- Which of the following is a measure of association for categorical variables?
- In R, how would you check the class of an object named `my_object`?
- Which R function is used to create a data frame?
- What does a confidence level of 95% for a confidence interval mean?
- In R, what is the purpose of the `cut()` function?
- Which statistical test is used to compare the means of two related samples (e.g., before and after a treatment)?
- What is the coefficient of determination (R-squared) in regression analysis?
- In R, what does the `aggregate()` function do?
- What is a Type I error in hypothesis testing?
- Which R package provides robust tools for statistical modeling and machine learning, including functions for cross-validation and model selection?
- What does a correlation coefficient of 0.0 indicate?
- In R, what is the output of `table(factor_vector)`?