I created a postfile and now trying to display the results from that postfile. There are two variables in the postfile, "var" which is a string and contains the name of variable from univariate logistic regression and "pval" which is a float and contains the p-value for that regression. I am trying to display the output in a specific way and therefore created a new variable which should enable a loop to run however I am only getting output from the first line and no subsequent entries. Would appreciate help with my logic/syntax...
gen n = _n
forvalues i = 1/10 {
if n == `i' {
local vname = var
local p = pval
disp "`vname' " _col(10) "(p=" %4.3f "`p')"
}
}
Related Posts with For-loops are killing me!
Multiple Instrumental VariableHey everyone, I have the following equation: y=aX1+bX2+cX3+dX4+e I want to instrument Z1 for X1 a…
No data is running with adding "capture" to my code, but there is no new error message (this code works for my elder collegue)Dear, Sorry in advance if I'm maybe not using the right STATA-language! I'm using STATA 16.1 on Wi…
Stuck while calculating moving medianHello, Currently, I am writing my thesis, in which I have to calculate the moving median of the ROE…
Help with the standarization processdear community I have 3 variables all measuring something for an extensive set fo countries. One of…
how to gen variable with two valuehow to Dividend dummy is a variable set to one if the firm paid a dividend in the year, and set to 0…
Subscribe to:
Post Comments (Atom)
0 Response to For-loops are killing me!
Post a Comment