This is a really stupid question, but I've been searching for help to no avail.
I'm pretty new to Stata, I've used it in school to run regressions with pre-cleaned data but that's about it.
I'm trying to get some summary stats and I'm at my wit's end. I have number of car crashes per state by year and I want to calculate a total number of crashes per year in each state.
In Excel the formula would be something like =sumifs(state column, specific state, year column, specific year, number of crashes). Hopefully that makes sense, I'm new to asking for help with data stuff. I could use something like that to make a table with the information I want.
I have no clue how to do it in Stata. Sum gives me median, min-max, st. dev, etc, but not a column total. The closest I've been able to get is sorting by year and doing:
by year: tab number_crashes if state == x
but that just gives me a table of frequencies. It seems like there should be option or something to get a column total of the values instead of frequencies.
I'm pretty new to Stata, I've used it in school to run regressions with pre-cleaned data but that's about it.
I'm trying to get some summary stats and I'm at my wit's end. I have number of car crashes per state by year and I want to calculate a total number of crashes per year in each state.
In Excel the formula would be something like =sumifs(state column, specific state, year column, specific year, number of crashes). Hopefully that makes sense, I'm new to asking for help with data stuff. I could use something like that to make a table with the information I want.
I have no clue how to do it in Stata. Sum gives me median, min-max, st. dev, etc, but not a column total. The closest I've been able to get is sorting by year and doing:
by year: tab number_crashes if state == x
but that just gives me a table of frequencies. It seems like there should be option or something to get a column total of the values instead of frequencies.

If so, when I began using Stata in a serious way, I started by reading my way through the Getting Started with Stata manual relevant to my setup. Chapter 18 then gives suggested further reading, much of which is in the Stata User's Guide, and I worked my way through much of that reading as well. All of these manuals are included as PDFs in the Stata installation (since version 11) and are accessible from within Stata - for example, through Stata's Help menu. The objective in doing this was not so much to master Stata as to be sure I'd become familiar with a wide variety of important basic techniques (like the
Comment