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
Multilevel model with olog?I usally use the command: mixed dep_var || country_var: Problem is that my dependent variable is o…
Generating new ID variable taking into account duplicates across 2 other variablesFirst time poster, so I’m sorry for any errors… I have two ID variables (ID1 and ID2). I want to cr…
Need help with Mean for Grouped DataArray Good morning Stata Family, Please I want to create a new variable for the average wage earne…
Specification of treatment and control group in diff-in-diffDear all, I am doing a difference-in-differences estimation to see the effect of a parental leave re…
Creating space between bar chartsHi, I am using Stata 17 and need help in bar charts. Below is an example of my dataset: Code: * E…
Subscribe to:
Post Comments (Atom)
0 Response to Global macro with adjusted logistic regression with factor variables
Post a Comment