Power calculations in R

My first huge disappointment with R. My boss wanted me to do simple [tag]power calculations[/tag] to see how adding 2 animals to one of groups will improve statistical power. Yeah, I know, you are not supposed to do “retrospective power calculations”. Tell it to people providing lab animals, they always give you couple more just in case something happened to one or two you have. So, sometimes we have to do just that. Well, not in R.
There is this nice and simple [tag]power.t.test[/tag] function, with
n= for number of subjects in a group
delta = for difference between groups
sd= for standard deviation
sig.level= for desired alpha
power= for power, obviously
All you need to do is to define all but one and the remaining is calculated. Great, but how about if your groups are of unequal sizes? There is always Google? Not this time.
There is nice package [tag]pwr[/tag], if you happen to work on proportions and can use beauty of binomial distribution. That’s it.
Solution? I opened SAS and did what I needed in 1 min.
[tag]Proc power[/tag] works like power.t.test, but you can do calculations with different sd’s in groups, different group sizes and different experimental design. Wonder, when R catches up…

This entry was posted in R project, University. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>