Power of t-test

Hello all,

I want to write an R procedure that calculates the power of a simple two samples t-test. Does anyone here has an idea how to do it ?

Thank you !


TS Contributor

The document give some example of computing the power function of z-test.

For your problem, first you need to state your alternative hypothesis. Next, note that we can compute the power function for a given level. Also the rejection probability is a function of the nuisance parameters (the population means in the two population) so we can just express the power as a function. Some may plug in the MLE in the function as an estimate.