Assignment 6 - seperate function for theoretical power

Assignment 6 - seperate function for theoretical power

by Louise Mulsant -
Number of replies: 1

Hello!

I am wondering if it is necessary to create a function for the theoretical power for the t-test. 

This is used in 1b and 1c but is not much code. 

Based on your reccomendation in class (i.e. consider making a function when there are three or more lines of repeated code), I would think that it is not necessary in this case but I wanted to confirm.

Thank you!

Louise

In reply to Louise Mulsant

Re: Assignment 6 - seperate function for theoretical power

by Erik Spence -
It is not necessary to create a function for a single line of code. If you find that you are re-using 3 or more lines of code, make a function.