Sample Variance and Population Variance for Ungrouped data A study of the effect of smoking on sleep patterns is conducted. The measure observed is the time, in minutes, that it takes to fall asleep. These data are obtained:
Smokers: $69.3, 56.0, 22.1, 47.6, 53.2, 48.1, 52.7, 34.4, 60.2, 43.8, 23.2, 13.8$
Non-Smokers: $28.6, 25.1, 26.4, 34.9, 28.8, 28.4, 38.5, 30.2, 30.6, 31.8, 41.6, 21.1, 36.0, 37.9, 13.9$
I have to find Variance for both of the given groups
Question
As we know there are two types of Variance sample variance and other is population Variance, Which type of Variance I should use to find the variance of above(given) ungrouped data and why?
 A: This is a common source of confusion: which formula you use depends on the motivation behind the question. Specifically, are you need clarify what you mean by "these groups". Can you identify whether:
(a) you are interested in this particular sample of smokers and non-smokers, so you are trying to calculate summary statistics to describe these individuals;
or
(b) you are interested in the populations of smokers and non-smokers from which these samples were taken, so are trying to estimate the variability in sleep times in those populations?
In case (a) you are interested in the sample variance:
$$ s^2 = \frac{1}{n} \sum_{i =1}^{n} (x_i - \bar x)^2.$$
In case (b) your aim to estimate the population variance $\sigma^2$ using this sample. The sample variance is a biased estimator of the population variance (it does not converge to the population variance $\sigma^2$ as your sample size $n$ becomes large), but we can correct for this bias by using the estimate:
$$\hat\sigma^2 = \frac{1}{n-1} \sum_{i =1}^{n} (x_i - \bar x)^2.$$
