1.

Transactions#FaceplateColorsPurchased1redwhitegreen2whiteorange3whiteblue4redwhiteorange5redblue6whiteblue7whiteorange8redwhitebluegreen9redwhiteblue10yellow

Answer»

When variables are categorical and continuous, and there are “many samples”, then we should not use the t-test. If sample size n>=30, then we can go for z-test. When there are too many samples and the mean/average of multiple groups are to be compared, then ANOVA can be chosen.

When we don’t have many samples and variance is unknown, then we will use the t-test. In a t-test, the expectation is that the sample size is SMALLER. Typical n<30, where n is the number of observations or sample size.

The t-test and z-test can be defined as follows. There is a very subtle difference between the two. z-test is USED for n>=30 and t-test is used for n<30 scenarios mostly.

t-test = (x-bar - MU) / (sd / sqrt(n))

  • where x-bar = sample average or sample mean of x
  • mu = population average or population mean
  • sd = standard deviation of a sample
  • n = number of observations, which is sample size

z-test = (x-bar - mu) / (sigma / sqrt(n))

  • where x-bar = sample average or sample mean of x
  • mu = population average or population mean
  • sigma = standard deviation of a population
  • n = number of observations, which is sample size

ANOVA is an analysis of variance. For example, let’s say we are talking about 3 groups.

Class 1Class 2Class 3
893
624
563
825
674
1054
626
384
545
793

Figure ANOVA

In the “Figure ANOVA” above, we can consider ANOVA for analysis as there are more than 2 sample groups. i.e. 3 groups of samples. There can be many ROWS in each class. We have considered only 10 each for simple understanding.

Class GroupCountSumAverageVariance
Class 110646.43.82
Class 210545.48.04
Class 310414.10.99


Discussion

No Comment Found

Related InterviewSolutions