Re: [R] Problem with Loops

2010-04-08 Thread mtesche
I removed the ceiling and it works! Thanks a heap, that was driving me crazy! -- View this message in context: http://n4.nabble.com/Problem-with-Loops-tp1794288p1801623.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project

Re: [R] Problem with Loops

2010-04-08 Thread Erik Iverson
# obtain power power <- array(numeric(nr*np), dim=c(nr,np)) for (i in 1:np){ for (j in 1:nr){ result <- pwr.t.test(n = r[j], d = p[i], sig.level = .05, power = NULL, alternative = "two.sided") power[j,i] <- ceiling(result$power) } } First problem. Why are you calling ceil

Re: [R] Problem with Loops

2010-04-08 Thread Erik Iverson
Hello, mtesche wrote: Hello, I am trying to write a script with the end goal of graphing power (y) as a result of sample size (x) at a variety of effects sizes. I am new to loops, and I think my problem is there. Here's the script, which is modified from the script found at the bootom of http