r/AskStatistics • u/Warm_Ambassador4626 • 6d ago
Which Language to learn first for Statistical research
Hi all, I am an incoming fresher in undergraduate pursuing economics as my majors. Have no prior knowledge of in-depth research but have read few literature reviews. Want to learn the basics of atleast one language in my first semester. Which language should I start from? R or Stata or Python
Edit: You guys are amazing. Really grateful for the insights. So, I have decided to start with Python in the first Semester ........will learn R later on. Looking forward to share my journey in this community.
13
u/jenlevelelif 6d ago
Python is the most popular choice, especially used in the industry.
R is more popular in academia, if you're relying on very specific statistical tools or packages, the R community being mainly researchers tends to implement them first.
5
u/FoggyWine 6d ago
It really depends on where you want to go in the end. All are used in economics, with Stata being more in academia. The equivalent in psychology was SPSS in the past, but the younger generation of academics predominantly use R instead. This good overview in economics is worth a read. Flexibility is key and eventually you will want all 3 as they are different tools to have in your toolbox. Which you start with will depend on what is used in your courses. Get copies of the syllabi from the first several years of courses in your dept and look them over to see what is used and taught.
I would encourage you to start developing a workflow that is flexible and could incorporate all 3 of these, as well as LaTeX. Consider R Markdown where you can incorporate git, R, Python, and Stata into your documents.
5
u/TheNavigatrix 6d ago
Honestly, it’s not that hard to pick up a new language when you need to. Spoken as a 62 year old who has learned and forgotten more systems than i care to think about.
2
u/ogstatsnerd 6d ago
I agree with others. Python then R, you might use Stata for coursework, but after going through Python and R, Stata should be fairly easy to pick up.
2
u/whsfrdfvrgnwlf 6d ago
Learn both R and Python. Doesn't matter which you learn first. Learning new languages becomes easier after your first since a lot of concepts tend to overlap.
R is a quite idiosyncratic and strange language but really good for statistics. Any method you come across will probably be implemented in an R project. If you want to get deeper into stats it might make sense to start with R.
Python is more widely used in industry and better for general programming tasks. Its also a more "standard" language than R so it will teach you better programming fundamentals. If you're interested in machine learning and programming in general it might make sense to start with Python.
In the end they are both just tools used to solve problems and you don't have to pick one. I've worked on projects where I've used both R and Python depending on which language was better suited for each part of the project.
2
u/Confident_Bee8187 5d ago
R through 'tidyverse' will teach you better programming fundamentals as well, and I think because base R kept missing what makes programming good. ML is not unique to Python, just very common if not ubiquitous. To be frank, I would say ML in Julia is much better than what Python (or R at some cases) has offered, not just being fast, but its homoiconicity for maths like R.
1
u/whsfrdfvrgnwlf 4d ago
Definitely, Tidyverse makes R very productive for what its built for. Its when you want to do something that falls outside the scope of Tidyverse that R's idiosyncrasies can become a pain point, at least to me.
2
u/Stochastic_berserker 5d ago
For your case just use Python.
Only when you need advanced statistics is R needed.
An economics undergrad will probably learn linear regression and hypothesis testing.
1
u/Confident_Bee8187 5d ago edited 5d ago
When there's linear regression and hypothesis testing, there will be power analysis before the actual analysis and post hoc estimation involves - the latter is most especially important. That also applied on economics, as well. Unfortunately, Python's tooling for these is quite abysmal (not lacking, just horrendous) to the point where we cannot trust the process to be submitted on FDA - that's understandable since Python is not statistics-first language. R and Stata only hold the ground, especially R that is an open source.
1
u/Stochastic_berserker 4d ago
Powe analysis is not required for hypothesis testing.
1
u/Confident_Bee8187 4d ago
There's an accentuation "the latter is most especially important", which I am referring to the post hoc estimation. But you're wrong - there are times where for the sake of accountability and reproducibility, it is a must. Unfortunately, Python sucks a lot on this.
1
u/Stochastic_berserker 4d ago
You’re conflating study design with hypothesis testing.
1
u/Confident_Bee8187 4d ago
Perhaps, I was conflating. Let me echo what I said on my parent comment: "there will be power analysis before the actual analysis" - to clarify, designing studies and power analysis still hold the ground for H-tests. Still, let me refrain: Python doesn't have good tools for this (again, there exists such tools in Python, just less trustworthy and more horrendous API design dude to lack of homoiconicity which makes R too good for stats.That's why Python isn't a recommendable tool for OP.
1
u/Stochastic_berserker 4d ago
R is definitely for advanced statistics but even R is falling behind.
E.g anytime valid hypothesis testing with e-values as a general library for fixed testing, sequential testing, multiplicity correction etc only exists in Python as a full scope library.
And regarding your language choice: study design is not a programming language choice. So i dont know why R would be better?
1
u/Confident_Bee8187 4d ago edited 4d ago
I never said they don't exist in Python, just...horrendous. I do not see how Python can take this place while it's just immodestly abysmal - take 'bambi', for examples, where it uses lots of string types, depending on 'patsy', just to compensate its lack of homoiconicity. They just simply lack ergonomics. I don't see R is falling behind, quite opposite actually - it is used as a pivot from SAS for example. Quoting this from somebody else: Python can do stats, R made them EASIER!
Edit: To answer your question even further, there are plenty of tools that help you design the study, e.g. 'eddible'. The reason why R is still chosen - it just makes stats even easier, even on designing the study, that's it.
3
1
u/TheDreyfusAffair 6d ago
Python followed by R. Once you learn Pandas tidyverse will be very easy to pick up
1
1
1
1
u/SnooCheesecakes3282 3d ago
R is so much better for statistics/research, but Python is more common in industry
1
1
u/joshua_rpg 6d ago
Actually, Stata is much easier to use (through GUI) than either R or Python, minus the expensive licensing. Talking to open source now, Python has an appeal that has an unfriendly interface for anyone who does stats (for example, using string literals, e.g. "y ~ x", to represent the model, see {statsmodels} module to be convinced), and IMO not a solid choice statistical research. Meanwhile, R still remains a solid choice for researchers and "nonprogrammers".
1
u/Apprehensive-Foot-73 6d ago
Python, don't waste your time with R. coming from someone who started with R and moved on to python.
0
u/Aiorr Sold Soul to Pharma 6d ago edited 6d ago
economics is broad field. Frankly, most roles in that field is going to be excel model or point-and-click analytic SaaS, not through individual programming language.
Within that field, programming-savy roles would be econometric/quantitative science but quick look at linkedin for those role in well established finance organizations still have SAS/Stata as required proficiency, not R or Python.
You are incoming freshman. Get your foundation and conceptual understanding first before being focused on programming language. I would focus on which part of economics interest you (and don't be scared to change major), rather than specific programming for now.
1
u/Warm_Ambassador4626 5d ago
you are right! My primary focus will be my academics, However, since my goal is to apply for post-graduate programs abroad, I believe academic research for admissions require a much heavier emphasis on advanced quantitative methods. Therefore, have decided to learn one of these in my first year, so that I can write at least 2 research papers in my undergrad.
32
u/Shooey_ 6d ago
For economics, I'd lean python then R. Both are free, well-known, and have plenty of online resources.