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!
How to get the start and end round of each user?Hi all, I need your help. I have a dataset with two variables: - Username - Round: Ordinal number o…
Showing 95%-CI intervals in bar graphHello everyone In my data I have a dichotomous variable (=value) for three different conditions (wh…
Delete observations under conditionsHi, I have a question that I hope someone can answer. I'm still pretty new to stata, so excuse me if…
fillin (a question on Twitter)https://twitter.com/johannesmboehm/s...48146396504064 raised a question about fillin. As tweets may …
Marginal effects-interpretationDear all, I am using a logit model to find which are the possibities the dependent variable Y to be…
Subscribe to:
Post Comments (Atom)
0 Response to For-loops are killing me!
Post a Comment