Writing a Simple Function

Learn to write a simple function.

There are many times when we may want to write our own functions. As scientists, one of the most valuable things we can do is simulate the data we get to understand the effects of sample size and effect size on our statistical power. For example, we can use a pilot study to estimate our treatments’ effect size and then simulate data to determine how big a sample size we’ll need to observe statistical significance.

Get hands-on with 1200+ tech skills courses.