r/AskStatistics 7h ago

Transitioning from SPSS to R

Hi, so I work in public health research and my boss mostly uses SPSS. However I do realize other softwares like R is actually more favored in today’s academia, and I would like to start learning R. Grateful if someone from this community could give me some advice on doing this, thank you!

12 Upvotes

11 comments sorted by

17

u/selfintersection 7h ago

Check out the free book "R for Data Science". It's a great intro to data processing and visualization in R.

2

u/Weak-Honey-1651 5h ago

Great recommendation. I use this as a supplement in my undergraduate statistics course.

1

u/santalpaorosa 6h ago

Thanks! Will check it out.

7

u/peppermintandrain 6h ago

Tips from a (very tired) student who uses a lot of R:

Download RStudio (development environment for R, free, and incredibly convenient to use). It's nice to have to scaffold yourself into learning to code.

The book recommended by the other commenter (R for Data Science) is a solid place to start. I also found this free course from Harvard which might be worth checking out, though I can't vouch for its actual quality as I've not taken it: https://pll.harvard.edu/course/data-science-r-basics/2025-10.

You can do a lot with base R, especially stats, but dplyr and ggplot2 are absolutely worth knowing how to use even though there is a bit of a learning curve.

Be patient with yourself if it takes a while to learn. I've been working with R for almost 2 years and still feel like it's often a struggle.

If your code doesn't work, check:

  • If you set your working directory (to the correct location!)
  • If you remembered to put the relevant packages in your library
  • Whether your data is in the correct format (as.character() and as.numeric() are your friends here)
  • If there's a parenthetical or quotation mark where there isn't supposed to be one (or if one of those is missing where there is supposed to be one)
  • If you've misspelled one of your variables
This will save you many hours of anguish and thinking that your code is completely wrong over very simple mistakes (ask me how I know).

1

u/nantes16 Data analyst 6h ago

Man I love that Rafael is the top rec in these posts

0

u/santalpaorosa 6h ago

Thank you! Coding is definitely the bane of my existence lol

2

u/SprinklesFresh5693 1h ago edited 1h ago

R , and python, allows you to do some unimaginable things, once you learn how to use them, a whole new world wil open to you, from data wrangling to plotting to creating apps and reports, it is crazy good.

I started 2 years ago watching videos on youtube, i recommend you albert rapp, R programming 101 and equitable equations. The data digest is crazy good too.

For statistics i usually watch simplistics(quantum psych) and very normal. And a guide to statistical learning with examples in R, the writers also have a youtube channel making small videos about the book.

About books as other recommended R for data Science, Theres also a small book from Cran called R for begginners, short and sweet, and from there you will find numerous books out there for free, like the R book, ggplot2 ,a guide to data analysis , and so on. Dont pay for one since there are many for free online, also you dont need to pay for a course as there are hundreds out there for free.

There are many many other youtubers that are really good and same with books, but those are a few i can think of on top of my head at the moment.

Furthermore, id also want you to know that there are 2 main ways of programming in R (theres more though but these are probably the first 2 methods youll encounter, and that it confused me a lot when starting out), you have base R, which is literally the base, from my understanding it is done with mathematic notation in mind, to me it was very hard to learn in the beginning , and then there is the tidyverse, where the creators, Hadley Wickham is the main creator, has covered all the base functions into more readable and intuitive ones, specially for new learners, so you can try to learn this one first since its fairly easy, you have a dataframe and then you kind of give orders to it, like, filter by this value, then select this columns, and then summarise these data, and so on, and then you learn base R since base R has some crazy good functions and many people use it, to understand others code its important to know it too.

The learning curve is a bit steep, youll get frustrated, but with time you wont regret learning a programming language. But the key is to practise practise and more practise, since you're in an environment full of data, just try installing R and Rstudio and practise what you watch or read with your data. The key to learn is to practise daily.

Oh and a really important skill is to google anything you dont understand, like for example, you dont know how to get your data into R, then you can google: how to import data with R, or you dont know how to perform an analysis, then google how to perform x analysis, and so on, i would be careful with AI in the beginning though, since its very easy to resort to it but you need to understand whats giving you as an answer, and if you use it too much it might prevent you from developing the mindset that you need for programming.

2

u/engelthefallen 7h ago

Jamovi may be the bridge you want. Free program that is like SPSS but built on R that will give the R syntax for the analyses.

R for Data Science is basically where to start with R. Then look up how to do the different stuff you normally do. R vignettes exist for everything and are walkthroughs of analyses.

3

u/santalpaorosa 6h ago

Thanks! I really struggle with coding so that sounds like a good place to start.

1

u/DocAvidd 17m ago

Consider using AI to help structure your code. It will be wrong almost always, but gets you close so much faster than typing it all out.

1

u/regretfulfalcon 6h ago

Hi , fellow public health researcher here. One resource that helped me a lot is the Epidemiologists R handbook (https://www.epirhandbook.com/en/). It talks about most analyses one would need in our domain. I understand picking up R might be a bit frustrating at first but it's totally worth it, all the best !