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
Compressing several loopsHi all, I have the 16 loops below, that I want to compress it: HTML Code: mat Y = J(21, 32, .) fo…
reference option Oaxaca decompositionHi I am interesting to use my own reference model. so, I tried to use the reference option with Oaxa…
Trend analysisDear Listers, I plan to run a trend analysis to explore how original wellbeing score (bad vs. good …
transposing rows to columnsHi, My data contains multiple observations for the variable Dealsubtype, whereas I want to change t…
Removing the last three digits of a four-digit numeric variableHi Statalist, I am working with a four-digit integer variable, ISCO08_1. I would like to simply dro…
Subscribe to:
Post Comments (Atom)
0 Response to working out expressions(sum and multiply) in stata with some missing observations
Post a Comment