I'm trying to run a Manova in Rstudio but run into an error whenever i try to execute it. I have 2 dataframes containing 2678 and 2051 rows and an equal amount of columns. I rbind these dataframes into 1 and create a new variable y with the dependent variables (column 1:28) and a new variable x containing the independent variable (column 29). The independent variable is a factor with levels "True" & "False". The dataframes are imported from an csv excel file. Whenever i try to run y against x with manova i get the following errors:
manova(y ~ x, data = bigfile)
invalid type (list) for variable 'y'
I then do manova(unlist(y) ~ x, data = df)
Which gives me this error:
variable lengths differ (found for 'x')
I've looked at similar problems on this platform but none of these solutions seem to work for my problem. However, when I import my entire dataset into JASP it does run a Manova. So I guess the problem has to do with the way the data is imported/mutated in my dataset(s)
d <- data.frame("Label" = c("True", "False"), "v1" = c(21,14), "v2" = c(0.132, 0.456), "v3" = c(0.734, 0.824))
d2 <- data.frame("Label" = c("False", "False"), "v1" = c(48,18), "v2" = c(0.284, 0.137), "v3" = c(0.296, 0.112))
bigdf = rbind(d, d2)
y = cbind(bigdf[2:4])
x = bigdf[1]
aov = manova(y ~ x, data = bigdf)