How can I average the variance extracted from different group of samples? I have groups of samples, where each group has a different number of samples and a different mean. I also know the variance of each group of samples. I would like to compute a sort of "average" variance, that should be something like the mean of my variances.
If the groups had all the same number of units, I think I could simply average the variances of each group summing up the variances and dividing by the number of groups.
However my groups have different sizes and I should, somehow, keep this into account.
How can I proceed?

One logical approach is to meta-analyze the variance, you can then either look at the inference about the mean of studies/experiments/samples or about the prediction for a new unseen study (or any particular study, you've already seen). There's a vignette on this for the RBesT R package.
This is all based on the observation (see e.g. Schmidli et al. 2017) that - assuming a normal distribution for the data (at least after suitable transformation - the sampling distribution of the estimate of the (residual) variance of an group in a study with $n$ patients/samples follows a $\Gamma(\nu/2, \nu/(2 \sigma^2))$ distribution, where $\sigma$ is the true variance. We would typically use $\nu = (n-1)$ when the residual variance is from a linear model with just an intercept per group. Note that we use the parameterization of the $\Gamma$-distribution in terms of a shape and a rate parameter (sadly, there's many versions around). You can then assume that $\log(\sigma_i)$ for study $i$ varies across studies $i=1,\ldots,I$ according to e.g. a normal distribution.
