R Programming Language Certification Research & Evidence-Based Practice 4 — Questions and Answers
Question 1: In R, which package is specifically designed for conducting meta-analyses, providing functions like `rma()`?
- survival
- metafor (Correct answer)
- lme4
- lavaan
Correct answer: metafor
The metafor package provides comprehensive meta-analysis tools including the rma() function for random/fixed-effects models.
Question 2: A researcher uses `sample(x, size = n, replace = FALSE)` in R. What is this technique called when used to create bootstrap confidence intervals?
- Jackknife resampling
- Bootstrap resampling (Correct answer)
- Permutation testing
- Cross-validation
Correct answer: Bootstrap resampling
Bootstrap resampling draws repeated samples with replacement (replace = TRUE) to estimate sampling distributions.
Question 3: Which R function from the `pwr` package calculates the sample size needed to achieve a target statistical power?
- power.t.test() from base R
- pwr.t.test() from pwr package (Correct answer)
- sample.size() from base R
- n.calc() from stats package
Correct answer: pwr.t.test() from pwr package
pwr.t.test() from the pwr package computes power or required n for t-tests given effect size, alpha, and power.
Question 4: In R, what does `summary(lm_model)$r.squared` return?
- The adjusted R-squared penalized for number of predictors
- The proportion of variance in the outcome explained by the model (Correct answer)
- The root mean squared error of predictions
- The F-statistic of the overall model
Correct answer: The proportion of variance in the outcome explained by the model
R-squared represents the proportion of total variance in the dependent variable explained by the linear model.
Question 5: A researcher applies `Bonferroni` correction in R using `p.adjust(p_values, method = 'bonferroni')`. What problem does this address?
- Low statistical power from small samples
- Inflated Type I error from multiple comparisons (Correct answer)
- Non-normality of residuals in regression
- Heteroscedasticity across groups
Correct answer: Inflated Type I error from multiple comparisons
Bonferroni correction controls the family-wise error rate when conducting multiple hypothesis tests simultaneously.
Question 6: Which R function tests the homogeneity of variances assumption before conducting ANOVA?
- bartlett.test()
- shapiro.test()
- var.test() for two groups only
- Both A and C (Correct answer)
Correct answer: Both A and C
bartlett.test() tests equality of variances across multiple groups; var.test() is limited to two groups.
Question 7: In R, `TukeyHSD(aov_model)` is used after a significant ANOVA to:
- Re-run the ANOVA with more power
- Identify which specific group pairs differ significantly (Correct answer)
- Calculate effect sizes for all group comparisons
- Test the normality assumption of residuals
Correct answer: Identify which specific group pairs differ significantly
Tukey's HSD (Honest Significant Difference) performs all pairwise comparisons while controlling the family-wise error rate.
In R, which package is specifically designed for conducting meta-analyses, providing functions like `rma()`?