Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    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:

    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'
    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.

    Comment


    • #17
      Thank you sir. 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?

      Comment


      • #18
        If what you want to do is eliminate the rows of the output table that say "(omitted)", just add the -noomitted- option to your -mlogit- command.

        If that's not what you want, try to explain, or give an example of what you would like your output to look like.

        Comment


        • #19
          Sir, I want to have all the predictor variables that are significant at the 0.1 level as predictors of msg_typ together, not one by one in the output and you know that in such cases some variables may be significant for one msgtyp but not the others, in that case I want that variable omitted for the msgtyp where it is not significant. Please check this image, here output for 14 variables are displayed together and the insignificant ones are omitted only for the msgtyp where the are insignificant(1 or 3). I want the output in this way . Here mlogit was used.But here are only 4 significant variables in msgtyp 1 and 8 significant variables in msgtyp 3 but I need more variables(as more as possible) and here the variables were chosen randomly which I don't want.I want all the variables will be checked and only the significant ones will be displayed as displayed in the image below.
          Click image for larger version

Name:	Slide1.JPG
Views:	4
Size:	80.2 KB
ID:	203104

          Last edited by Miraz Mahmud; 03 Sep 2014, 11:13.

          Comment


          • #20
            In the output you show above what command did you use? Did Stata omit the variables that are showing up as omitted or did you edit the output?
            If those variables were omitted by Stata you need to figure out why. Are they collinear? Are they perfect predictors of your outcome? In the case of at least two of the variables it looks like they were omitted because you included them twice in the command (dm50m & dm50100)

            I think you really need to think through the modelling process carefully here.
            As was pointed out early in this thread, you can use stepwise regression to find a model that has as many significant predictors as possible. However, many people, myself included, dislike the stepwise strategy and would strongly recommend including variables that you think theoretically should predict your outcome. Then discuss whether they do and what effects they have. Taking this strategy will mean that not all your coefficients are significant. That isn't useless information! Knowing what things have no effect on the outcome when examined with other variables is part of the story of how the process you're modelling works.

            We can't build your models for you. This is something you have to do on your own. Starting with the variables that have a significant relationship with the outcome alone and seeing how they work together in a model (the strategy Clyde has been guiding you on) is one way to build the model. Once you have that model, though, you should look at the model as a whole, not just obsess over the p-values. Is the size or direction of any of the coefficients surprising? Are any of the things that aren't significant surprising? Are any of the things that are significant surprising?



            Comment


            • #21
              Sir,please check this file. here I constrained the variables which are insignificant for a msgtyp.Here "profonon" was constrained for msgtyp 3 but not for 1 because it gave insignificant values for msgtyp 3.Here insignificant means p value less than 0.1.Here in the command [ mlogit msgtyp dm50m profonon tdfacci dm50100 fminjurd avs70 inc1525k ageless20 age2030 age3040 , constraint (1, 2, 3, 4, 5,6, 7, 8) base(2)] I putted the variables randomly and manually and when I got one insignificant for both 1 and 3, I removed that and I only kept the significant ones. When I got one which is significant for one msgtyp and not for the others then I omitted it for that msgtyp only. But I want to know is there any command to do this without inputting the variables randomly and without constraining the insignificant ones manually? Please give me a suggestion.
              Attached Files

              Comment


              • #22
                I will repeat the previous suggestion. Read the helpfile for stepwise (type help stepwise).

                Comment


                • #23
                  In the above, the command of Clyde Schechter is ok, all the variables can be run together but the results are coming one by one and both the significant and insignificant ones are displayed in the output tables. I want to have all the significant variables together in one table like in the above smcl file.

                  Comment


                  • #24
                    Thank u sir

                    Comment


                    • #25
                      I think as time goes on I understand less and less what you are trying to do here.

                      Perhaps you want to run -mlogit- using, together, all of the variables my earlier code identified as significant. That is fairly simple:
                      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'
                      // NOW RUN THE REGRESSION WITH THESE RESULTS
                      //   FIRST NEED TO APPLY FACTOR VARIABLE NOTATION
                      local fv_significant: subinstr local  significant " " " i.", all
                      local fv_significant i.`fv_significant'
                      mlogit msgtyp `fv_significant', baseoutcome(2)
                      I'm not sure where you want to go from there. If your plan is to have Stata automatically constrain to zero those coefficients where the variable does not attain 0.1 level significance in this last output, that is possible but the code is fairly complicated. Since it is also not a sensible way to build a model, as far as I can see, I don't think I want to go there.

                      You have also, at various times, suggested that you want to find some largest possible set of significant variables. You can make a stab at this using -stepwise-, though, again, this is a dreadful way to build a model. There is no guarantee that -stepwise- will get you a large set of significant independent variables (and, even if it does, be aware that the nominal significance of variables after -stepwise- is actually meaningless). In case you are thinking of trying to automate all possible subsets of at least 15 variables, bear in mind that there are more than 8 X 1015 subsets with exactly 15 variables, and a much greater number with 15 or more. Even the most efficient software for trying them all will not finish the job during your lifetime--not even close.

                      So at this point I think it comes back to what Sarah Edgington pointed out above: you need to build your model by focusing on what is meaningful within your scientific domain, and what previous research and theory support as variables that should be looked at. Arbitrary criteria such as "at least 15 variables" and "all p > 0.1" make no sense from a scientific or statistical perspective.
                      Last edited by Clyde Schechter; 03 Sep 2014, 13:02.

                      Comment


                      • #26
                        yes sir, this is what I am trying to do. After this step I want to find out, in comparison to the base,comparison of the likelihood of the other 2 dependent variables with the each independent variables. For example,in comparison to the msgtyp 2(base), higher profonon is associated with higher likelihood of msgtyp 1 and lower likelihood of msgtyp 2. because the co-efficient value is higher(+) in 1 and lower(-) in 3 for profonon.
                        Click image for larger version

Name:	Slide1.JPG
Views:	4
Size:	80.2 KB
ID:	207228

                        Last edited by Miraz Mahmud; 04 Sep 2014, 12:20.

                        Comment

                        Working...
                        X