Dear Kaveh, Take a look at http://www.statmethods.net/stats/power.html
HTH, Jorge.- On Thu, Jan 10, 2013 at 3:21 PM, Kaveh Zakeri <> wrote: > Hello, > > I am trying to get the power function to report the sample size rather > than the power. My goal is to input a variety of values for theta and then > for the power function to report the corresponding sample sizes. I haven't > had much luck trying to create my own function, something along the lines > of: > > f <- function (x) { > > power(N=z,a=6,f=6,pi=.5,alpha=.1,t0=10,theta=(1/x),CIFev0=.476,CIFcr0=0))=0.8 > read(z) > } > > In the above example, I am trying to fix the power at 0.80 and solve for > z, which is the sample size. I would like x to be a random distribution of > thetas. For instance: > > x=rnorm(30,.5,.2) > > and then receive the 30 corresponding sample sizes. > > Thank you! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.