Hello!
I would like to create a loop that allows me to select all the possible combinations of 2 variables from a list of n variables and fit a logistic regression model for each combination.
For example, let's suppose that there are 8 variables x1 - x8.
I want to fit 36 logistic models:
logit y xk xl w z
where y is the dependent variable, w and z are covariates, and xk and xl are 2 independent variables from the group above.
Is it possible to do this with a loop instead of writing 36 lines of code?
Thank you in advance for your help!
Related Posts with How to create a loop to select 2 variables from a list?
Obtaining pooled OLS estimatesI'm trying to compare Oaxaca-Blinder decomposition results to OLS estimates regarding the male wage …
Help with converting string to numeric variablesI have a dataset on infant and child ages, where age is stored as a string variable and by week,mont…
Competing risk survival analysisHello, I am approaching for the first time a competing risk survival analysis. I am using Stata/SE …
conditional pricing model using GMMHi everyone! I have a question about GMM command of Stata Following Choi,Hiriki, Takezawa(1998), I u…
Unbalanced Panel DataHi everyone, I have the following unbalanced panel data which stands from year 2000 to 2019: ID …
Subscribe to:
Post Comments (Atom)
0 Response to How to create a loop to select 2 variables from a list?
Post a Comment