Hi all,
I'm working on my thesis and having some trouble figuring out how to run an analysis. I have quintiles of weight change over a 10 year period for a population of about 10,000. I'm looking to run a general linear model with the mean weight change across each quintile as the outcome, but am unsure how to create an outcome variable for this. I am able to find the means weight change across the quintiles, but figuring out how to make those into the outcome variable appropriately is where I'm having some trouble. Any ideas? Thanks!
If you use all 10,000 observations, and the weight change for each observation, then GLM will predict the average weight change in each quintile. (That isn't exactly what you asked for, but it seems to me to be the most sensible approach). Although its not really clear to me the point of modeling a weight change against the quintile of that weight change.
Example using a data set of 12 observations
data have;
input id quintile weight;
cards;
1 1 29
2 1 35
3 1 34
4 2 40
5 2 44
6 2 49
7 3 50
8 3 50
9 4 55
10 4 60
11 5 61
12 5 66
;
proc glm data=have;
class quintile;
model weight=quintile;
means quintile;
run;
quit;
Also, I don't really understand this sentence (especially the part that says "mean weight change across each quintile", what is that? Did you really mean to say "mean weight change within each quintile"?):
I'm looking to run a general linear model with the mean weight change across each quintile as the outcome
If you use all 10,000 observations, and the weight change for each observation, then GLM will predict the average weight change in each quintile. (That isn't exactly what you asked for, but it seems to me to be the most sensible approach). Although its not really clear to me the point of modeling a weight change against the quintile of that weight change.
Example using a data set of 12 observations
data have;
input id quintile weight;
cards;
1 1 29
2 1 35
3 1 34
4 2 40
5 2 44
6 2 49
7 3 50
8 3 50
9 4 55
10 4 60
11 5 61
12 5 66
;
proc glm data=have;
class quintile;
model weight=quintile;
means quintile;
run;
quit;
Also, I don't really understand this sentence (especially the part that says "mean weight change across each quintile", what is that? Did you really mean to say "mean weight change within each quintile"?):
I'm looking to run a general linear model with the mean weight change across each quintile as the outcome
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.