I am analyzing a complex survey (YRBS). The response variable is a binary outcome (either 0 or 1; no or yes). My independent variable in this case is the survey year (time). I am interested in examining trends in the prevalence of 3 outcomes over time. I looked through this forum and saw that I should use PROC SURVEYLOGISTIC given that this is complex survey data and a binary outcome. I saw a recommendation to use a LSMESTIMATE statement to obtain linear time series trends. However, I am not sure which coefficients to use in the LSMESTIMATE statement. I am studying 3 different outcomes. For variable Survey_Year (possibilities are 2007, 2009, 2011, 2013, 2015, 2017, 2019, and 2021), each outcome was asked in different surveys. For OUTCOME1, the survey years that it was included in were 2007, 2009, 2011, 2013, and 2019. For OUTCOME2, it was included in survey years 2009, 2011, 2013, 2015, 2017, and 2019. Lastly, OUTCOME3 was included in survey years 2015, 2017, and 2021. Below please find my code and please advise on how to change the coefficients for the LSMESTIMATE statement to reflect the survey years for each outcome (OUTCOME1, OUTCOME2, and OUTCOME3). Thanks so much! 🙂 PROC SURVEYLOGISTIC data=work.yrbs07_21;
domain Inclusion;
strata stratum;
cluster psu;
weight weight;
class Survey_Year(ref='2007') / param=glm;
model OUTCOME1(event='1') = Survey_Year / vadjust=none;
lsmeans Survey_Year / diff;
lsmestimate Survey_Year 'Linear time' 0 1 2 3 4;
RUN;
... View more