0

Suppose in equation (1) below, d = .99. Also, sd = 1.2. Desirably, 5+(.1*5) <= m1 <= 5+(.5*5), and 5 <= m2 <= 5+(.3*5)

Equation (1): d = (m1-m2) / sd

Question

There surely are many possible answers for m1 and m2. But in R, how can I obtain the possible answers for m1 and m2 that fall within the range of m1 and m2 that I specified above (This is why I used "Desirably" above)?

Community
  • 1
  • 1
rnorouzian
  • 7,397
  • 5
  • 27
  • 72
  • If the answer is underdetermined as you seem to imply then there are an infinite number of possible solutions. Plotting the define equalities my be helpful. Unfortunately, your inequality limits have no dependence on any variable. – IRTFM Jun 15 '17 at 05:09
  • @42-, thanks for your insight. If I may, could you probably provide a short response showing how to implement your approach? – rnorouzian Jun 15 '17 at 05:13
  • Only if you make the limits for the inequalities depend on a variable would it make sense to me. At the moment it looks like the m1 and m2 variable are in a rectangular box. Rather trivial. The connection between 'sd' and 'mean' is completely unclear. – IRTFM Jun 15 '17 at 05:16
  • @42-, what may be the characteristics of the variable that the limits for the inequalities could depend on? any idea? – rnorouzian Jun 15 '17 at 05:21

2 Answers2

2

I'll attempt some data visualization to see if the points in comments can be clarified:

> d = .99; sd = 1.2; png();   plot(x=seq(-10,10), -10:10 )
> abline(h= c( 5+(.1*5), 5+(.5*5) ))
> abline(v=c(5+(.1*5) , 5+(.5*5)))

enter image description here

(I do know this is not an answer .. feel free to downvote or throw tomatoes. I won't care.)

IRTFM
  • 258,963
  • 21
  • 364
  • 487
1

Solving your equation for m1 yields that m1 = m2 + d*sd, so:

m1 = m2 + 1.188

Your inequalities are

5.5 <= m1 <= 7.5
5.0 <= m2 <= 6.5

If we replace m1 in the first inequality by m2 + 1.188 and simplify, we get the two inequalities:

4.312 <= m2 <= 6.312
  5.0 <= m2 <= 6.5

To have them both true we need

max(4.312,5.0) <= m2 <= min(6.312,6.5)

so:

5.0 <= m2 <= 6.312

In R you could do e.g.

> m2 <- seq(5.0,6.312,length.out = 10)
> m1 <- m2 + 1.188
> cbind(m1,m2)
            m1       m2
 [1,] 6.188000 5.000000
 [2,] 6.333778 5.145778
 [3,] 6.479556 5.291556
 [4,] 6.625333 5.437333
 [5,] 6.771111 5.583111
 [6,] 6.916889 5.728889
 [7,] 7.062667 5.874667
 [8,] 7.208444 6.020444
 [9,] 7.354222 6.166222
[10,] 7.500000 6.312000 
John Coleman
  • 51,337
  • 7
  • 54
  • 119