I want to use global macro in crude and adjusted logistic regression.
webuse bpwide
generate bp = (bp_after > bp_before)
tab bp
global expVar = "sex agegrp"
foreach x of global expVar { // crude
logistic bp i.`x'
}
logistic bp bp_before i.$expVar // adjusted
As sex and agegrp are factor variables I need i. in front of these variables. But in adjusted logistic, I can only have i. in front of the first variable in the result.
I can re-do this by creating a new global macro as
global expVar = "i.sex i.agegrp"
But I do not want to have multiple macros for the same list of variables.
Nick Cox Can you please help?
Related Posts with Global macro with adjusted logistic regression with factor variables
Using STATA "mixed" command with autoregressive correlation of residuals for comparing time series of medical Google queriesDear all, thanks in advance. I need an information. I have 4 different time series (number of dai…
including weights in crosstab with percentagesI want to crosstab two variables, using the weighted results and show the column percentages. Ideall…
xtgee - nbinomial family distribution - estimates diverging (missing predictions)Dear Statalisters, I am trying to analyze an unbalanced panel dataset with appr. 10,000 firm-year o…
Specifying lcolor in twoway line plot with boleansHello, I would like to define a line pattern to distinguish by race and insurance type. For example…
Different Outputs for the same programsHello together! I have a STATA program that I got from a research paper and I modified it a little …
Subscribe to:
Post Comments (Atom)
0 Response to Global macro with adjusted logistic regression with factor variables
Post a Comment