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
Cox model margins estimatesDear colleagues, I am using STATA version 15.1 and am struggling to estimate margins for a continuo…
Export data in histogramI am new to stata (I am using version Stata/IC 12.1 for Mac, 64-bit Intel) and succeeded in producin…
Question: Merging observations in one variable while simultaneously summing the numbers of the related observations in another variableHello I am new to this forum, so sorry if this question has been asked before (tried searching for …
Stata 16: garbled character in ado & help file.Dear Stata users, Some ado & help file which displays correctly under Stata 13 are now giving r…
Fama French: Calculating portfolio returns within sub-portfolios (aggregation of monthly returns) in different dimensionsHey all, I hope you are doing all well. I would like to calculate portfolio returns for an individ…
Subscribe to:
Post Comments (Atom)
0 Response to working out expressions(sum and multiply) in stata with some missing observations
Post a Comment