0

I am running a manova and my code is something like this:

fit <- manova(y ~ grp + cov)
summary(fit)

So the output of summary is:

               Df   Pillai approx F num Df den Df    Pr(>F)    
grp         2 0.185330   5.6511      6    332 1.322e-05 ***
age         1 0.110497   6.8323      3    165 0.0002284 ***
fd          1 0.153049   9.9388      3    165 4.646e-06 ***
scan        1 0.037374   2.1354      3    165 0.0977272 .  
Residuals 167                                              
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

I am having trouble finding a way to extract the 6th element of the 1st column (the p value) so that I can create a conditional if loop to run univariate and post hoc tests on significant models. Hoping to have something like:

p <- [method of obtaining p value(1.322e-05) in this case]
if (p < 0.017){
for (i in 1:length(dependentvars){
univariate tests with aov()
p.uni <- univariatetestp(same thing as before with obtaining p value)
if (p.uni <-){
summary(glht(....

Any advice or direction is greatly appreciated. Thank you -J

dj20
  • 3
  • 2
  • 1
    You can access the p-value column with `summary(fit)$stats[, 6]`. For the first row, use `[1, 6]`. – LAP Mar 08 '18 at 21:37
  • 1
    When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Mar 08 '18 at 22:21

0 Answers0