简体   繁体   中英

Why does manova() not give me p values?

Whenever I use manova() , then summary.aov() , I only get df, Sum sq, and Mean Sq, with no p value.

My data frame looks like: (sorry I'm not sure if there's a better way to display this!)

  subtype lymphocytosis anemia thrombocytopenia eosinophilia hypercalcemia hyperglobulinemia
1     MBC          0.60   0.18             0.17         0.02          0.01              0.04
2     SBC          0.25   0.18             0.14         0.03          0.02              0.12
3    BCLL          1.00   0.29             0.18         0.08          0.03              0.21
  neutrophilia neutropenia lymphadenopathy_peripheral lymphadenopathy_visceral splenomegaly
1         0.23        0.02                       1.00                     0.65         0.60
2         0.22        0.04                       0.99                     0.62         0.49
3         0.23        0.04                       0.40                     0.25         0.49
  hepatomegaly pleural_effusion peritoneal_effusion intestinal_mass mediastinal_mass pulmonary_mass
1         0.41             0.02                0.05            0.10             0.09           0.22
2         0.37             0.03                0.05            0.17             0.12           0.22
3         0.27             0.01                0.04            0.25             0.03           0.25

The values in the data frame represent the mean number of cases from each subtype for each clinical sign. I am a little worried that, for manova() to work, I should have each individual case and their clinical signs inputted so that manova can do its own math? Which would be a huge pain for me to assemble, hence why I've done it this way. Either way, I still think I should bet getting P values, they just might be wrong if my data frame is wrong?

The code I am using is:

cs_comp_try <- manova(cbind(lymphocytosis, anemia, thrombocytopenia, eosinophilia, hypercalcemia,
  hyperglobulinemia, neutrophilia, neutropenia, lymphadenopathy_peripheral, lymphadenopathy_visceral,
  splenomegaly, hepatomegaly, pleural_effusion, peritoneal_effusion, intestinal_mass, mediastinal_mass, pulmonary_mass) ~ subtype, data = cs_comp)   
summary(cs_comp_try)  
summary.aov(cs_comp_try)

The result I get for summary.aov() is:

 Response peritoneal_effusion :
            Df     Sum Sq    Mean Sq
subtype      2 6.6667e-05 3.3333e-05

 Response intestinal_mass :
            Df   Sum Sq   Mean Sq
subtype      2 0.011267 0.0056333

 Response mediastinal_mass :
            Df Sum Sq Mean Sq
subtype      2 0.0042  0.0021

 Response pulmonary_mass :
            Df Sum Sq Mean Sq
subtype      2  6e-04   3e-04

I think I've replicated all the examples I've seen on the internet, so I'm not sure why I'm not getting an F statistic and p value when I run this code.

You can just use the summary function to get the p-values like this (I use iris data as an example):

fit <- manova(cbind(Sepal.Length, Petal.Length) ~ Species, data = iris)
summary(fit)
#>            Df Pillai approx F num Df den Df    Pr(>F)    
#> Species     2 0.9885   71.829      4    294 < 2.2e-16 ***
#> Residuals 147                                            
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Created on 2022-07-15 by the reprex package (v2.0.1)

If you want to extract the actual p-values, you can use the following code:

fit <- manova(cbind(Sepal.Length, Petal.Length) ~ Species, data = iris)

summary(fit)$stats[1, "Pr(>F)"]
#> [1] 2.216888e-42

Created on 2022-07-15 by the reprex package (v2.0.1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM