Announcement

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

  • Oneway plot

    Good evening all,
    I am trying to generate a one-way plot in which the y-axis has 8 dichotomous variables, and the X axis is a percentage of those who responded "yes" (coded as 1) on my Y variables. I want the variables on the Y-axis to be ranked in order of increasing percentage.

    I want it to look like the graph that I have attached. I have tried onewayplot and dotplot commands but I am getting the output I desire.

    Thanks as always for your help.
    Marvellous

    Attached Files

  • #2
    I see no correspondence between your description and your graph. The vertical axis is categorical and the horizontal axis is not a percent scale. How can 8 dichotomous variables be shown on one axis?

    Comment


    • #3
      I think he meant this:


      Code:
      do http://www.radyakin.org/statalist/2016/1356976-oneway-plot.do

      Comment


      • #4
        Yes, on the Y axis, there are 8 categorical variables, coded as yes=1, and no=0. On the graph I attached, the frequency of the Y variables is shown on the X axis, while the mean is shown on Sergiy's graph.

        Instead of showing the frequency or mean on the X axis, I want to show the percentage of those who answered "yes" (coded as 1) on my Y variables.

        Does this make make it clearer?

        Comment


        • #5
          Sorry, but that's not one bit clearer to me. I see one variable in #1 which is something with values of the order of 1000 for various U.S. States. How we are supposed to know that this is a frequency, and how this relates to 8 dichotomous variables, is entirely opaque.

          Sergiy posted code; why can't you adapt to it to your problem? Why don't you post sample data?
          Last edited by Nick Cox; 17 Sep 2016, 10:21.

          Comment


          • #6
            Marvellous, if you multiply your outcome vars by 100, then the mean will be the percentage answering "yes" since it is coded 1.

            Nick, I think his outcomes are like "room was clean", "breakfast was tasty", "staff was polite", etc outcomes (things commonly plotted on a spider chart). Given a 1000 respondents, one can compute either frequency or proportion of those who said "yes" on any dimension. Linearization in the form chosen is probably an attempt to rank the dimensions.

            Sergiy

            Comment


            • #7
              Sergiy: Thanks. I don't have difficulty in imagining 8 dichotomous variables. My difficulty is seeing precisely what Marvellous is unsure about about and how her [NB] question is linked to her data on the one hand and to her graph on the other hand. Presumably she wants code and specific code would follow from a specific question.

              Comment


              • #8
                Hi Nick and Sergiy,
                Thanks for your input. I have tried Sergiy's code but I am getting error messages about the "over" and "ylabel" options.
                Last edited by Marvellous Akinlotan; 20 Sep 2016, 13:33.

                Comment


                • #9
                  Sorry, but I have to draw your attention to requests not to post Word or Excel documents here, for reasons spelled out in the FAQ.

                  http://www.statalist.org/forums/help#stata especially 12.5

                  Comment


                  • #10
                    That is noted. Thanks Nick.

                    Comment

                    Working...
                    X