Improve your R skills in entertaining, inspiring and supportive sessions moderated by your own colleagues.
The NSC-R Tidy Tuesday workshop sessions are inspired by the Tidy Tuesday initiative, which is aimed at providing a safe and supportive forum for individuals to practice their data processing and visualization skills in R while working with real-world data.
In this workshop (May 9, 2023, 13:00-14:00), Wim Bernasco tried to model song popularity using a dataset of tracks on Spotify.
Even if you have no interest in popular music at all, you may find the materials presented in the workshop instructive for getting ideas on how to do regression analysis in R.
The workshop did not delve into statistics, but rather show how to get linear regression and logistic regression models running in R and generate useful and reproducible output. The focus was be on ordinary least squares and (quite briefly) logistic regression, but the techniques can easily be generalized to other regression models.
Wim Bernasco is a senior researcher at NSCR and a member of the NSC-R Workshops team. His research focuses on the geography of crime.
Materials for this workshop have been posted here on GitHub. The Quarto document regression_spotify.qmd
contains the annotated R script. You can use the short script get_started.R
to read the data and conduct your own analysis.
Some substabtive documentation on the data is available here
To download files from GitHub you can:
Clone
the repository to create a local copy in your computer. To clone a repository, follow the instructions here.
Alternatively, you can:
ZIP
. To do this, go to the repository and click on the green code
button, then select download ZIP
. Unzip the downloaded file into a folder on your local computer.raw
button. Then right click on the new page and select save as
. Don’t forget to put the proper extension in the save name, like .R
or .Rmd
.
For attribution, please cite this work as
Bernasco (2023, May 9). NSC-R Workshops: NSC-R Tidy Tuesday. Retrieved from https://nscrweb.netlify.app/posts/2023-05-09-nsc-r-tidy-tuesday/
BibTeX citation
@misc{bernasco2023nsc-r, author = {Bernasco, Wim}, title = {NSC-R Workshops: NSC-R Tidy Tuesday}, url = {https://nscrweb.netlify.app/posts/2023-05-09-nsc-r-tidy-tuesday/}, year = {2023} }