Dear Stata Users,
I run logistic regressions with the dependent variable HED and 8 independent variables (v1-v8) in 35 countries (COU).
What I want to do is to save the odds ratio coefficients for the variables and countries. I.e., for all participants from a country there is the same value for each of the independent variables, which is the OR coefficient.
This can also be in a new dataset.
Based on that I would like to run a cluster analysis to cluster the countries based on the results of the logistic regression.
Can anyone help me with saving the coefficients? I learnt about the matrix command and tried to read in the forum, something like
... but i do really not how to apply it to my analyses-
My command for the logisitic regression is:
Would be really happy to get your help - it does not necessarily be the matrix command, happy to hear other possibilities of saving aswell!
Best
Anne
I run logistic regressions with the dependent variable HED and 8 independent variables (v1-v8) in 35 countries (COU).
What I want to do is to save the odds ratio coefficients for the variables and countries. I.e., for all participants from a country there is the same value for each of the independent variables, which is the OR coefficient.
This can also be in a new dataset.
Based on that I would like to run a cluster analysis to cluster the countries based on the results of the logistic regression.
Can anyone help me with saving the coefficients? I learnt about the matrix command and tried to read in the forum, something like
Code:
matrix list r(table) matrix p_`x' = r(table) matrix f_`x' = p_`x'[1, 1...] matrix l_`x' = (`x')
My command for the logisitic regression is:
Code:
levelsof COU, local(levels) foreach j of local levels { display `j' *forval j = 100/`r(max)' { *di "{title:`: label (nation) `j''}" logistic HED v1 v2 v3 v4 v5 v6 v7 v8 if COU == `j' }
Best
Anne
Comment