Different result with P(1-P) and P*(1-P)
Posted: Tue May 16, 2023 10:24 pm
Good evening, dear friends. A query: I am developing Logit clustered, and one section involves using weighted least squares where the following weight w is used for the following expression:
Zi/root_w = 1/root_w + beta*Xi/root_w + ui/root_w
Where w=1/(Nro_families * P(1-P)
For the effect I need to generate root_w with the following instruction:
(1) Genr raiz_w = @sqrt(1/(Nro_families*P(1-P))))
However, if the instruction is:
(2) Genr root_w = @sqrt(1/(Nro_families*P*(1-P))))
The result is different.
Note that the difference between equations (1) and (2) is that in the first case I use P(1-P) and in the second case P*(1-P).
I do not know why using the * produces a different result.
Zi/root_w = 1/root_w + beta*Xi/root_w + ui/root_w
Where w=1/(Nro_families * P(1-P)
For the effect I need to generate root_w with the following instruction:
(1) Genr raiz_w = @sqrt(1/(Nro_families*P(1-P))))
However, if the instruction is:
(2) Genr root_w = @sqrt(1/(Nro_families*P*(1-P))))
The result is different.
Note that the difference between equations (1) and (2) is that in the first case I use P(1-P) and in the second case P*(1-P).
I do not know why using the * produces a different result.