Statistics with R
Chapter 1 Some Introduction
1.1 About this book
1.1.1 What is this book and why
Learning a statistical software can be a daunting experience for everyone. However, as the importance of data analysis is increasing, we think more talent in this sector will only benefit everyone.
This book is created using the Bookdown (Xie 2020) package and is written in Rmarkdown (Allaire et al. 2020) language. All content in this book is free to be used and distributed by anyone for learning purpose. Please credit us if you find this book to be useful.
This book handles a mainstream curriculum of undergrad statistics, therefore it is best to use this book while also doing an undergrad statistics course. We use social sciences data set to illustrate some commands in R, but it can be easily changed to data set relevant to yourself.
This book is intended to anyone who are interested in learning statistics using R language. It is assumed that people has zero experience with using any programing language at all. Experience with spreadsheet program such as Microsoft Excel or Google Sheet is certainly helpful but not needed.
This book will not cover a lot of the theoretical part of statistics. Readers are assumed to understand that already. A little bit of intro will be given but that is pretty much it. Readers are expected to understand already the theory behind these techniques, or are expected to learn it from elsewhere.
1.1.3 Learning outcome
Information in this book would help you to:
- install and update R and Rstudio with ease
- input, edit, and manage dataset
- visualise dataset as needed
- conducting hypothesis testing
- running a regression
- write a report using the results from above
1.2 About R
1.2.1 What is R
R is an open source statistical package useful for doing some statistical stuff, while RStudio is a software which improve greatly our user interface when using R compared to using R GUI. RStudio also can be used to do other stuff but let’s discuss that for later.
R can be used to manipulate a huge amount of data, as well as running a handful of statistical analysis such as regression which is essentially just a matrix algebra in the background. Use of command instead of point-and-click is great because it means it can be replicable with just a script (and a bit of other stuff). Great for collaboration and peer-reviewing.
1.2.2 Good reasons to start with R
Here’s a more comprehensive reasons on why you should learn R from University of Chicago.
1.2.3 Computer requirements
R and RStudio is really light you can install them in your microwave. R and RStudio supports Windows, Mac and Linux. Also, good internet connection never hurts.
1.2.4 Installing R and RStudio
You can easily google to get your R and RStudio installer. But we will give you links anyway. Get your R installation here if you are windows user, here for Mac users, and here for ubuntu users. Get your RStudio from this links.
We are using recommended setting when we install R to our machine, and we suggest you do too.
Allaire, JJ, Yihui Xie, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, Hadley Wickham, Joe Cheng, Winston Chang, and Richard Iannone. 2020. Rmarkdown: Dynamic Documents for R. https://CRAN.R-project.org/package=rmarkdown.
Xie, Yihui. 2020. Bookdown: Authoring Books and Technical Documents with R Markdown. https://CRAN.R-project.org/package=bookdown.