If you want to use -mlogit- instead of Pearson chi square tests to determine the significance of these variables one at a time, the code is not much different:
I used msgtyp 2 as the base category for the outcome, just as you did earlier, so you can compare these results to your original efforts.
This will identify which variables are univariately significant as predictors of msgtyp using -mlogit-. The results should not be much different, if at all, from what you already have based on the chi sqsuare test.
And, again, there is no guarantee that when you then use all of these variables (or your favorite 15) together that all, or even any, will retain individual statistical significance.
Code:
set more off
// INITIALIZE LOCAL MACRO LISTING SIGNIFICANT RESULTS
// AS EMPTY
local significant foreach v of varlist gender-fir {
mlogit msgtyp i.`v', baseoutcome(2)
// CHECK SIGNIFICANCE OF RESULTS
// IF SIGNIFICANT, ADD `v' TO LIST
if e(p) < 0.1 { // NOTE e(p), NOT r(p) THIS TIME
local significant `significant' `v'
}
}
// SHOW THE RESULTS
display as text "The following variables have p < 0.1: "
display as result "`significant'
This will identify which variables are univariately significant as predictors of msgtyp using -mlogit-. The results should not be much different, if at all, from what you already have based on the chi sqsuare test.
And, again, there is no guarantee that when you then use all of these variables (or your favorite 15) together that all, or even any, will retain individual statistical significance.

I ran the command .Sir,is there any way to use all the variables together and display only the variables whose p value is less than 0.1 in both the msgtyp,( here1 and 3, considering 2 as a base) or considering any one of the 3 as base, omitting the variables (in case of any msgtyp) when the p value is greater or equal to 0.1 and keeping it for the other type where the p value is less than 0.1, like the image added?
Please give me a suggestion.
Comment