0

I'm using Tim Gerrodette's inequality equation (1987), to look at power analysis of visual survey data, however i'm struggling of finding away to solve this for x, using R.

I have the following equation

r^2 * n^3 > 12*cv^2(za/2 + zB)^2

where r=0.02, n=40, cv=0.67, za/2=1.645, and I want to solve for zB (x, essentially) Which translates to:

0 < zB^2 + 3.3zB - 2.04 Where -3.4 < zB < 3.4

How might I go about solving this in R? I've looked at quadprog and limsolve, but i'm not sure that I'm on the right track as many seem to be using these functions to solve multiple/simultaneous equations.

I'm looking for a method in R that I can use, and sub in a series of values for r,n, CV etc.

megsryder
  • 101
  • 2
  • 1
    I did not solve the whole thing, just for the boundaries you gave. The first boundary can be written as: $2.040$. So the second boundary should be $0 – Baraliuh Oct 18 '22 at 13:30
  • Note that the answer for the give parameters at two digits is [-3.8, 0.5] which can be solved algebraically (just plug in the values and solve for zB). Unless you are actually solving for z? Which would make it more complicated and need QP. – Baraliuh Oct 18 '22 at 21:49

1 Answers1

2

If the question is how to obtain the set of values for which zB satisfies the 3 inequalities we can determine this up to 3 decimal places (or other by changing .001) using brute force so the interval shown below satisfies the inequalities.

zB <- seq(-3.4, 3.4, .001)
range(zB[zB > -3.4 & zB < 3.4 & zB^2 + 3.3 * zB > 2.04])
## [1] 0.533 3.399
G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341