Hello, I am using YRBS data -- a student survey taken in each US state every other year. Each entry of my dataset contains the responses of each individual student, along with the state and year. I want to create a time trend for a dummy variable--that is: how many students (more specifically, what percentage of them) in state A, B, C, etc. responded Yes to the question in each of the years X Y C.
I can find this easily by creating a for loop for each state and then tabulating year and the question (I should add that I weight the tabulations). However, this is not useful for my end goal, which is to handle a time trend.
How can I collapse this variable (a dummy variable with weights for each individual), to get the pct of students each year, for each state, that replied "yes"?
I have tried collapse, tabout, table, tabstat, tab2xl, etc. -- and can't quite get what I want.
Thank you!
Related Posts with Weighted Tabulation by Multiple Groups -- Export to XLS or DTA
Insufficient observations for bootstrap standard errors in fixed effects quantile regressionHello, I am new to Stata so any advice on this would really help! I am trying to bootstrap clusterin…
Frequency spillover and connectedness?I have been asked to investigate spillover frequencies and connectedness for a dataset using Stata, …
Rolling regression with pooled time series data; plotting 10 year windows with 95% CIHi everyone, I basically want to replicate figure four in Pontusson and Kwon (2010) with different …
dummy variable conditional not working for all panel IDsDear Stata users, I have a panel data set consisting of municipalities in my country from 2000-2020…
Approximating trend in time-seriesHello! I am trying to come up with a metric to capture the temporal pattern of the average of numer…
Subscribe to:
Post Comments (Atom)
0 Response to Weighted Tabulation by Multiple Groups -- Export to XLS or DTA
Post a Comment