Hi,

I am trying to generate a new variable b with the following formula using all existing variables,

Code:
gen b = .25*((((mean_dr0-mean_dr)(mean_or0-mean_or))/var_or) + (r_ordr0*(var_or0/var_or)))  ///
      + .25*((((mean_dr1-mean_dr)(mean_or1-mean_or))/var_or) + (r_ordr1*(var_or1/var_or)))   ///
      + .25*((((mean_dr2-mean_dr)(mean_or2-mean_or))/var_or) + (r_ordr2*(var_or2/var_or)))   ///
      + .25*((((mean_dr3-mean_dr)(mean_or3-mean_or))/var_or) + (r_ordr3*(var_or3/var_or)))
and I get back

unknown function ()
I just don't see what's wrong with the equation. Any thoughts?

I did not copy the text from a text editor. I am using Stata 16.
Thanks
Herman