Displaying 2 results from an estimated 2 matches for "trial01".
Did you mean:
trial
2010 Jul 20
3
simplify if statement in R ?
...of the if statement that works but it is very long. I'm
attempting to check the value of of two different variables to see if
they evaluate to either of two different values, which will result in a
division by 0 in the final equation. This first if statement works for me
_______
if ((x0.trial01 == 0.0)||(x0.trial01 == npt01)||(x1.trial01 ==
0.0)||(x1.trial01 == npt01))
{
x0.trial01.in <- x0.trial01 + 0.5
x1.trial01.in <- x1.trial01 + 0.5
npt01.in <- npt01 + 1.0
}
else
{
x0.trial01.in <- x0...
2010 Sep 23
2
Error: attempt to apply non-function
This code worked fine for me, then did some cleaning up of formatting using ESS (Emacs) and now I get this error, no idea what is causing it, all the brackets/parentheses seem to be balanced. What have I done wrong?
Thanks
Jim
p0.trial01 <- 0.25
TruOR01 <- 0.80
num.patients.01 <- 50
num.trials.01 <- 5
LOR01.het.in <- 0.00
num.sims <- 1
simLOR01 <- vector(length=num.trials.01)
simLORSE01 <- vector(length=num.trials.01)
simOR01 <- vector(length=num.trials.01)
trialnum01 <- vector(length=num.trials.01)...