Greetings,

I'm running Stata 15.1 on OSX. My ultimate goal is to examine whether changes in a specific independent variable predict changes in state-level attitudes across time. My dataset consists of pooled individual-level cross-sectional survey data that was collected in 2008, 2010, 2011, 2012, 2014, 2015, 2016, and 2018. After pooling all of the data, I proceeded to estimate the state-level means per year for my variable of interest. My concern is that certain states (e.g. Wyoming) in certain years have very few observations (because the survey samples themselves vary in size. For instance, there were 7,636 respondents in the 2016 survey and 41,419 in the 2014 survey). This means that the estimates for some states in certain years will be highly unreliable. I'm thus wondering how to handle such a predicament. I'm thinking I need to calculate how many observations per state/year will be sufficient for achieving estimates with, say, a 5-10 percentage point margin of error. I wasn't sure if there was a built-in or add-on tool that performs such tasks, so I wanted to ask. Thanks in advance for your help/suggestions!

-Zach