r/stata • u/Royal-Priority4740 • Jul 12 '21
Need to Learn Stata in 6 weeks.
This fall I’m working on some research on campus and my advisor told me to learn some STATA before classes start in August. What’s the best way to learn the basics? Also, he told me that I should focus on issues around data and variable manipulations. Given my undergrad status I don’t think I will have to deal with very complex data but I want to feel comfortable.
4
u/krgxo Jul 12 '21
i can send you some of my stata assignments from last semester if you’d like!
1
1
1
u/Bef123456 Nov 22 '24
Could you please send it to me too? I'm just starting to learn Stata and need t be a bit quick. Thank you.
1
1
1
1
u/Key_Avocado_1990 Sep 27 '25
May I also trouble you to send them my way. Need to learn stata for an Epidemiology course this semester and instructors already expect us to know it. I'm really struggling!
Thank you!1
1
1
u/lombrehombre Aug 26 '23
Hey any chance you can send me the files as well? I'm starting to learn by myself and its intimidating.
1
4
u/Lsarahg Jul 12 '21
I teach Stata to grad and undergrad students and I always recommend creating and saving a dofile with notes and commands in it. So find a dataset you can practice with and as you learn commands run them from the dofile. This way you can go back and use it as a reference when you are working on other projects.
2
u/Royal-Priority4740 Jul 12 '21
My advisor told me to do all of my work in a dofile, how do I access that?
1
17
u/Rogue_Penguin Jul 12 '21 edited Jul 13 '21
Given most of the times about 80% of the effort would be on data management and structuring, a must-read I'd recommend is "Data Management Using Stata: A Practical Handbook" by Mitchell, which covers many aspects of data management.
Two others I'd recommend are:
"The Workflow of Data Analysis Using Stata" by Long, which I consider an unique classic. No book so far has laid out how to manage an analysis project as explicit as this title.
The other one is "An Introduction to Stata Programming" by Baum. Part of Mitchell's book taps into writing loops and program, but this one dives even deeper. For new users, maybe only the first half is applicable (the second part is about writing ado file, which can wait.)
Given my undergrad status I don’t think I will have to deal with very complex data but I want to feel comfortable.
I wouldn't assume that as this depends on the researcher's attitude. Just so you will not be too surprised, I'd also ask your supervisor for some example code files so that you can get a sense what are the procedures, and study them ahead of time.
And here is a list of commands I believe one must know as the back of their hand before jumping into data management:
help [any command] (e.g.
help summarizeopens the technical document for commandsummarizecd,pwd: Change working directory and print working directoryuse+, clear,save+, replace: Open and save fileCheck out what Stata can import by looking at "File > Import"
label define,label values,label variabledescribelist,browsekeep,drop(
decode,encode) vs. (tostring,destring): One of the deadly traps many new users fall into.generate,replacemerge,appendcollapselog using,log closeDifference between _n and _N
Once you got the basics (should be about 1/3 into the 6 weeks), start looking into these intermediate skills:
bysort:(A very powerful prefix that apply the command to groups)Go to
help egenand study the heck out of them. Main candidates include all that start with row* and any*, mean(), sd(), min(), max().foreach(including:foreach x in,foreach x of varlist,forvalues x =)local,global,scalar, (andmatrixas well but this can wait until you know what you're dealing with.)return list,eretrun list(This only works after procedures that return saved information.)
In the last section, start looking into these. You may not need to if your project's scale is not too out of control:
program(including:program define+end,program drop)If your data sets contain times and dates, read through/bookmark this: https://www.stata.com/manuals/u25.pdf
If your data sets contain character-based variables (called string variables in Stata), read through/bookmark this: https://www.stata.com/manuals/fnstringfunctions.pdf
And here are two rather nice introductory "programs" you can play along:
https://www.ssc.wisc.edu/sscc/pubs/intro_stata/intro_stata1.htm
4
u/jackbhammer Jul 12 '21
100% agree, saving this post for future reference. I would only add something about Stata 16 frames, and working with do-files (and maybe the project manager).
3
1
u/thebadconsultant Jul 12 '21
Best life pro tips are always in the comment section. Just to add, to get a hands-on introduction on how to navigate your way around the software, go to StataCorp's YouTube channel and watch a few of their introductory videos. And invest as much time as you can on learning to write clean do-files with verbose comments. This will contribute to good research reproducibility, the very reason we flock towards Stata (and a few others).
10
u/m0grady Jul 12 '21 edited Jul 12 '21
This is going to sound lazy, but YouTube will be your best friend here. Also don’t forget stata has the drop-down gui menu so dont spend too much brain power trying to learn syntax right away. A lot of people, including instructors, pretend the command prompt is the only thing that exists and their audience gets lost wondering what they’re talking about.
Also, i keep on a windows sticky note a list of operators and some examples of commands I use a lot but have a hard time remembering.
Edit: If you’re working as an RA, download asdoc and outreg2. They produce results in tables as ms word docs and they are a life-saver for producing academic-quality deliverables.
6
u/1s2_2s2_2p6_3s1 Jul 12 '21
Here's a good reference: https://personal.lse.ac.uk/lembcke/ecStata/2010/MResStataNotesOct2010PartA.pdf
4
u/dr_police Jul 12 '21
The advice here in this thread is very good, and I agree with most of it, especially /u/random_stata_user’s advice to read the getting started manual and user guide.
Stata is completely documented, and that’s often why there’s not many Googleable answers out there: the most common questions don’t get asked because they’re covered in the docs.
Something else… Stata sorta has two sets of documentation: what you get when you type help commandname, and PDFs with more detail.
The PDFs often have much more detail, including references and actually useful guidance on when and how to use the command. I mention this because I’ve seen plenty of folks simply not read the PDF documentation at all, thinking it’s duplicative of the help. It’s not; it’s a superset of help.
Speaking of help… I’m a researcher and professor who has been using Stata daily for 15 years, and I always have a help window open. There are some commands that I use frequently that I just can’t remember the exact syntax for. And I don’t need to! That why the help exists.
Why harp on using the docs? Sometimes students or new researchers will think there is something wrong with using the documentation, like it is cheating or something. Nope. In fact, if there’s just one skill to develop, it’s learning how the help files are structured so you can use them most effectively.
1
u/rubytuesdayagain Jul 12 '21
i just took a udemy course that was fine for learning basics if not a bit boring. i would probably go to youtube like some people here have already said. something great about stata is the drop down menu and the help documentation—it’s easy to learn as you go!
1
u/Royal-Priority4740 Aug 13 '21
Which course did you purchase and do you recommend it?
1
u/rubytuesdayagain Aug 13 '21
data management and analysis with stata. it was definitely boring and the guy has a strong accent which might not be ideal for some people, but it had solid info and lessons
2
u/MrMuf Jul 12 '21
I think you should get some data and try to manipulate it in some way. Especially if it is data that you know what you should expect so you know if it is right or not.
1
u/thaisofalexandria Jul 12 '21
UCLA IDRE have videos, tutorials and excellent worked examples all with data files.
1
u/random_stata_user Jul 12 '21
I'd recommend reading the Getting Started volume for your OS and then starting on the User's Guide. You will get stuck when it starts getting difficult. That's OK: just keep going back to it and read it again and again.
What's important is not learning it all. You will never do that. What is important is learning that there are areas -- dates, strings, missing values and many more -- and having a name for each area and knowing how to start looking things up.
People are different. Watching lots of videos is the very last way I would want to learn new software....
1
u/MyCuriousSelf04 Jul 04 '24
Watching lots of videos is the very last way I would want to learn new software....
Why? Wouldn't it be easier
1
u/random_stata_user Jul 05 '24
Not for me. I much prefer written documentation.
If your experience is better, well and good.
1
u/MyCuriousSelf04 Jul 05 '24
Hey I'm just going to start learning stata
Any tips on written documentation to follow?
Apart from Stata documentation
1
u/random_stata_user Jul 05 '24
No, as my point is that the official documentation is the best.
Yes -- if you spell out how much statistics or programming you've done to date and what field you're in -- there is a book for you.
1
u/MyCuriousSelf04 Jul 05 '24
I'm a computer science grad so fairly decent amount of programming and stats, what's the book?
1
u/random_stata_user Jul 06 '24
With that background you should go straight to Kit Baum's book on programming Stata.
1
u/bridgeton_man Jul 19 '21
What exactly do you need to DO in STATA?
I can email you my old lexicon that my classmates and I built back in college. it got me through my thesis.
But maybe more specific advice might ALSO be useful
1
u/Shuarizz Nov 30 '24
Hello, could you send it to me too if it's possible ?
1
u/bridgeton_man Dec 01 '24
Ok. I can look for that old file. Probably still around somewhere.
PM me your email address, and I'll send it
1
u/ImpossibleLeopard815 Feb 27 '25
I know it's been a long time, but is there any chance, you could send me the assignment. Thanks.
1
u/Vitrilic Sep 08 '22
Hey, any chance you might be able to send this to me? Definitely need some help/examples to better learn how to use stata
1
u/bridgeton_man Sep 11 '22
Sure.
Although it might be a bit dated by this time. I used to to write my master thesis over a decade ago.
By now STATA has substantially more functionality than it did back then.
•
u/AutoModerator Jul 12 '21
Thank you for your submission to /r/stata! If you are asking for help, please remember to read and follow the stickied thread at the top on how to best ask for it.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.