What I entered in the console (alp, DF1, DF2 are defined):
LT <- left.tail=FALSE
q <- qf(alp, DF1, DF2, LT)
q
What I got:
LT <- left.tail=FALSE
Error in LT <- left.tail = FALSE : could not find function "<-<-"
> q <- qf(alp, DF1, DF2, LT)
> q
[1] 0.4490486
The answer I am looking for is 2.22, which I get when the Lower Tail is defined as false.
Why is it telling me that "<-<-" is not avaible, I did not write this function? And is there a way to store a TRUE/ FALSE value for lower.tail?
For further explanation, I am trying to write a code where I simply have to enter the values on the top and get the answer out of it:
data.entry(1)
a1 <- mean(var2)
v1 <- var(var2)
SD1 <- sd(var2)
n1 <- max(n)
a2 <- mean(var3)
v2 <- var(var3)
SD2 <- sd(var3)
n2 <- max(n)
int <- 1-0.9 #given interval
LT <- FALSE #Right Tailed- H1: >/ =/=
TT <- 0 #Two Tailes- H1: = / =/=
alp.O <- 0.1 #Given Alpha
alp <- alp.O/(1+TT)
DF1 <- n1 - 1
DF2 <- n2 -1
q <- qf(alp, DF1, DF2, left.tail=LT) #ALP, DF1, DF2
f <- q-2*q*RT #t-Critical Value - Rejection Level
F <- v1/v2 #Parameter of Interest1 / Parameter of Interest2
print(F==f)
print(F>f)
print(F<f)
It's not done yet and there are some residuals from older code, please ignore them.
In R, you can assign using 2 different operators:
<-and=.That is, if you want to assign the value of 3 to the variable
x, you can write eitherx<-3orx=3.When you write:
LT <- left.tail=FALSE, instead of testing whetherleft.tailis FALSE (which you'd do with the comparison operator==) you're setting up a double assignment – that is, assigning the valueFALSEtoleft.tailandLT. You can actually do that if you use the same operator:x=y=4ork<-d<-5both work as expected. If you mix these operators, though, you get an error.I'm not exactly sure what is going on behind the scenes to generate the function
<-<-, but I do know it's a result of R trying to deal with combining the 2 different assignment operators in a single expression. If you do want to do the double assignment, just use the same operator:In your case, I don't think you want to do a double assignment. Likely, you want to test if
left.tailis FALSE, and store that result inLT. You can do that in a few ways: