I think the code you provided should pretty much do what you're describing:
x <- exp(rnorm(100, m=-2.59625, sd=0.5852539))
y <- 2 / (9*x) + 8
Pregunta
I would like to insert random values from a lognormal distribution into a linear equation. The equation is:
y = 2/(9x) + 8
...and x
shall take random values from the distribution
exp(rnorm(100, m=-2.59625, sd=0.5852539))
How do I generate the distribution of y
?
No hay solución correcta
Otros consejos
I think the code you provided should pretty much do what you're describing:
x <- exp(rnorm(100, m=-2.59625, sd=0.5852539))
y <- 2 / (9*x) + 8