3
For an equation of the type y = ax + b
, we have two values for a
and two to b
, That is, we have four different equations.
We already have a code that returns us the values of x
and y
for each equation separately. We want to know if there is a way to realize a loop
return the respective values of each x
and y
when we vary the values of "a" and "b". That is, how to find y1, y2, y3, y4, x1, x2, x3 e x4
(for each combination of a and b) without having to run the code four times.
Obs: the program used is R
Mariana, put an example of what you’ve done. You want to find so much
y
how muchx
or just findy
for a givenx
? Because the way you put it you have two variables and only one equation, so are endless solutions ofx
andy
.– Carlos Cinelli
Hello, Carlos, actually the equation represents an econometric regression and we have a formula to find both the values of x and the values of y, which is too big to be put here. If we assume a fixed x, with varying parameters, how would we find y without having to run the code four times?
– Mariana
If it is not possible to place the original code, put an "illustrative" code that exemplifies the problem, because the question is ambiguous as it is. But I think I understand what you want, I put an answer below.
– Carlos Cinelli