https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
b

brave-agent-21457

10/06/2023, 5:42 PM
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

happy-autumn-40938

10/06/2023, 5:56 PM
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

brave-agent-21457

10/06/2023, 7:20 PM
I just updated my post with coomplete code
I am not assigning any session id
f

fresh-football-47124

10/06/2023, 7:20 PM
using time as an ID is not a great idea as it won’t be sticky
what percentage mix did you get?
b

brave-agent-21457

10/06/2023, 7:21 PM
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

fresh-football-47124

10/06/2023, 7:22 PM
the weights are probabilistic, and will have some random variability - how large was your sample size?
b

brave-agent-21457

10/06/2023, 7:23 PM
I did around 55 samples
b

brave-agent-21457

10/07/2023, 1:21 PM
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

fresh-football-47124

10/09/2023, 5:54 PM
100 is not enough of a sample size, and random assignment variations will dominate
2 Views