0

I am using stats() 3.5.2 to run a manova with:

  • participant 1:20
  • gender as between subject factor
  • group as within subject factor
  • anxiety as dependent measure
  • BAC as dependent measures

The dataset follow:

treat4 = data.frame (
   participant = rep(1:20,3),
   gender = factor (rep(c(rep("male", 10), rep ("female", 10)),3)),
   group = factor (c(rep("control",20), rep("run",20), rep("party",20))),
   anxiety = round(c(rnorm(20, mean=55, sd=5),rnorm(20, mean=20, sd=5),rnorm(20, mean=75, sd=5))),
   BAC = round(c(rep(0.01,20), rep(0.01,20), rnorm(20, mean= 0.09, sd=0.01)),2))

I apply the manova () function and summarize as follows:

mod = manova(cbind(anxiety,BAC) ~ gender + Error(group),data=treat4)
summary (mod)

This is what I get:

Error: group
          Df Pillai approx F num Df den Df Pr(>F)
Residuals  2                                     

Error: Within
          Df   Pillai approx F num Df den Df Pr(>F)
gender     1 0.013447  0.37482      2     55 0.6892
Residuals 56 

There are a couple of issues:

1) Gender seems to be accounted as within-subjects factor

2) I don't get any statistics for the group factor

Any help?

frankieR
  • 13
  • 3
  • 1
    ANOVA in general only accounts for 1 dependent measure. For more than 1, do multiple ANOVAs or MANOVA. – M. Papenberg Mar 04 '20 at 15:36
  • Thanks @M.Papenberg for your help. – frankieR Mar 04 '20 at 16:00
  • Thanks. If I added gender as between-subject factor, how would I need to account for it in the manova() model? The code for the data.frame is below ``` treat4 = data.frame ( participant = rep(1:20,3), gender = factor (rep(c(rep("male", 10), rep ("female", 10)),3)), group = factor (c(rep("control",20), rep("run",20), rep("party",20))), anxiety = round(c(rnorm(20, mean=55, sd=5),rnorm(20, mean=20, sd=5),rnorm(20, mean=75, sd=5))), BAC = round(c(rep(0.01,20), rep(0.01,20), rnorm(20, mean= 0.09, sd=0.01)),2)) ``` – frankieR Mar 04 '20 at 16:06

3 Answers3

0

if anxiety and BAC are your dependent variables, you place them on the left side of tilda (~) with cbind, to indicate multivariate response, and use Error() to specify the within group effect (or random effect). The rest on the right side of tilda (~) are your between group effect (or fixed effect):

manova(cbind(anxiety,BAC) ~ gender + Error(group),data=treat4)

Call:
manova(cbind(anxiety, BAC) ~ gender + Error(group), data = treat4)

Grand Means:
    anxiety         BAC 
49.96666667  0.03766667 

Stratum 1: group

Terms:
                 Residuals
anxiety           33156.63
BAC             0.09185333
Deg. of Freedom          2

Residual standard errors: 128.7568 0.2143051

Stratum 2: Within

Terms:
                   gender Residuals
anxiety            8.0667 1527.2333
BAC                0.0000    0.0034
Deg. of Freedom         1        56

Residual standard errors: 5.222262 0.007807201
Estimated effects are balanced
StupidWolf
  • 45,075
  • 17
  • 40
  • 72
0

Thanks @StupidWolf for your answer.

However, when I apply summary () to the model:

summary(manova(cbind(anxiety,BAC) ~ gender + Error(group),data=treat4))

I get the following:

Error: group
          Df Pillai approx F num Df den Df Pr(>F)
Residuals  2                                     

Error: Within
          Df   Pillai approx F num Df den Df Pr(>F)
gender     1 0.039097   1.1189      2     55  0.334
Residuals 56  

There are a couple of issues:

1) Gender seems to be accounted as within-subjects factor

2) I don't get any statistics for the group factor

frankieR
  • 13
  • 3
  • hey is something wrong with your installation? I ran it with your example above and it works.. and please try not to answer, i will not see it. Comment below my answer or update your question – StupidWolf Mar 07 '20 at 12:17
  • I am using stats version 3.5.2. – frankieR Mar 10 '20 at 17:38
0

I know this comes a bit late but I faced the same issue and I think you can simply solve it this way:

summary(manova(cbind(anxiety,BAC) ~ gender + group + Error(factor(participant)),data=treat4))

Basically, you need to add group as an IV (by doing + group). Then you use the Error() to indicate how it needs to identify unique subjects, it needs to do this by the participant number, rather than by the group.

Don't forget to make the participant into a factor, otherwise, it causes problems!

DogEatDog
  • 2,899
  • 2
  • 36
  • 65