BookmarkSubscribeRSS Feed
dinyuen
Calcite | Level 5

Hi everyone, I have looked through the forums and cannot seem to find an answer to my question.

 

I have complex, weighted data (roughly 4000 observations) over the course of 3 waves in multiple age bands: 15-18, 19-21, 22-25. I want to show the annual percentage change between each wave of the categorical variable "heavy drinker" (binary yes/no). I would then like to test if the annual percent change is significant between the age groups as well as across multiple waves within each age group (wave 1 to 2, 2 to 3, 1 to 5).

 

How would I create the annual percentage change?

 

What would be the appropriate statistical test for something like this?

 

 

example data:

idwaveage groupheavy drinker
1115-18yes
1215-18no
1319-21no
2122-25no
2222-25yes
2322-25yes
3115-18no
3219-21yes
3319-21no

 

 

4 REPLIES 4
dinyuen
Calcite | Level 5

Thank you for the response. Is there an option to incorporate the weight aspect like in proc surveyfreq to create these?

PaigeMiller
Diamond | Level 26

Please explain further. How can we calculate annual change if there is no variable in your data set that indicates year?

 

Please explain further. You have weighted data, what are the weights, and which variable(s) are weighted, and how/why would we use the weights?

--
Paige Miller
dinyuen
Calcite | Level 5

The wave represents "year". The data were collected at different lengths of time. For example, Wave 1 took place between 2010 to 2012, Wave 2 2015 to 2018 and Wave 3 2020 to 2021. The same people were surveyed at each time point. I have been working with weights calculated as "all waves weights variable: weights_waves1to3" that is to be used for used when working with all 3 waves. So the calculation would be more of a wave percent change rather than annual. For other calculations I have relied on the proc surveyfreq incorporating the weight variable. Expansion of the data would be assigning the weight variable to each id and carrying it through the waves. Please let me know if you need any more details.

 

example data:

idwaveage groupheavy drinkerweights_waves1to3
1115-18yes1.2
1215-18no1.2
1319-21no1.2
2122-25no.8
2222-25yes.8
2322-25yes.8
3115-18no1.6
3219-21yes1.6
3319-21no1.6

 

 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 4 replies
  • 327 views
  • 0 likes
  • 3 in conversation