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
Merging databasesHi there, I really appreciate any help you can offer me. Basically I have a relational database iss…
Estimate parameters from restrictions on regression parameters via GMMDear all, I am trying to replicate the market resiliency model used in the following paper: Bessemb…
Missing categories in newly created categorical variableHi Statalist. I have found that after creating a new categorical variable that not all categories a…
Fixed effects code in a regressionDear Everyone, I would like to know if my code is correct. I am doing a regression (DiD) where I ha…
Need help:marginal problem of fmlogitHi I used this code to estimated average marginal effect after fmlogit fmlogit governing safety edu…
Subscribe to:
Post Comments (Atom)
0 Response to Global macro with adjusted logistic regression with factor variables
Post a Comment