Hi Nick Cox
I want to add and multiply certain variables in stata in a new variable VaR. My expression is:
gen VaR=constant_term+ (coeff_L_Tbills* L_Tbills)+ (coeff_L_Inf* L_Inf)
Now the issue is that, for some rows where when L_Inf is missing or 0, the whole outcome VaR of the equation becomes zero. which shouldn't be otherwise if calculated manually.
How can I amend the above code, to get the correct equation.
Best Regards
Related Posts with working out expressions(sum and multiply) in stata with some missing observations
Help with loopHi, Getting used to the program. I'm having some trouble with a loop. In the first column of the da…
How compare categories from a one variable they are the same among 10 data sets.Hello everybody, I’m working whit 10 data sets from the household survey, and I want to know if in a…
Help with creating a variable with lagged valuesHey guys, I am currently a final year student and i am writing my Economics dissertation on Oil pri…
How do i list ALL underlying codes for a variabel?I have a long list of diagnostic codes, which all have an underlying code that i need to use when wa…
Estimate risk for groupsCiao Here is the example using Stata data. Code: use http://www.stata-press.com/data/r13/drugtr …
Subscribe to:
Post Comments (Atom)
0 Response to working out expressions(sum and multiply) in stata with some missing observations
Post a Comment