Question: how to calculate percentage of variance in r?
Answer: In R, sample variance is calculated with the var() function. In those rare cases where you need a population variance, use the population mean to calculate the sample variance and multiply the result by (n-1)/n; note that when sample size gets very large, sample variance converges on the population variance.