We’re asking you to select a content label when starting a new topic in the Discussions area. Read more to find out why.
Choose Language Hide Translation Bar
Highlighted
Level I

## Correct for variables in ANOVA

Hi.

I'm really struggling with this and I'm sure I'm missing something really stupid.

I have a set of people who either have a clinical manifestation (X), and so I am doing a series of ANOVAs to present the data in a table that will essentially have something like the table below. There is a variable of interest that I expect is associated with X, so I would like to know if there are group differences.

VariableX presentX Absentp
Age0.01*
Duration0.01*
Variable of interest (continuous)0.01*

Obviously there are more columns. My problems is that Age and Duration differ between the groups, and then the mean for the variable of interest does too. I want to know if there's a way I can get the 'p value' for the comparison of the mean for the variable of interest for X present vs absent, to make sure the difference isn't just a function of age and duration.

Is it possible with the X by Y -> Oneway = ANOVA platform? Or should I do it in a nominal logistic regression?

6 REPLIES 6
Highlighted
Level II

## Re: Correct for variables in ANOVA

`My problems is that Age and Duration differ between the groups, and then the mean for the variable of interest does too.`

What groups are you referring to? What is the variable of interest? These don't appear to have been mentioned in your description. What number is supposed to go in the columns labelled X Present and X Absent?

Please state clearly the ANOVA model you are trying to fit

Highlighted
Level I

## Re: Correct for variables in ANOVA

I was trying not to give too much regarding the actual project away.

Patients either have a certain condition (X) or they don't. I suspect that their score on an evaluation (variable of interest) out of 30 is associated with having condition X. In other words, I suspect the ANOVA will show a difference. However, the ANOVAs for Age and Duration also showed a difference, with patients with X being older and having a longer duration (on average). I wondered if I can correct for Age and Duration and see if there's still a difference in their score on the evaluation (variable of interest).

The only way I know to do something similar is to do a logistic regression with all three as predicting variables and membership to the condition X group being the outcome. But I've seen other author report, in a table seemingly giving ANOVA values and corresponding p values, the 'p value corrected for ____'

Highlighted
Level II

## Re: Correct for variables in ANOVA

Since you didn't state a model, I'll give it a try

Variable of Interest = f(presence of condition, age, duration)

where presence of condition, age and duration are the predictor variables and "variable of interest" is the response

Is that correct?

Highlighted
Level I

## Re: Correct for variables in ANOVA

Mmm...

I'll make up some variables:

Patients with migraine

Patients without

Male/Female

23/23

21/22

0.910

Age

70.24±9.6

66.47±8.00.048*

Depression index

83.05±12.4

90.27±7.4

0.001*

Muscle pain index
 13.96±1.4

14.70±0.5

0.008*

That would be a strange study.

Anyway, given this example, we can see that all three variables differ across the two groups. The most interesting difference is the 'Muscle pain index'. However, I have reason to believe that the difference in 'Age' and 'Depression' might explain that, rather than a true difference in patients with migraine.

I can do a nominal logistic regression (Fit Model in JMP) with 'Migraine' as the outcome variable (Y in JMP), and 'Age', 'Depression Index' and 'Muscle pain index' as predicting variables (X in JMP). The result is that the muscle pain index has a OR that is significant even when the effect of the other two is taken into account. However, I have seen people report things like this:

I don't think those p values are from a regression, and they don't list anything else that would make me think they did a regression to get them. I was wondering if there is another way to correct for things like 'Age' and when doing ANOVAs like I did above.

Thanks

Highlighted
Level I

## Re: Correct for variables in ANOVA

Hello,

May be the following code can generate the desired results.

ods output MODELANOVA=MODELANOVA;

proc anova data=have;

class X;

model Y=X;

run;

quit;

proc print data=MODELANOVA;

run;

Highlighted
Level II

## Re: Correct for variables in ANOVA

Seems to me that if you heve include Age in the model, then you have indeed corrected for the affect of Age.

Without reading the paper that contains the example you provide, I can't comment on the example you give.