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
replace multiple variables at the same timeHi, I have 10 variables. All of these variables are dummy, 0 or 1. The original data set is 1 and . …
convert GPX file to CSV file in StataHi all, I have many gpx files. I want to show the tracking point by using spmap, which needs lon an…
panel data with three equationsHi all, I am trying to solve the following equation system. The data is panel and I will include fi…
Backing out the level variable from a first-differenced logHi I have a variable that is only available in my dataset as first-differenced log variable (dtfp, w…
I want my string values to become numeric values Code: * Example generated by -dataex-. To install: ssc install dataex clear input str26(q11r1_faceb…
Subscribe to:
Post Comments (Atom)
0 Response to working out expressions(sum and multiply) in stata with some missing observations
Post a Comment