Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Repeated ANOVA where independent and dependent variables are repeated

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 12-07-2023 12:30 PM
(857 views)

Hi,

i was just wondering if there is a statistical test for testing how for example body mass changed after drinking and pysical activity (they are repeated as well).

Model would be

Model body mass1 - body mass2 = alcohol1-alocohol2 PA1 - PA2;

is there any test for testing how body mass changed over repeated independent variables?

Thanks in advance for any help,

Cheers

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Let's see if I can conjure up a toy dataset that captures my thinking, and then you can compare it to what you are doing. For this, let response = food intake and the two variables measured at each time for each subject be bw = body weight and bcs =body condition score, on a Likert scale of 1 to 5, 1 being very thin, 3 normal, and 5 very fat.

```
data toy;
input subject_id time bw bcs response;
datalines;
1 1 100 3 2.4
1 2 100 2 1.6
1 3 95 2 1.8
1 4 110 2 2.0
2 1 66 2 1.5
2 2 68 3 1.6
2 3 70 3 1.7
2 4 72 2 1.6
3 1 145 4 3
3 2 150 4 3.5
3 3 155 5 3.1
3 4 155 4 2.8
4 1 112 3 2.6
4 2 112 3 2.5
4 3 110 2 2.8
4 4 115 4 3.1
;
run;
proc mixed data=toy;
class subject_id time;
model response = time bw bcs/solution;
repeated time/subject=subject_id type=ar(1);
run;
```

If you run this you should see that there is no statistically significant effect on food intake due to time or bcs, and a statistically significant linear increase in food intake due to bw. If there were more data, I would consider adding interactions between time and the other two covariates. If this is not what you are looking for, please try again, but try to refer to the variables in this example.

SteveDenham

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

First question, is the effect of any of your repeated predictors linked solely to the current response (this will have an easy response), or does the predictor at a previous timepoint affect the response as well (this gets into timeseries analysis)?

If it is the first case, then get your data in "long" format with each record having an entry for the subject_id, the timepoint, the response variable value at that timepoint, and each predictor variable value at that timepoint.

From there, questions like "Is this predictor continuous or categorical?" and "Is there a possibility of predictors interacting that could affect my interpretation?" and "What do I do if all my predictors are continuous, but have very different ranges of values?" become important.

In any case any of the linear modeling PROCs are capable of handling data of this sort.

SteveDenham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Dear Steve, thank you for your quick response, your questions are crucial. However, I have a feeling that in this case we too much focus on a dependent variable, while the predictor can change over time as well. The predictor in this case is ordinal expressed on Lickert's scale, Is there any statistical test that focuses on the variability of the predictor as well? I hope you understood my idea.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Let's see if I can conjure up a toy dataset that captures my thinking, and then you can compare it to what you are doing. For this, let response = food intake and the two variables measured at each time for each subject be bw = body weight and bcs =body condition score, on a Likert scale of 1 to 5, 1 being very thin, 3 normal, and 5 very fat.

```
data toy;
input subject_id time bw bcs response;
datalines;
1 1 100 3 2.4
1 2 100 2 1.6
1 3 95 2 1.8
1 4 110 2 2.0
2 1 66 2 1.5
2 2 68 3 1.6
2 3 70 3 1.7
2 4 72 2 1.6
3 1 145 4 3
3 2 150 4 3.5
3 3 155 5 3.1
3 4 155 4 2.8
4 1 112 3 2.6
4 2 112 3 2.5
4 3 110 2 2.8
4 4 115 4 3.1
;
run;
proc mixed data=toy;
class subject_id time;
model response = time bw bcs/solution;
repeated time/subject=subject_id type=ar(1);
run;
```

If you run this you should see that there is no statistically significant effect on food intake due to time or bcs, and a statistically significant linear increase in food intake due to bw. If there were more data, I would consider adding interactions between time and the other two covariates. If this is not what you are looking for, please try again, but try to refer to the variables in this example.

SteveDenham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you SteveDenham.

All the best,

Skillside

All the best,

Skillside

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.