BookmarkSubscribeRSS Feed
PSZ
Calcite | Level 5 PSZ
Calcite | Level 5

I have 1000 persons data with 5 years' annual bone mineral density (BMD) measurement.  Now I want to get the bone mineral density (BMD) change rate per year. Because this is longitudinal data, I think I should use proc mixed.

 

My data is like:

id     visit                    group           bmd

1      0(baseline)          a                 1.01

1      1                         a                 1.00

1      2                         a                 1.00

1      3                         a                 0.99

1      4                         a                 0.98

1      5                         a                 0.96

2      0(baseline)          b                 1.07

2      1                         b                 1.06

2      2                         b                 1.04

2      3                         b                 0.99

2      4                         b                 0.95

2      5                         b                 0.93

......

 

My code is :

 

PROC MIXED DATA=mydaa noclprint;
CLASS id  visit   group;
MODEL  bmd = visit   group  group*visit / SOLUTION CL DDFM=KR OUTPM=aaa;
REPEATED visit / SUBJECT=id   TYPE=UN R RCORR;
RUN;

 

Is this code correct? and where can I get the change rate in the output? I read one paper said the estimate is the change rate, but the  numbers are positive (the change rate should negative). 

 

And I plot the result like this:

 

PROC SGPLOT DATA=aaa;
SERIES x = visit  y = pred / GROUP = group  MARKERS;
RUN;

 

The plot looks correct. But how can I get the numbers for the slop?

 

Thank you very much for your help.

3 REPLIES 3
rbikes
Obsidian | Level 7

The estimate is only the estimate of the dependent variable. Here, the dependent variable is bmd, is bmd a change rate? Looking at the structure I would say it isn't. Assuming I am correct I would suggest you create baseline variable and then from that and bmd calculate the change and use the change variable as the dependent variable and also include baseline into the model.

PSZ
Calcite | Level 5 PSZ
Calcite | Level 5

Thanks for your reply. If I understand correctly, the coefficient of the interaction term (group * visit) (i.e. the slop of the model) is the change rate. 

rbikes
Obsidian | Level 7

If you just want to find the slop I would suggest to follow this tutorial by Rick Wicklin

 

https://blogs.sas.com/content/iml/2013/02/27/slope-of-a-regression-line.html

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1085 views
  • 0 likes
  • 2 in conversation