Taking the topics of a quantitative methodology course and illustrating them through Monte Carlo simulation, this book examines abstract principles, such as bias, efficiency, and measures of uncertainty in an intuitive, visual way. Instead of thinking in the abstract about what would happen to a particular estimator “in repeated samples,” the book uses simulation to actually create those repeated samples and summarize the results. The book includes basic examples appropriate for readers learning the material for the first time, as well as more advanced examples that a researcher might use to evaluate an estimator he or she was using in an actual research project. The book also covers a wide range of topics related to Monte Carlo simulation, such as resampling methods, simulations of substantive theory, simulation of quantities of interest (QI) from model results, and cross-validation. Complete R code from all examples is provided so readers can replicate every analysis presented using R.
Chapter 3: Introduction to R
Introduction to R
In this chapter, we provide a brief review of the statistical environment R, which we use in all of the examples throughout the book. R holds several advantages both for general use and for the specific purpose of conducting simulations. Among these advantages include the fact that it is ...