Hi! I’m hoping for some advice, as I’m new to this :)

I have some data which I believe is distributed lognormally. I’m using a normal prior for the mean, and a cauchy prior for the standard deviation. I’m performing AB testing and calculating two values: the probability that the mean of the B variant is greater than the mean of the A variant, and the lift that I could expect if I chose the B variant. Unfortunately, I can’t share the data. The Stan code is as follows:

```
data {
real mu_prior;
real sigma_prior;
int<lower=0> control_n;
vector<lower=0>[control_n] revA;
int<lower=0> var_n;
vector<lower=0>[var_n] revB;
}
parameters {
real muA;
real<lower=0>sigmaA;
real muB;
real<lower=0>sigmaB;
}
model {
muA ~ normal(mu_prior, 2);
sigmaA ~ cauchy(sigma_prior, 3);
muB ~ normal(mu_prior, 2);
sigmaB ~ cauchy(sigma_prior, 3);
revA ~ lognormal(muA, sigmaA);
revB ~ lognormal(muB, sigmaB);
}
generated quantities {
//difference in means is the quantity of interest
real mu_diff;
real post_revenue_a;
real post_revenue_b;
real revenue_diff;
mu_diff = muB - muA;
post_revenue_a = lognormal_rng(muA, sigmaA);
post_revenue_b = lognormal_rng(muB, sigmaB);
revenue_diff = post_revenue_b - post_revenue_a;
}
```

Sometimes, I get high probability that variant B has higher mean than variant A, but a negative average of the revenue_diff term. Does this make sense?