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
First non zero integerHi, I have a sample with 667 variables. I want to replace the observations of variable 3 till varia…
Heckman selection model with Blinder-Oaxaca DecompositionI am trying to decompose the log wage gap between the non-disabled (DISTYPE = 1) and work-limited di…
Renaming year variableHi All. Sorry for such a silly question, because I have read the help section in stata on this and I…
T-tests and dummy variablesHi! I'm pretty new to Stata and statistical analyses in general, so sorry in advance if something I…
Bootstrap Error: Command "_check_dots" unrecoginzedHi All, I'm working on a project and I want to use bootstrapped standard errors. I'm using the oaxa…
Subscribe to:
Post Comments (Atom)
0 Response to Global macro with adjusted logistic regression with factor variables
Post a Comment