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!
Trouble with ommited variable while adding lags to regressionDear statalisters, I am modeling a regression related to a time series. My original regression meet…
Trouble with splitvallabelsDear statalisters, I have trouble using splitvallabels. As I understand splitvallabels it splits th…
xtpmg or xtmg?Hello, I want to understand the difference between these two estimators and how well they can estim…
Baron and Kenny - multiple predictor variablesGood afternoon everyone, For my master's thesis, I investigate the effect of four different job cra…
How to lag an entire equationI am trying to replicate what's called a 'dynamic autoregressive' logit model to predict a binary ou…
Subscribe to:
Post Comments (Atom)
0 Response to For-loops are killing me!
Post a Comment