Performing ANOVA on vectors with different numbers of observations

So I am trying to perform an ANOVA on three separate groups to compare a single variable - starting with characteristics.

Firstly I am doing this for age and was looking to use ANOVA to compare three separate groups.

However, I have a different number of observations for each group which is preventing me from making a dataframe easily. I am fairly certain that ANOVA does not require equal sample sizes, although I appreciate it can create issues.

I guess some questions I have:
Can I run ANOVA just using vectors? How is this done?
Is there a way to combine the the vectors into a dataframe that would allow me to utilise ANOVA with a different number of observations in each?

alpha = 57 observations X 1 variable
bravo = 22 observations X 1 variable
charlie = 5 observations X 1 variable

Thanks

I have tried a couple of ways to make the df
> df <- data.frame(
+    Y=c(alpha, bravo, charlie),
+    group = factor(rep(c("group1", "group2", "group3"), 
+    times=c(length(alpha), length(bravo), length(charlie)))))
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
  arguments imply differing number of rows: 57, 22, 5

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.