BookmarkSubscribeRSS Feed
ronaldo7
Calcite | Level 5

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;
1 REPLY 1
SAS_Rob
SAS Employee

It would be relatively straightforward to perform a test for the linear trend in the Log(odds) by using a CONTRAST (or ESTIMATE) statement and the approach detailed in this usage note for Proc GLM.  If you were to use PARAM=GLM on the CLASS statement then you should be able to use this methodology to generate the proper coefficients for the CONTRAST statement.
http://support.sas.com/kb/22/912.html

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 330 views
  • 0 likes
  • 2 in conversation