Chapter 33 Simulation

We use simulation to generate a null distribution for a test statistic when we are concerned that the assumptions of the parametric test are not met.

If we use single cell mRNA fluorescent in situ hybridization (FISH) we can count the number of mRNAs for a particular gene per cell. Let’s assume that the number of molecules is a uniform distribiution that ranges from 10-20 molecules per cell.

To simulate this, generate a population of 1100 cells that have 10 or 11 or 12…or 20 mRNAs per cell

## 
##  Welch Two Sample t-test
## 
## data:  sample(mRNA.count, 5) and sample(mRNA.count, 5)
## t = -1.427, df = 7.8043, p-value = 0.1924
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -7.869343  1.869343
## sample estimates:
## mean of x mean of y 
##      15.4      18.4

Based on this analysis I would be comfortable using a t-test for these data despite the fact they come from a uniform distribution. We can use either the critical values from the simulation or from the theoretical t disttribution.