Hello Everyone: I have a question regarding the r...
# ask-questions
b
Hello Everyone: I have a question regarding the runInlineExperiment. I did setup a experiment with 60% and 40% variations. But I found that the variation distribution is not consistent and it's not in the given range. here is my code:
Copy code
$growthbook = Growthbook::create()->withAttributes([
            // Targeting attributes
            'id' => time(),
            'someCustomAttribute' => true
        ]);
   $exp = InlineExperiment::create(
          "my-experiment-1",
          ["A", "B"]
        )->withWeights([0.6, 0.4]);

        // Either "red", "blue", or "green"
       $v = $growthbook->runInlineExperiment($exp)->value;
Is there anything I am missing here?
h
Hard to say without knowing the rest of your setup. Are you assigning attributes to your $growthbook sdk? Do your attributes contain an
id
field (or you can use another hashing field on the experiment via something like
->withHashAttribute("sessionId")
)?
b
I just updated my post with coomplete code
I am not assigning any session id
f
using time as an ID is not a great idea as it won’t be sticky
what percentage mix did you get?
b
I got B more than 6 times
But it should not return it more than 4 times
A also I got more then the defined percentage
f
the weights are probabilistic, and will have some random variability - how large was your sample size?
b
I did around 55 samples
b
Yeah It's not matching.
I did 100 sample with A : 0.6 B: 0.4 And got A = 55 B = 45 5 extra in B Is there any way to solve this? If we use cloud then will it be fixed?
f
100 is not enough of a sample size, and random assignment variations will dominate