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
inquire about rowtotal Code: gen s1 = x1+x2+x3+x4 replace s1 = 0 if s1 == . egen s2 = rowtotal(x*) assert s1==s2 Why it's …
Inquire about merge commandHi, I need to merge 3 files. And everytime I need to drop _merge after merge command. Is this the us…
Continuous interaction termI am working on understanding youth unemployment and use four main independent variables in my analy…
looping over data filesHello Users, I have data of banks by id numbers. What I want to do is: (1) to merge 4 tables of one …
ARIMA Modelling with Binary Independent VariableI am trying to fit an ARIMA model to my intervention analysis but when I use the syntax and add both…
Subscribe to:
Post Comments (Atom)
0 Response to Global macro with adjusted logistic regression with factor variables
Post a Comment