manova

Faster alternative to R car::Anova for sum of square crossproduct matrix calculation for subsets of predictors

穿精又带淫゛_ 提交于 2021-01-07 01:43:30
问题 I need to compute the sum of squares crossproduct matrix (indeed the trace of this matrix) in a multivariate linear model, with Y (n x q) and X (n x p). Standard R code for doing that is: require(MASS) require(car) # Example data q <- 10 n <- 1000 p <- 10 Y <- mvrnorm(n, mu = rep(0, q), Sigma = diag(q)) X <- as.data.frame(mvrnorm(n, mu = rnorm(p), Sigma = diag(p))) # Fit lm fit <- lm( Y ~ ., data = X ) # Type I sums of squares summary(manova(fit))$SS # Type III sums of squares type = 3 #

Faster alternative to R car::Anova for sum of square crossproduct matrix calculation for subsets of predictors

左心房为你撑大大i 提交于 2021-01-07 01:40:21
问题 I need to compute the sum of squares crossproduct matrix (indeed the trace of this matrix) in a multivariate linear model, with Y (n x q) and X (n x p). Standard R code for doing that is: require(MASS) require(car) # Example data q <- 10 n <- 1000 p <- 10 Y <- mvrnorm(n, mu = rep(0, q), Sigma = diag(q)) X <- as.data.frame(mvrnorm(n, mu = rnorm(p), Sigma = diag(p))) # Fit lm fit <- lm( Y ~ ., data = X ) # Type I sums of squares summary(manova(fit))$SS # Type III sums of squares type = 3 #

How to conduct a MANCOVA

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 11:05:43
问题 I am trying to perform a mancova in R. However, I have tried the jmv package: x<-cbind('total.c','total.p') #dependent y<-cbind('Treatment','Sex', 'Species', 'Location') #independent mancova(intake, deps=x,factors=y, covs=c("Ghopper.Start..g.")) which gives me the following error: Error: Table$setRow(): value 'stat[pillai]' is not atomic When I remove one of the independent variables, the function works with no problems. So I am suspecting its a memory limitation,, but what actually is going

Vegan adonis unbalanced design SS type II or III

▼魔方 西西 提交于 2019-12-11 20:09:56
问题 I am a newbie to multivariate statistics, so please forgive me if this question is naïve, or if I have missed something important. I'd like to know how to deal with an unbalanced design when using adonis. I have a data set of microbial communities present in stream sediment and the factors stream (4 levels), US_DS (2 levels) and season (2 levels) (I have other factors as well but sticking to these for the moment). e.g. code below: dist.L2<-vegdist(L2, mehod=”bray”) adonis(dist.L2~Season

Statsmodels MANOVA : IndexError: index 1 is out of bounds for axis 0 with size 1

假如想象 提交于 2019-12-11 08:07:36
问题 I have spent hours trying to make statsmodels do my MANOVA without success. Here is the code: from statsmodels.multivariate.manova import MANOVA df = data feats_list = ['col1', 'col2', 'col3' ... 'col4'] var_list = ['col5', 'col6'] endog, exog = np.asarray(df[feats_list]), np.asarray(df[var_list]) manov = MANOVA(endog, exog) manov.mv_test() Providing: --------------------------------------------------------------------------- IndexError Traceback (most recent call last) <ipython-input-16