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?
Problems when running optimal k-means cluster solution programDear Team, After reading the excellent "Stata tip 110: How to get the optimal k-means cluster solut…
Why do i have large z test statistics when i ran translog modelFirst i ran frontier model and then i did translog method here i have obtained large wald chisquare …
Studentized deleted residuals and DFfits after logistic regression in Stata. How to calculate?How can I calcilate studentized deleted (externally, jackknifed) residuals and dffits after performi…
Results InterpretationHi everyone, Can anyone help me interpret these results, specifically the F-test below. What does t…
Replacing missing variable with other observations that satisfy certain conditionsHi all, I am working on a cross-country dataset. The dataset is created when I merge the bilateral t…
Subscribe to:
Post Comments (Atom)
0 Response to How to create a loop to select 2 variables from a list?
Post a Comment