Announcement

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

  • Graph bar chart with string variables

    There are basically 4 groups of variables. I want to graph a bar chart that has 3 slices, nation-wide, partial/gradual, and phasing students with all the data. What codes should I use?

    Click image for larger version

Name:	2021-01-08 100942.png
Views:	1
Size:	29.0 KB
ID:	1588785

  • #2
    You need to start by using encode to change your string variables to numeric variables. Another option is installing and using Roger Newson's sencode ("sequential encode"), available from SSC.

    Then follow the help file for graph pie.

    Code:
    . ssc describe sencode
    
    --------------------------------------------------------------------------------------
    package sencode from http://fmwww.bc.edu/repec/bocode/s
    --------------------------------------------------------------------------------------
    
    TITLE
          'SENCODE': module to encode a string variable non-alphanumerically into a
            numeric variable
    
    DESCRIPTION/AUTHOR(S)
          
           sencode is a sequential version of encode. It takes, as input, a
          string      variable, and generates, as output, a numeric
          variable, with value labels    corresponding to values of the
          string variable. Unlike encode, sencode      orders the numeric
          values corresponding to string values in the sequential
          order of appearance in the input string variable in the data set,
          or in      another order specified by the user, instead of
          ordering them in alphanumeric      order of the string value, as
          encode does. The mapping from numeric code   values to string
          labels may be one-to-one (coded in order of first  appearance
          of the string value) or many-to-one (coded in each observation
            by the position of that observation in the data set, or in the
          user-specified      ordering).
          
          KW: data manipulation
          
          Requires: Stata version 10.0
          
          
          Author: Roger Newson, National Heart and Lung Institute, Imperial College London
          Support: email [email protected]
          
          Distribution-Date: 20130930
          
    
    INSTALLATION FILES                              (type net install sencode)
          sencode.ado
          sencode.sthlp
    --------------------------------------------------------------------------------------
    (type ssc install sencode to install)
    David Radwin
    Senior Researcher, California Competes
    californiacompetes.org
    Pronouns: He/Him

    Comment

    Working...
    X